buildifier-prebuilt icon indicating copy to clipboard operation
buildifier-prebuilt copied to clipboard

Look at using aliases instead of toolchains

Open keith opened this issue 4 years ago • 1 comments

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.

keith avatar Jan 18 '22 22:01 keith

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.

alexeagle avatar May 08 '23 23:05 alexeagle