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

Hermetic sandbox doesn't expose basic system binaries and libraries by default. #18377

Open
tjgq opened this issue May 11, 2023 · 1 comment
Open
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Local-Exec Issues and PRs for the Execution (Local) team type: feature request

Comments

@tjgq
Copy link
Contributor

tjgq commented May 11, 2023

When using --experimental_use_hermetic_linux_sandbox on Linux, it's impossible to run any executable requiring an interpreter that isn't an explicit input. Most notably, none of #!/bin/sh, #!/bin/bash or #/usr/bin/env bash work, which means none of Bazel's embedded scripts (genrule-setup.sh, test-setup.sh, etc) work.

A trivial genrule or sh_test serves as a repro.

This can be worked around using --sandbox_add_mount_pair to mount additional directories in the sandbox; /bin, /lib and /lib64 appear to be enough for Bash scripts, but this is likely system-dependent.

cc @larsrc-google since we were discussing this today.

@tjgq tjgq added team-Local-Exec Issues and PRs for the Execution (Local) team untriaged labels May 11, 2023
@coeuvre coeuvre added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels May 16, 2023
@prasvelagapudiagility
Copy link

prasvelagapudiagility commented Nov 14, 2023

Note that this might be working as intended, as you might want to mount these directories from an isolated sysroot (like a nix store) rather than your actual system copies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Local-Exec Issues and PRs for the Execution (Local) team type: feature request
Projects
None yet
Development

No branches or pull requests

4 participants