NAS-139412 / 26.0.0-BETA.2 / Persist local reboot reasons (by Qubad786) (#18715)
## Problem
Local reboot reasons (`SystemRebootService.reboot_reasons`) were stored
in an in-memory Python dict. If middleware restarted without a system
reboot (crash, OOM, `systemctl restart middlewared`), all accumulated
reasons were silently lost. This caused failover to be unblocked
prematurely (`LOC_FIPS_REBOOT_REQ` / `LOC_UPGRADE_REBOOT_REQ` vanished
from `failover.disabled.reasons`), `toggle_reason` to invert its
behavior after restart, and the remote node to get a false "all clear"
when querying `system.reboot.info`. Additionally, the existing keyvalue
key naming for remote reboot reasons (`remote_reboot_reasons_A` meaning
"reasons recorded BY Node A about the other node") was confusing.
## Solution
- **Local reasons persisted via volatile cache**: Replace the in-memory
dict with the `cache` service (TDB VOLATILE at
[27 lines not shown]
kitty: Fix serious bug in the setup.py patch.
Ensure candidates is a tuple, not a string. That single missing comma caused
builds on macOS to traverse the entire file system multiple times as:
for candidate in ('@PREFIX@/share/fonts/')
expands to e.g. ['/', 'o', 'p', 't', '/', ...], whereas:
for candidate in ('@PREFIX@/share/fonts/',)
correctly expands to e.g. ['/opt/pkg/share/fonts'].
Add SwitchableSimpleService base class
Subclasses can override select_systemd_unit_name() to switch between
systemd units at runtime, or return None when no unit is involved.
select_etc() allows mode-dependent config generation. Intended to
support services with alternative kernel/userspace implementations.
kevent: do not check knote lists being empty before removing a knote
If a knote belongs to the list, there is no reason to check for the list
emptiness. On the other hand, if the knote does not belong to the list,
then checking for emptiness is not enough since there might be a
different knote there.
Reviewed bu: kevans, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56341
Mark llvm/test/ExecutionEngine and llvm/test/Examples tests as UNSUPPORTED for zOS (#190835)
Tests in `llvm/test/Examples` and `llvm/test/ExecutionEngine` use JIT
which is unsupported for zOS causing the tests to fail.
---------
Co-authored-by: Bahareh Farhadi <bahareh.farhadi at ibm.com>
[PatternMatchHelpers] Improve compile time of m_Combine(And|Or) (#191413)
Squelch the stage-2 compile time regression introduced by the variadic
m_Combine(And|Or) matchers, by replacing the std::apply on a std::tuple
with a recursive inheritance.
[InstCombine] Generalize `(A + 1) + ~B` fold to any constant (#188271)
Example:
int foo(int a, int b) { return a - 1 + ~b; }
Before, on AArch64:
mvn w8, w1
add w8, w0, w8
sub w0, w8, #1
After (matches gcc):
sub w0, w0, w1
sub w0, w0, #2
Proof: https://alive2.llvm.org/ce/z/g_bV01
[BOLT] Fix iterator bugs (#190978)
Fix iterator misuse in four BOLT passes, caught by _GLIBCXX_DEBUG
(enabled via LLVM_ENABLE_EXPENSIVE_CHECKS=ON).
* AllocCombiner: combineAdjustments() erases instructions while
iterating in reverse via llvm::reverse(BB), invalidating the reverse
iterator. Defer erasures to after the loop using a SmallVector.
* ShrinkWrapping: processDeletions() uses
std::prev(BB.eraseInstruction(II)) which is undefined when II ==
begin(). Restructure to standard forward iteration with erase.
* DataflowAnalysis: run() unconditionally dereferences BB->rbegin(),
which crashes on empty basic blocks (possible after the ShrinkWrapping
fix). Guard with an emptiness check.
* IndirectCallPromotion: rewriteCall() dereferences the end iterator via
&(*IndCallBlock.end()). Replace with &IndCallBlock.back().
* TailDuplication: constantAndCopyPropagate() uses
std::prev(OriginalBB.eraseInstruction(Itr)) which is undefined when Itr
== begin(). Restructure to standard forward iteration with erase.
[libc++] Speed up stable_sort.pass.cpp by reducing redundant test coverage (#187368)
We don't need to run the full exhaustive test for all floating points,
as long as we're testing the radix sort code path (which we are, since
radix sort triggers at 1024 elements).
This reduces the test execution time on my machine from 20s to 12s.
Fixes #187329