Repository navigation
Sandbox: keep the launcher's cross-compilers on the PATH - #58
Merged
Merged
Conversation
The launcher puts the bin directories of the toolchains it binds first on the container's PATH, but every command runs in a bwrap sandbox started with --clearenv and a fixed PATH. A session asked to build SO3 found no aarch64-none-elf-gcc and fell back on the host gcc, and a directory given with --toolchains was not even bound in the sandbox. The launcher now names the directories it binds in SPEAR_TOOLCHAINS. The sandbox binds them too, read-only, and keeps the caller's PATH entries that lie under a bound toolchain directory, in the caller's order, ahead of its own.
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.
Every command runs in a bwrap sandbox started with
--clearenvand a fixed PATH, so the toolchain directories the launcher put on the container's PATH were lost: a SO3 session found noaarch64-none-elf-gccand fell back on the host gcc. A directory given with--toolchainswas not bound in the sandbox either.The launcher now exports
SPEAR_TOOLCHAINS(the directories it binds). The sandbox binds them read-only and keeps the caller's PATH entries under them, in order, ahead of its own. Tests:LauncherToolchainsReachTheSandboxTestsintests/test_sandbox.py.test_reds_image ... test_the_image_gives_a_prompt_of_the_other_assistant_what_a_turn_getsalready fails on main (it expects a literal/usr/local/bin/spear-claude-contextthat the multi-file COPY does not spell); untouched here.