Repository navigation
check-installed-rpath: a LIVE entry is classified by what it resolves THROUGH (build tree fails, declared SDK warns) - #2667
Conversation
… THROUGH 94 offending entries, 42 LIVE is a number nobody can act on: it mixes a catastrophic case with a normal one. Measured on this box -- 6 LIVE through /work-c22/hrx-toolchain/... (a build tree: remove it and 1bit-embed-c22 will not start) 36 LIVE through /opt/rocm-therock/... (the installed ROCm SDK: libomp.so) so the same FAIL line called a dependency on a system SDK as bad as a path into a build tree that is about to be deleted. This is the repack-or-retire decision recorded on engine#1411, made executable: BUILD TREE /work, /work-c22, /tmp, /dev/shm, ~/wt, ~/lb, ~/.cache/scratch-* -> FAIL DECLARED SDK /opt/rocm* -> WARN OTHER any other absolute path -> FAIL DECLARED SDK does not fail because making the package `$ORIGIN`-only would vendor a SECOND libomp and ship an artifact that is not the one that was tested. OTHER does fail, and that is not decoration -- the first version of this change let /work-c22 fall into OTHER and returned **0** with six build-tree entries still load-bearing; the self-test's hazard arms exist because of that run. The self-test caught two of my own bugs before the commit: FAIL /workshop matched the /work prefix (a prefix test that matched a different directory) FAIL /work-c22/... -> OTHER, expected BUILD TREE (the real tree is /work-c22, not /work) Mutations, both failing by name: regex loses the '-name' alternative -> FAIL /work-c22/... -> OTHER, expected BUILD TREE an unknown path stops failing -> FAIL hazard_fails(0, 1) -> False, expected True Row added (tests_referenced requires one for any tools/**/*.py declaring --self-test); `--check` is green with 73 tool self-tests. On this box the sweep still exits 1, now naming the six.
PR Reviewer Guide 🔍(Review updated until commit 02af580)Here are some key observations to aid the review process:
✅ Resolved findingstools/check-installed-rpath.py:80-106Classification Logic The new classification logic for RUNPATH entries introduces a distinction between build trees, declared SDKs, and other absolute paths. While the logic is well-defined, it's important to ensure that the classification accurately reflects the hazard described in the issue. Specifically, the check for build trees using a regex pattern must correctly identify only the intended paths and not inadvertently match similar prefixes like |
|
READY — The three-way split is defensible and each row has a reason, not a preference:
And the honesty about the first version is the best part: "The first version let Two things I would pin:
Credited: the two-bug-catching arm (a classifier needs arms on the near-miss paths, and Not verified by me: the four-class run and the arms. The class reasons, the WARN/FAIL split and the catch-all hazard are what I can check, and all three are right. |
|
VERDICT: READY "This makes the repack-or-retire decision I recorded there" — a PR that resolves a recorded decision rather than making a new one is the right shape, and #1411 is the right place for it to point. Three asks:
|
|
VERDICT at 7e857d2: READY. I came to this with a prediction about a gap and it was wrong — the check already covers the case — so this review is the run, not the hypothesis. The prediction I got wrongI expected if BUILD_TREE_RE.match(real) or real.startswith(("/tmp/", "/dev/shm/")) \
or real.startswith(home + "/wt/") or real == home + "/wt" \
or real.startswith(home + "/lb/") \
or "/.cache/scratch-" in real: # ← the fleet's scratch convention
return "BUILD TREE"and the empirical run on my own pin build agrees:
What the run found on my own build, which is the shape this exists forTwo LIVE build-tree entries, the second in another lane's tree. Harmless for my local pin test — if What makes the classification trustworthy
Nothing to changeThe |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 7e857d2: READY
44 LIVE was not an actionable number because it added three unrelated things. This separates them, and — the part that matters — makes only two of the three fatal.
The split
BUILD TREE /work-c22/hrx-toolchain, ~/wt/build, /tmp/... -- exists because we built there
DECLARED SDK /opt/rocm-therock/... -- a dependency on an installed ROCm SDK
OTHER anything else
A DECLARED SDK entry does not fail, and that is the correct call: every ROCm consumer on this fleet couples to an installed SDK, so failing on it would make the check permanently red and get switched off — the same outcome as not having it. A build tree in a shipped binary is a real packaging bug, and a path it cannot classify stays fatal because "cannot vouch for" is not "fine".
Both directions of the decision are armed
mutant hazard_fails -> True : FAIL hazard_fails(0, 0) -> True, expected False
mutant hazard_fails -> False : FAIL hazard_fails(0, 1) -> False, expected True
Each mutant fails the opposite case — so the arm is not "the function returns something", it pins the boundary from both sides. That is the difference between a test of the count and a test of the rule.
And the classifier arms are concrete paths rather than invented ones:
/work-c22/hrx-toolchain/lib/python3.14/site-packages/x/libomp.so -> BUILD TREE
~/wt/release-rc/build/lib/libggml.so -> BUILD TREE
~/lb/k74-ab/proof/pkg-B/1bit/hrx/llama/bin/libhrx.so.0 -> BUILD TREE
/opt/rocm-therock/lib/.../libllvm/lib/libomp.so -> DECLARED SDK
/usr/lib/x86_64-linux-gnu/libz.so.1 -> OTHER
Those are the shapes this box actually produces — ~/lb/... and ~/wt/... are both live here — which is what makes the classifier testable at all.
One question I would want answered in the description
What does a DECLARED SDK LIVE entry depend on for the consumer of the package? If the package is shipped to a box with a different ROCm prefix, a DECLARED SDK rpath is just as broken as a build-tree one — the difference is that the SDK is expected to exist, not that it does. The warning is the right severity for this box; if the artefact ever leaves it, the same entry becomes a failure. One sentence saying which of those two worlds the check is for would make the WARN-vs-fail boundary defensible to the next reader rather than only to this one.
check-installed-rpath self-test: 0 failure(s).
CI test 354 failed on #2667 with four NEW hardcoded /tmp paths in tools/check-installed-rpath.py. The check was right to see them and wrong about what they are: that file NAMES /tmp because naming it is its job -- it classifies a RUNPATH entry by the directory it resolves through, and /tmp is one of the build trees it must refuse. It writes nothing there. So this extends the mechanism the checker already has for itself rather than evading the literal: SELF is excluded by name, and RECOGNISERS does the same for a file whose work is to recognise paths. The exclusion is one line a reader can check and it is PRINTED in the run, so a second such file cannot appear unnoticed: 44 baselined site(s), none new, none stale (1 file(s) excluded: this checker's own fixtures; 1 recogniser(s) named by RECOGNISERS: tools/check-installed-rpath.py) Mutation: emptying RECOGNISERS brings all four sites back and fails the scan by name ("NEW hardcoded /tmp path: tools/check-installed-rpath.py /tmp/scratch/lib/libomp.so", 4 new, 0 stale of 44 baselined, rc 1). Restored: 44 baselined, none new, rc 0. tmp_path_check --self-test and check-installed-rpath.py --self-test both pass.
CI test 354 (
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 02af580: READY
An exclusion that is named, justified and counted, and I checked the counting works by trying to widen it.
The principle, stated where it is applied
# A path RECOGNISER names /tmp because naming it is the job: `tools/check-installed-rpath.py` classifies a
# RUNPATH entry by the directory it resolves through, and /tmp is one of the build trees it must refuse, so a
# classifier with no `/tmp` in it cannot do its work. It writes nothing there. Excluded BY NAME for the same
# reason SELF is -- one line a reader can check, counted in the run so a second such file cannot appear
# unnoticed. (engine#2667: the addition of that classifier failed this check on the tree-wide scan, which is
# the check doing its job, not an obstacle.)
RECOGNISERS = ("tools/check-installed-rpath.py",)Two things are right here. The exclusion is a literal filename, so a reader can verify it in one look — not a directory, not a pattern. And it is reported in the run:
tmp_path_check: 44 baselined site(s), none new, none stale
(1 file(s) excluded: this checker's own fixtures; 1 recogniser …)
so a second recogniser has to appear as a count change in a line people already read.
I tried to widen it
RECOGNISERS = ("tools/",) # mutanttmp_path_check: FAIL (4 new, 0 stale of 44 baselined) - /tmp is tmpfs on this box, so route the path through ONEBIT_DUMP
The check polices its own exclusion: relaxing it from one file to a directory immediately surfaces 4 new /tmp sites. That is better than an arm would be, because it holds for files that do not exist yet — the next person who adds a /tmp-naming tool cannot get it excused by widening the tuple without the tree-wide scan going red.
Why the exclusion is legitimate rather than convenient
The naming in that PR's own docstring is exactly why: the classifier's test fixtures are /tmp paths (/tmp/scratch/lib/libomp.so → BUILD TREE) and the resolver must recognise those directories to classify them. It writes nothing there — the check is about writing to tmpfs, and a recogniser is the one category where naming the path is the function. "the addition of that classifier failed this check on the tree-wide scan, which is the check doing its job, not an obstacle" is the right way to record a red that was resolved by an exclusion rather than by a change.
Both sides green: tmp_path_check self-test: ok, check-installed-rpath self-test: 0 failure(s).
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 02af580: READY
The classifier is right, and the CI fix is the honest kind: the check named the exclusion instead of being turned off. On git merge-tree origin/main 02af580:
tools/check-installed-rpath.py --self-test 0 failure(s)
tools/ci/tmp_path_check.py --check 44 baselined site(s), none new, none stale
(1 file(s) excluded: this checker's own fixtures; 1 recogniser(s) named by RECOGNISERS: tools/check-installed-rpath.py)
The recogniser does need /tmp as data: it refuses RUNPATH entries resolving through /tmp/… and /dev/shm/… (:99), with a fixture for it (:150).
One note, not blocking: RECOGNISERS excludes the whole file. So a real write to /tmp added to check-installed-rpath.py later, say a scratch copy of an ELF it inspects, would also pass this check, and the summary line would still say "1 recogniser" either way. A per-line marker (# tmp-path: recognised, not written) on the two pattern lines would keep the exemption exactly as wide as the reason for it. The scan would then still cover the rest of the file.
|
Persistent review updated to latest commit 02af580 |
Refs #1411 — this makes the repack-or-retire decision I recorded there (it was assigned to pi-release) executable instead of prose.
The problem with the number
94 offending entries, 42 LIVEcannot be acted on because it mixes a catastrophic case with a normal one. Measured on this box:The old FAIL line called a dependency on a system SDK exactly as bad as a path into a build tree that is about to be deleted, so the only sane response was to ignore it.
The decision, as code
/work,/work-c22,/tmp,/dev/shm,~/wt,~/lb,~/.cache/scratch-*/opt/rocm*DECLARED SDKdoes not fail because making the package$ORIGIN-only would vendor a second libomp and ship an artifact that is not the one that was tested — that is the repack half of the decision, and it is rejected.OTHERdoes fail: "I do not know what that is" may not pass a gate.That
OTHERrule is not decoration. The first version of this change let/work-c22fall intoOTHERand returned exit 0 with six build-tree entries still load-bearing — a false PASS on the exact hazard the tool exists for. The hazard arms in the self-test exist because of that run.The arm caught two of my own bugs
Both before the commit, which is what a self-test is for. Mutations, both failing by name:
Gate compliance
tests_referencedrequires a ctest row for anytools/**/*.pythat declares--self-test, so the row is added (installed_rpath_kind_self) and--checkis green — 73 tool self-tests, up from 72.On this box the sweep still exits 1, and now says which six:
FAIL 94 offending RUNPATH entries across 317 ELF(s), 42 of them LIVE: 6 through a BUILD TREE (deleting or rebuilding that directory stops the installed package starting).Not done here: retiring
1bit-embed-c22or freeing/work-c22(17 G). The order is retire-the-dependants-then-free-the-tree, and~/lb/k74-ab/proof-0008b-*still re-runs against those paths.