Closed
Conversation
The previous behaviour was to bind-mount $TMPDIR to /tmp within the sandbox, and re-set TMPDIR accordingly ; however, this meant that absolute paths within TMPDIR could be incompatible between the outside and the inside of the sandbox. This became a visible problem with dune 2.8, which redefines TMPDIR to a subdirectory (e.g. `/tmp/buildXXXX.dune`). If you happen to be running tests with an OPAMROOT within $TMPDIR, your opam root will no longer be accessible, and packages that run opam commands from within the sandbox (which is discouraged, but well...) will break. In our tests, run through dune, OPAMROOT gets created in `/tmp/buildXXXX.dune/OPAM`, then packages get installed within a sandbox, this is relocated to `/tmp/OPAM` but `OPAMROOT` and `OPAM_SWITCH_PREFIX` remained set to below `/tmp/buildXXXX.dune`, and things broke.
this made PWD always rw accessible on remove actions, and was possibly dangerous
rjbou
approved these changes
Mar 4, 2021
Collaborator
|
superseed by #4589 |
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.
Linux sandbox (bwrap): change how TMPDIR is handled, because dune
2.8 re-setting it was breaking the previous behaviour ; packages
writing to /tmp instead of $TMPDIR will be broken though. See
37ee01d for details.
Macos sandbox (sandbox_exec): port improvements made to bwrap in the
past years while it was, it seems, forgotten.