fix: Include failing paths in container lint errors - #2526
Merged
cgwalters merged 1 commit intoOct 2, 2026
Merged
Conversation
`try_exists` now uses `with_context` to attach "checking whether
{candidate} exists" for the relative path under the image root. The
runner returns that same error via `e.context`, so the outer message is
"Unexpected runtime error running lint {name}" and the path context plus
the original I/O error stay on `err.chain()`. Symlinks that remain
inside the root still count as present, and a symlink that leaves the
root still fails. Tests cover an escaping `usr/bin` symlink on the
runtime-deps lint, and present, absent, escaping (`../../var/usrlocal`),
and contained (`../var/usrlocal`) cases for `have_executable_in_root`.
Fixes bootc-dev#2469
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
cgwalters
approved these changes
Oct 2, 2026
cgwalters
approved these changes
Oct 2, 2026
| if root.try_exists(candidate)? { | ||
| if root | ||
| .try_exists(candidate) | ||
| .with_context(|| format!("checking whether {} exists", candidate.display()))? |
Collaborator
There was a problem hiding this comment.
Nonblocking but we have our own little helper for this to quote file paths in a nicer way we should add to the Rust agent review checklist to use
cgwalters
enabled auto-merge (rebase)
October 2, 2026 13:01
Contributor
Author
|
Switched that error to |
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.
try_existsnow useswith_contextto attach "checking whether {candidate} exists" for the relative path under the image root. The runner returns that same error viae.context, so the outer message is "Unexpected runtime error running lint {name}" and the path context plus the original I/O error stay onerr.chain().bootc container lintaborts the runtime-deps check with "a path led outside of the filesystem" and the message never names the path that escaped. Turning logging up to debug or trace still does not identify it, so a root symlink such as/usr/localpointing at../../var/usrlocalshows up as a generic lint failure.No local test ran for
crates/lib/src/lints.rsandcrates/lib/src/utils.rs: the local Rust test run could not complete in this environment, for reasons outside the diff.Closes #2469
AI was used for assistance.