bazelbuild / bazel-skylib

Common useful functions and rules for Bazel
https://bazel.build/
Apache License 2.0
387 stars 180 forks source link

Avoid building build_test deps unnecessarily #448

Closed UebelAndre closed 1 year ago

UebelAndre commented 1 year ago

I ran into an issue where I had a build_test that was only compatible with a particular platform. I had annotated the target with target_compatible_with but continued to get builds on the incompatible platform. This came down to my bazel test //... invocation picking up the {name}_{idx}__deps targets and building the dependency anyway. This change updates these targets to account for newer common attributes and tags them as manual so they're only built when the user facing test target is built.

UebelAndre commented 1 year ago

Thank you!

UebelAndre commented 1 year ago

@tetromino would it be possible to also get a new release after this change?

UebelAndre commented 1 year ago

@tetromino friendly ping 😅

tetromino commented 1 year ago

@tetromino friendly ping sweat_smile

Draft PR: https://github.com/bazelbuild/bazel-skylib/pull/451

(Note we also may need to fix some sort of stardoc-related weirdness with bazel at head to unblock ci.)