Support case-sensitive package loading #10345
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The new --[no]experimental_check_label_casing flag
enables a new validation step in package loading:
when enabled, Bazel requires that package paths be
case-correct.
When the user runs "bazel build //Foo/Bar:Baz",
Bazel looks up the package "Foo/Bar" by stat'ing
"Foo/Bar/BUILD". If the file exists, then the
package exists. Every Label that Bazel creates in
this package is derived from the "Foo/Bar" string.
On Linux the filesystem is case-sensitive, so the
path casing must be correct for stat() to succeed,
so it's impossible to load the package "//Foo/Bar"
as "//FOO/baR".
On Windows and macOS the filesystem ignores the
difference between lower and upper case letters,
so stat("foo/bAr/BUILD") and stat("FOO/bar/build")
would both suceed, so "bazel build //foo/bAr:Baz"
and "bazel build //FOO/bar:Baz" both work. This
leads to bugs such as #6401, #8009, and #8799.
Change-Id: I5ad86a0ede6f85aa9cac8e8e56072630738db55c