buildifier: decouple runner scripts from binaries #1398
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.
This change aims at making
buildtools/buildifier
more modular and easier to consume by enabling use of prebuilt binaries without having to pull in unnecessary dependencies - while strengthening upstream as the authoritative home for runner script templates.Today,
buildifier/BUILD.bazel
exposes two different sets of rules:runner.bash.template
,runner.bat.template
) as well asREADME.md
,go
build &sh
test rules which require external repos (rules_go
,rules_shell
) even for consumers who don't need to build thebuildifier
binary.It is worth noticing there are two distinct community efforts on runner scripts, the present/upstream
bazelbuild/buildtools
and the derivedkeith/buildifier-prebuilt
(Bazel Central Registry module). These drift apart over time, leading to unsynchronized contents (factory.bzl, runner.bash.template) and efforts, e.g. on Windows support:Intended benefits of this change:
go_binary
andsh_test
targets intobuildifier/cmd
, the top-levelbuildifier/BUILD.bazel
no longer requiresrules_go
norrules_shell
,//buildifier/cmd
) or configure rules to use prebuilt binaries (e.g. via rules_multitool) while still consuming the same upstream runner script templates,//buildifier:buildifier*
labels working by delegating to the corresponding//buildifier/cmd:buildifier*
.