Bazel: RC files inconsistently ignored on Windows on master

Created on 12 Sep 2018  路  12Comments  路  Source: bazelbuild/bazel

Description of the problem / feature request:

RC files inconsistently ignored on Windows on master.

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

git clone https://github.com/filipesilva/bazel-windows-rc
cd bazel-windows-rc
bazel build shell_build

The following lines will be logged:

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:\sandbox\bazel-windows-rc/.bazelrc
d:\sandbox\bazel-windows-rc/tools/bazel.rc

Although the logs say the files were ignored, the explain.log file (referenced in .bazelrc) was still created. The build_event_binary file (referenced in tools/bazel.rc) was not created though.

What operating system are you running Bazel on?

Windows 10

What's the output of bazel info release?

development version

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

Replace this line with your answer.
Checked out https://github.com/bazelbuild/bazel/commit/b629238a8af71ae5262e69e423d18cbe8f0687af, ran `bazel build //src:bazel, and copied the logged binary to my PATH.

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

b629238a8af71ae5262e69e423d18cbe8f0687af

Have you found anything relevant by searching the web?

I looked in https://github.com/bazelbuild/bazel/issues for issues in the last month about RC files and couldn't find anything open or closed that seemed related.

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

Also tried to use the --bazelrc option but it seems to be gone (ERROR: Unrecognized option: --bazelrc). It doesn't show on help anymore so I suppose that is intended.

P2 area-Windows team-XProduct bug

Most helpful comment

Status update: PR is out for review.
Expected release with this fix is 0.22.0

All 12 comments

The issue is that blaze_util::JoinPath is used to build the file paths in old_files, but it simply joins the path parts with a / instead of something platform-dependent. Since read_files are delimited by \, and lost_files is simply a set intersection, none of the read files are properly removed from old_files, and so all of the paths are shown.

It seems like changing blaze_util::JoinPath to delimit things properly would be the appropriate move here?

Actually it seems like changing blaze_util::JoinPath to delimit with \ might not be the appropriate move here, since Bazel internal paths are Cygwin paths. Perhaps converting old_files with ConvertPath is appropriate?

Hi. Can you give an estimate for this issue?

Let me take a look! I'll get back to this bug with an ETA today.

I have a fix for this bug. Will create a PR shortly.

Hold on, as I was adding tests it turned out RC file path handling is buggy. ETA for the fix should be this week, I'll comment again if there are more updates.

Status update: PR is out for review.
Expected release with this fix is 0.22.0

Sadly, the commit was rolled back because it seems to have broken some targets in Google's own codebase: https://github.com/bazelbuild/bazel/commit/37335187bf31dac48155e77f404bd11008d68ea7

Problem found and fix sent for review; ETA for rolling forward this PR is tomorrow.

Thank you!
Btw, I've found another similar issue #6469, it may be the same thing...

Is this released? I still see this behavior on Windows 10 and bazel 0.21:

PS C:\Users\rwsim\Documents\GitHub\decitrig> bazel info release
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:
C:\Users\rwsim/.bazelrc
INFO: Invocation ID: 640a8eb9-5ab8-4d83-8c09-c14b1e457e86
release 0.21.0
PS C:\Users\rwsim\Documents\GitHub\decitrig>

The fix should be in 0.22.

Was this page helpful?
0 / 5 - 0 ratings