Bazel shows bogus WARNING
for the rc files, if they are symlinks:
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
/tmp/workspace/.bazelrc
But the rc file is correctly processed, as seen in the reproduction below.
Note that this is new in 0.19rc6
and there is no warning in 0.18
.
mkdir -p /tmp/workspace/tools
cd /tmp/workspace
touch WORKSPACE
touch BUILD
echo "build:test --copt=-DTEST" > tools/bazel.rc
ln -s tools/bazel.rc .bazelrc
bazel build --config=test :all
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
/tmp/workspace/.bazelrc
Starting local Bazel server and connecting to it...
INFO: Analysed 0 targets (3 packages loaded, 0 targets configured).
INFO: Found 0 targets...
INFO: Elapsed time: 1.298s, Critical Path: 0.02s, Remote (0.00% of the time): [queue: 0.00%, setup: 0.00%, process: 0.00%]
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
md5-f966610bd6ee5694b3eaef52aae0b0b9
release 0.19.0rc6
Backstory (mostly irrelevant to the actual issue):
The .bazelrc
symlink to tools/bazel.rc
was added to ease the migration instead of import %workspace%/tools/bazel.rc
suggested in #6319, since we have projects (e.g. https://github.com/envoyproxy/envoy-filter-example) importing the main project (https://github.com/envoyproxy/envoy) as a submodule and linking to its tools/bazel.rc
, so import
breaks, because workspace-relative location changes.
cc @katre, since this is new in 0.19
(#6116), but probably not a release blocker.
This is a small enough use-case that I don't want to risk a breakage due to cherrypick. We should try and address it for 0.20, however.
I'm getting the same error message for non-symlinks on Windows with Bazel 0.19.0:
D:\src\codebase>bazel build //...
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
d:\src\codebase/.bazelrc
Same as @baskus. Can somebody please confirm this is not the intended behaviour?
Assigning to @dslomov to decide if this is a blocker for 0.20
/sub, this is causing confusing issues on the Mac too. The system_rc is /etc/bazel.bazelrc
on the Mac, but /etc
is a symlink to /private/etc
. This results in confusing warning messages like:
$ cat /etc/bazel.bazelrc
build --jobs=4
$ bazel version
WARNING: The following rc files are no longer being read, please transfer
their contents or import their path into one of the standard rc files:
/etc/bazel.bazelrc
Thanks @excitoon for linking to #6138! That might indeed be the same issue.
~Someone with a Mac at hand, could you please Bazel built at https://github.com/bazelbuild/bazel/commit/e9a908560133770614eca89ef64681bdf3f04b3e and see if that commit fixes this issue?~ Oh wait, never mind, it happens on Linux too I see.
Confirming that https://github.com/bazelbuild/bazel/commit/e9a908560133770614eca89ef64681bdf3f04b3e fixes this issue too, so I'll say this is a duplicate of https://github.com/bazelbuild/bazel/issues/6138.
Most helpful comment
I'm getting the same error message for non-symlinks on Windows with Bazel 0.19.0: