Skip to content

Latest commit

 

History

History

read_attr_in_transition

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

This is an example of a transition that reads both the current configuration and an attribute. Transitions have access to both those pieces of information in their implementation functions.

To try it out, cd to this directory and run the following:

$ bazel build :dont-do-transition # "value of some-string: abc"
$ bazel build :do-transition # "value of some-string: abc-transitioned"

Caveat: You cannot read a configured attribute in a rule transition. This can create a dependency cycle between attribute values and configuration. To see an example of this cycle, run the following:

$ bazel build :will-break # error message