Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable hermetic Bazel sandboxing #902

Merged
merged 1 commit into from
May 8, 2024

Conversation

aaronmondal
Copy link
Member

@aaronmondal aaronmondal commented May 7, 2024

The --incompatible_sandbox_hermetic_tmp flag doesn't work when TMPDIR or TMP are set to a location under /tmp. Nix shells set these environment variables to /tmp/nix-shell.xxxxxx, triggering mount errors. This change enables the flag by wrapping Bazel in the Nix shell with a script that unsets the TMP and TMPDIR environment variables.


This change is Reviewable

The `--incompatible_sandbox_hermetic_tmp` flag doesn't work when
`TMPDIR` or `TMP` are set to a location under `/tmp`. Nix shells set
these environment variables to `/tmp/nix-shell.xxxxxx`, triggering mount
errors. This change enables the flag by wrapping Bazel in the Nix shell
with a script that unsets the `TMP` and `TMPDIR` environment variables.
Copy link
Member Author

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+@adam-singer

Reviewable status: 0 of 1 LGTMs obtained, and pending CI: Analyze (javascript-typescript), Analyze (python), Bazel Dev / ubuntu-22.04, Cargo Dev / macos-13, Cargo Dev / ubuntu-22.04, Local / ubuntu-22.04, Publish image, Publish nativelink-worker-lre-cc, Remote / large-ubuntu-22.04, asan / ubuntu-22.04, docker-compose-compiles-nativelink (20.04), docker-compose-compiles-nativelink (22.04), integration-tests (20.04), integration-tests (22.04), macos-13, pre-commit-checks, ubuntu-20.04 / stable, ubuntu-22.04, ubuntu-22.04 / stable, vale, windows-2022 / stable (waiting on @adam-singer)

Copy link
Contributor

@adam-singer adam-singer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 1 LGTMs obtained

@aaronmondal aaronmondal merged commit acec6d3 into TraceMachina:main May 8, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants