fix(release): close four defects in the owned-soname cross-check - #1335
Merged
Conversation
Follow-up to the extraction merged in #1299. Review of an independent implementation of #1285 found four defects in the version that landed; this applies the fixes to it rather than re-landing the extraction. The headline assertion produced NO diagnostic on the platform it runs. A bare `[[ ]]` followed by `check $?` aborts under errexit before its own FAIL line, before the expected/got dump, and before any remaining case executes. Measured with the derivation mutated: exit 1 and zero output. Worse in direction -- bash 3.2 does not apply errexit there, and tests/meson.build gates this test to Linux, so the diagnostics were dead exactly where they run. The cross-check re-inlined the classifier it had just extracted, ten lines below the call, and the two did not agree: the inline copy used -maxdepth 1, so a library installed under a subdirectory of libdir was invisible to the check whose job is catching libraries the owned set does not name. It now calls derive-owned-sonames.sh. Both the derivation and comm failures were swallowed. Either yielded an empty result that comm reported as a clean subset, so the cross-check passed having asserted nothing. Empty is not merely tolerable there, it is impossible -- libdir is dirname of the libwirelog located above -- so the only way to reach it was a real failure. Measured: the old form exits 0 with missing=''; the new form exits 1 and surfaces the derivation's own message. The locale probe is pipeline-free. Not because the SIGPIPE is reachable at any real locale-list size, but because it is an `if` CONDITION: errexit does not apply, so a SIGPIPE would silently take the else branch and print `ok locale (en_US absent, skipped)` while dropping both locale assertions. Reporting PASS while having stopped asserting is what this gate exists to prevent. Also: the "an empty set would make the closure check vacuous" rationale was false -- check-shared-library-closure.sh and run-upgrade-matrix.sh each carry their own `-s` guard, both predating the extraction. The Linux gate now records both its reasons, macOS being that the locale case asserts glibc's punctuation-ignoring collation which Darwin is not known to provide, so widening would be a false failure. normalize_root is deleted as unreachable under that gate. Two assertions now check the specific outcome rather than merely non-zero, which `set -u` and the empty-set guard satisfied by other routes. Refs #1285
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1285. Based on
main, independently mergeable.This does not re-land the extraction. An independent implementation of #1285 merged as
#1299 while my branch sat unpushed. Reviewing that merged version found four defects; this
applies the fixes on top of it. My original branch (#1333) duplicates the extraction and is
closed as superseded.
The four defects, all present on
maintoday1. The headline assertion produces no diagnostic on the platform it runs.
test-derive-owned-sonames.sh:89is a bare[[ ]]followed bycheck $?. Under errexit thataborts before its own FAIL line, before the expected/got dump, and before any remaining case
executes. Measured with the derivation mutated: exit 1, zero output. The direction is the
worst one — bash 3.2 does not apply errexit there, and
tests/meson.buildgates this test toLinux, so the diagnostics are dead exactly where they run.
2. The cross-check re-inlines the classifier it just extracted, ten lines below the call —
the untested, release-only duplicate #1285 exists to remove. And the two disagree: the inline
copy uses
-maxdepth 1, so a library installed under a subdirectory oflibdiris invisibleto the check whose job is catching libraries the owned set doesn't name.
3. Derivation and
commfailures are swallowed. Either yields an empty result thatcommreports as a clean subset, so the cross-check passes having asserted nothing:
Empty is not merely tolerable there — it is impossible, since
libdirisdirname "$lib"where
$libwas located four lines earlier. The only way to reach it is a real failure.4. The locale probe is a pipeline under
set -o pipefail. Not fixed because the SIGPIPE isreachable — measured headroom is large — but because it is an
ifcondition, so errexitdoesn't apply: a SIGPIPE would silently take the else branch and print
ok locale (en_US absent, skipped)while dropping both locale assertions. Reporting PASSwhile having stopped asserting is what this gate exists to prevent.
Also corrected
check-shared-library-closure.shandrun-upgrade-matrix.sheach carry their own-sguard,both predating the extraction, and one sits directly below the
|| exit 1whose commentdescribed an unreachable outcome.
macOS reason is that the locale case asserts glibc's punctuation-ignoring collation, which
Darwin's
en_US.UTF-8is not known to provide — and the candidate loop triesen_US.UTF-8precisely because macOS has it, so widening the gate would produce a hard false failure.
The prerequisite for ever widening it is stated.
normalize_root(17 lines of Windows pathhandling) is deleted as unreachable under that gate.
set -uand the empty-set guard satisfiedby other routes — they held while pinning nothing they named. Now they assert exit 2
(usage) and the specific "not a directory" message, and each is killed by its own mutation.
Verified on real GNU bash 3.2.57 as well as 5.3. Local: 314 Ok / 0 Fail.
tests/meson.buildcarries only the gate-comment change — I copied the whole file first andcaught a 164-line diff that would have silently reverted other merged work.