Replies: 2 comments 1 reply
-
Maybe examples under https://github.com/bazelbuild/examples/tree/main/configurations can help? /cc @gregestren @katre |
Beta Was this translation helpful? Give feedback.
-
Hi @njlr, Build settings work best with I can think of 3 approaches:
Each approach has its pluses and minuses. If you just want something quick and easy and don't want to have to add any extra boilerplate, I'd just stick with Otherwise I'd use option 3 if it works, with the biggest weakness that you need a Option 2 should work for any value but has the most boilerplate. |
Beta Was this translation helpful? Give feedback.
-
Suppose I have a simple
genrule
like this:Now I want to make this configurable from the outside.
I can use
--action_env
like this:However, I don't want to use
--action_env
because it affects all rules and it is bad for caching.There is
--define
, but the docs describe it as legacy:So that leaves build settings.
However, it is not clear how to get the value of a build setting into my
genrule
.I am looking for something like this:
Beta Was this translation helpful? Give feedback.
All reactions