Closed aohren closed 1 year ago
@aohren I'm not familiar with the flags --sandbox_tmpfs_path
and --sandbox_debug
. How is the output src/main/tools/linux-sandbox-pid1.cc:170: "mount(tmpfs, /tmpfs/tmp, tmpfs, MS_NOSUID | MS_NODEV | MS_NOATIME, nullptr)": No such file or directory
an indication that the build is always using sandbox_tmpfs_path=/tmpfs/tmp?
I instead did a repro using standard built-in flags --cpu
, -c
, and a Starlark string flag. I observed that conflicting flags in HOME rc-file override flags in workspace rc-file as documented. My repro:
HOME rc-file
$cat ~/.bazelrc
build --enable_platform_specific_config
build --//:flag=home-rc-flag
build:macos --cpu=x86
build:macos -c dbg
WORKSPACE rc-file
$cat $WORKSPACE/.bazelrc
build --enable_platform_specific_config
build --//:flag=home-rc-flag
build:macos --cpu=k8
build:macos -c opt
Running bazel build ...
with the build completed successfully. For the Starlark flag, the DEBUG statement shows
DEBUG: /Users/aranguyen/examples/flags-parsing-tutorial/build_defs.bzl:6:10: evaluated value for flag: home-rc-flag
For flags --cpu
and -c
, I observed x86-dbg
in the output path by running ls -l
.
lrwxr-xr-x 1 aranguyen primarygroup 118 Dec 28 23:39 bazel-bin -> /private/var/tmp/_bazel_aranguyen/f6862eb0fe4a0fdb956656ac82e79518/execroot/flagsparsingexamples/bazel-out/x86-dbg/bin
I also notice that there was error in your repro's output. Could you please make sure the build is completed successfully and retry?
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 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage
) if you think this issue is still relevant or you are interested in getting the issue resolved.
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team (@bazelbuild/triage
). Thanks!
Description of the problem / feature request:
Config definition in
~/.bazelrc
doesn't override conflicting definition in workspace.bazelrc
.Given the
--announce_rc
findings below,I'd expect the build to use
sandbox_tmpfs_path=/tmp
. The docs to imply the~/.bazelrc
should override the conflicting definition in the workspace's.bazelrc
.However, the builds always use
sandbox_tmpfs_path=/tmpfs/tmp
, even if the.bazelrc
files are swapped.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
Linux
What's the output of
bazel info release
?release 3.4.1
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 (installed with
apt-get
)Have you found anything relevant by searching the web?
According to .bazelrc docs, the
$HOME/.bazelrc
should be found after the workspace.bazelrc
file and "options in later files can override a value from an earlier file if a conflict arises". This doesn't appear to be the case with thebuild:linux --sandbox_tmpfs_path=...
snippet provided above.Any other information, logs, or outputs that you want to share?
Running with
--announce_rc
indicates Bazel is finding both.bazelrc
s in the right order and even interperting the configs in the right ordrer:But the config in
HOME
(sandbox_tmpfs_path=/tmp
) is not overriding the workspace config (sandbox_tmpfs_path=/tmpfs/tmp
):In fact, changing the order around doesn't seem to affect things either. It's always picking
sandbox_tmpfs_path=/tmpfs/tmp
: