You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: read the dispatch verdict, not the log line's substrings
The ambiguous-name probe test scanned bear's debug log with two plain
`contains` checks: a line holding both "gcc" and "Recognized(" meant the
probe had been bypassed. Both halves match text that says nothing about
dispatch. "NotRecognized(" ends in "Recognized(", and every verdict line
dumps the intercepted execution together with its environment, so a
build environment that merely mentions GCC satisfies the first half.
A Gentoo package build sets CC=x86_64-pc-linux-gnu-gcc and
CFLAGS=-frecord-gcc-switches, so the `coreutils_to_ignore` interpreter's
NotRecognized line tripped the assertion and failed the test on a run
where the probe had correctly dispatched to Clang (#716). Bear itself
was right; only the test's reading of the log was wrong.
Parse the OutputLogger line instead: take the interpreter id and the
verdict from their own positions, and compare the id exactly. The test
exports CFLAGS the way the Gentoo build does, so the false positive is
reproduced rather than left to the host, and a unit test pins the
parsing against a line from the reported log. CFLAGS rather than CC
because a program variable gets resolved on PATH in wrapper mode, and a
Gentoo triplet name would warn on every host that lacks that compiler.
Requirements: recognition-ambiguous-name-probe
Closes#716
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments