bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.07k stars 4.04k forks source link

bazel test cannot have both --experimental_sandbox_base=/dev/shm and --sandbox_tmpfs_path=/dev/shm #5051

Open rtsai opened 6 years ago

rtsai commented 6 years ago

Description of the problem / feature request:

Configuring both --experimental_sandbox_base=/dev/shm and --sandbox_tmpfs_path=/dev/shm causes the following error:

bazel test ...
ERROR: /home/robtsai/verb/sandbox_base/BUILD:8:1: C++ compilation of rule '//:true_test' failed (Exit 1).
src/main/tools/linux-sandbox-pid1.cc:174: "mount(/dev/shm/bazel-sandbox.551b950f452dff6462d586cb13cc223e/450305183730770813/execroot/listener_example, /dev/shm/bazel-sandbox.551b950f452dff6462d586cb13cc223e/450305183730770813/execroot/listener_example, nullptr, MS_BIND, nullptr)": No such file or directory

Feature requests: what underlying problem are you trying to solve with this feature?

I am trying to improve sandboxing performance by using --experimental_sandbox_base=/dev/shm, but then realized I also have --sandbox_tmpfs_path pointing at the same place.

My understanding is that --experimental_sandbox_base is for the build host, while --sandbox_tmpfs_path is relative to the sandbox

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Sample workspace attached.

sandbox_example.tar.gz

What operating system are you running Bazel on?

Ubuntu 16.04.4 LTS

What's the output of bazel info release?

Happens in both:

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

N/A

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

N/A

Have you found anything relevant by searching the web?

No

Any other information, logs, or outputs that you want to share?

jmmv commented 5 years ago

Passing both of these flags pointing to the same location seems like the wrong thing to do, so I understand that what you are requesting here is a better error message? I think that's the only reasonable thing we could do.

rtsai commented 5 years ago

I think a better error message makes sense.

If I recall (it's been a while), I think I may have been interpreting those options as simply pointing to a mount point (e.g., fast RAM disk) and wanting bazel to figure everything else out for me.

I think what you might be suggesting is that for my use case, I should have either defined two separate RAM disks, or two different subdirectories, for the two options.

github-actions[bot] commented 6 months ago

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.