Commit b5f3d90
authored
### Motivation
Currently, `buildifier` targets don't work out of the box on Windows -
credits to @ofek for reporting.
Sadly, it turns out that two separate attempts have already been made to
remedy this:
1. In the upstream `bazelbuild/buildtools` (`go` source, but only
`workspace`-suitable):
bazelbuild/buildtools#1230 (merged)
2. `keith/buildifier-prebuilt` (`bzlmod`-suitable, and providing
-slightly outdated- `go` binaries published by `bazelbuild/buildtools`):
keith/buildifier-prebuilt#89 (well tested, but
pending CI feedback... for months!)
### What does this PR do?
Inspired by some of @aiuto's
[tips](https://datadoghq.atlassian.net/browse/ABLD-174?focusedCommentId=2644283):
> [1.b.] instead of pointing to the toolchain type defined in
buildifier_prebuilt, point to buildifier via multitools.
> [2.a.] revert prebuilt_buildtools.json to
5fd6373
The present change proposes the "least intrusive" change so that:
- we don't need to start a third effort (own rules, `.bash` and `.bat`
scripts),
- we benefit from the validated and merged upstream behavior,
- we don't depend on the goodwill of `keith/buildifier-prebuilt` to
publish the version `8.2.1` of the binaries (nor subsequent versions),
- we don't have to manage a complex patch, but instead simply inhibit
the upstream lines that we do not need, given `buildifier`
implementations are provided by `multitool` (again).
In short, this change combines the best of both worlds through a simple
indirection made possible by the configurability of upstream rules
which, unlike `keith/buildifier-prebuilt`, allow us to define which
implementation of `buildifier` to use.
### Describe how you validated your changes
I used another branch to verify this works under Windows as well:
https://github.com/DataDog/datadog-agent/blob/026042234ee811fd1641a2417893c08008860186/.gitlab/bazel/build-deps.yaml#L39
1 parent 453e513 commit b5f3d90
File tree
5 files changed
+225
-4
lines changed- bazel
- buildifier
- patches
5 files changed
+225
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
15 | 24 | | |
16 | 25 | | |
17 | 26 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
2 | 57 | | |
3 | 58 | | |
4 | 59 | | |
| |||
0 commit comments