bazelbuild / bazelbuild/bazel

Windows, macOS: package names and input-file-target names are case-ignoring

Open
#8,799 2 comments 0 reactions 1 assignee Claimed by @fmeum View on GitHub
area-Windows P2 team-OSS type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the problem / feature request:

Bazel does not enforce correct casing in package names, nor in target names (if they refer to input files).

Bazel only enforces correct casing in target names that are rules or output files. (Because these are defined as strings in the BUILD file.)

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

Repro on Windows -- in cmd.exe:
```
md c:\src\tmp\case\Foo\Bar

cd c:\src\tmp\case

type nul > WORKSPACE

echo Servus > Foo\Bar\Hello

echo genrule(name="x",srcs=["foo/bar/hello"],outs=["x.out"],cmd="(echo $< ; cat $< ;) > $@") > BUILD

bazel build //:x & type bazel-bin\x.out
(...)
INFO: Build completed successfully, 2 total actions
foo/bar/hello
Servus
```

Repro on macOS -- in Bash:
```
mkdir -p /tmp/case/Foo/Bar

cd /tmp/case

touch WORKSPACE

echo Servus > Foo/Bar/Hello

echo 'genrule(name="x",srcs=["foo/bar/hello"],outs=["x.out"],cmd="(echo $< ; cat $< ;) > $@")' > BUILD

bazel build //:x && cat bazel-bin/x.out
(...)
INFO: Build completed successfully, 2 total actions
foo/bar/hello
Servus
```

### What operating system are you running Bazel on?

Windows 10
macOS 10.15.1

### What's the output of `bazel info release`?

release 1.2.1

### Have you found anything relevant by searching the web?

Same culprit as https://github.com/bazelbuild/bazel/issues/7627.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.