keith / buildifier-prebuilt

A bazel toolchain for using prebuilt binaries for buildifier and buildozer
MIT License
35 stars 13 forks source link

Look at using aliases instead of toolchains #4

Open keith opened 2 years ago

keith commented 2 years ago

The only reason this repo uses toolchains is to avoid downloading multiple versions of buildifier that you'll never use on your platform. It looks like if you use some indirection with a bazel alias in a select() you can avoid this as well. https://github.com/bazelbuild/bazel/commit/903c2720792574321d3e3591ca14a9d287819cb7

If someone can confirm this is intentional behavior I can switch to this method instead to remove a lot of boilerplate.

alexeagle commented 1 year ago

My understanding is that select() in an unconfigured build (e.g. bazel query) will follow all the branches, downloading too much.

But in a configured build like bazel cquery or bazel build you only follow the matching branch, so it's as minimal as using toolchains.