Repository navigation
_frontend/cli.py: Report a relative bst shell --mount path as an error - #2220
Open
Thanatos9404 wants to merge 2 commits into
Open
Thanatos9404 wants to merge 2 commits into
Thanatos9404 wants to merge 2 commits into
Conversation
The sandbox only accepts absolute paths to mount at, and checks this with an assertion. So `bst shell --mount HOSTPATH PATH` with a relative PATH loaded the element, staged its dependencies and then failed with a BUG message and a traceback. Check the paths before running the shell and raise an AppError, so that the command fails with a normal error message. Also say in the option's help that PATH has to be absolute. Fixes apache#2151
Check that `bst shell --mount` reports a relative path in the sandbox as an error, instead of failing in the sandbox with a BUG message. This is a part of apache#2151
Thanatos9404
requested review from
BenjaminSchubert,
abderrahim,
cs-shadow,
gtristan and
juergbi
as code owners
November 11, 2026 21:30
This branch has not been deployed
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.
bst shell --mount HOSTPATH PATHwith a relative PATH, as in the issue, loads and stages the element and then trips the assertion inSandbox.mark_directory(), which shows up as a BUG with a traceback.The mount paths are now checked in the
shellcommand, after_HostMounthas expanded environment variables in them, so a quoted'$HOME/src'that expands to an absolute path still works. A relative path raises an AppError (reasonrelative-mount-path), and the command fails with a normal error message before anything is staged. The option's help now says that PATH has to be absolute. The sandbox assertion stays as it is.Relative paths in project.conf
shell: host-filesgo through the samemark_directory()call. I left those out here, since they are project configuration and would be better reported at load time, like #2077.I added a test in tests/integration/shell.py. It builds the element first, so on master it hits the assertion from the issue, and with this change it gets the error. I ran tests/integration/shell.py with
--integrationand the frontend tests, plus black and pylint, locally.Fixes #2151