Commit fb9861b
authored
### What does this PR do?
Configure the `//:gazelle` target with `-build_file_name=BUILD.bazel`.
### Motivation
When `gazelle` runs inside a Linux container on macOS via Docker Desktop, the workspace is typically mounted on a case-insensitive filesystem where `BUILD` and `build` are indistinguishable.
This causes spurious errors such as:
```sh
bazel run //:gazelle; echo $?
...
gazelle: open /dda/.gitlab/windows/build: no such file or directory
open /dda/rtloader/build: no such file or directory
1
```
Whereas the cause strictly resides in a filesystem layer/driver (docker/desktop-feedback#251, recently imported from docker/for-mac#7218), portable tools have been taking countermeasures. Bazel 9, for instance, revamped their filesystem cache to better accomodate case-insensitive filesystems (bazelbuild/bazel#26842), which led us to switch to it (#47742), but that only covers Bazel's own I/O, not the processes it spawns, of which `gazelle`.
For that purpose, Gazelle happens to [explicitly recommend](https://github.com/bazel-contrib/bazel-gazelle/blob/4a7caee10fbd2da9bb059f3ce7c2cac8d0050e53/reference.md?plain=1#L251) setting its `build_file_name` directive to `BUILD.bazel`:
> If a repository contains files named `build` that aren't related to Bazel, it may help to set this to `"BUILD.bazel"`, especially on case-insensitive file systems.
### Additional Notes
For consistency with the narrowed scope, this change renames `compliance/rules/BUILD` to `compliance/rules/BUILD.bazel` (the only plain `BUILD` file still present in the tree).
Co-authored-by: regis.desgroppes <regis.desgroppes@datadoghq.com>
1 parent 867176f commit fb9861b
2 files changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
450 | 453 | | |
451 | 454 | | |
452 | 455 | | |
| |||
File renamed without changes.
0 commit comments