bazel: incompatible_allow_tags_propagation

Tags are not currently being propagated from a bazel’s target to the actions’ execution requirements. which would be very useful in order to be able to mar certain targets as ‘no-remote’ or ‘no-cache’. At the moment, this is possible only on action/rule level or via adjustments to the rules. Detailed description of the issue is in #7766. Design is described in the proposal.

In order to make the transition smoother, a flag --incompatible_allow_tags_propagation has been introduced.

What does it change?

  • If the flag --incompatible_allow_tags_propagation set to true, bazel will take tags specified on target level, filter them based on prefix and propagate to the actions, that are created for the target. Propagated prefixes: “block-”, “requires-”, “no-”, “supports-”, “disable-”, “local”, “cpu:”

  • If set to false tags are not propagated.

Migration notes

Check the tags with the prefixes: “block-”, “requires-”, “no-”, “supports-”, “disable-”, “local”, “cpu:”. Most likely they were not propagated and with the flag --incompatible_allow_tags_propagation they will be, therefore the build behavior might change.

Plan

By Bazel 1.0: Make functionality usable

  • Starlark rules are able to propagate tags under --incompatible_allow_tags_propagation flag
  • Native rules (C++, for example) are able to propagate tags under --incompatible_allow_tags_propagation flag

After Bazel 1.0:: Stabilize

  • fix everything that is failing/unstable incrementally
  • move ‘tags propagation’ from experimental to supported feature

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (16 by maintainers)

Commits related to this issue

Most upvoted comments

What still needs to be done to flip this one? I think it’s a common surprise for folks when tags don’t propagate as they expect. Based on the comment here https://github.com/bazelbuild/bazel/blob/53f189973e1372d53c7cc2a041a3e34adcff4fbe/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java#L35-L38 it doesn’t seem super clear how we would break apart the build vs query impact of this flag

SGTM. I would love to see this is flipped.

What do you mean by ‘tooling’?

Migration tooling (of any kind) - but I do not think it is posisble 😃 Breakage does seem non-existent