Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement configuration settings that pertain to a single binary #16708

Open
lberki opened this issue Nov 9, 2022 · 1 comment
Open

Implement configuration settings that pertain to a single binary #16708

lberki opened this issue Nov 9, 2022 · 1 comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Configurability Issues for Configurability team type: feature request

Comments

@lberki
Copy link
Contributor

lberki commented Nov 9, 2022

Description of the feature request:

It would be nice if one could implement configuration fragments that pertain to a part of the configured target graph.

The use case is that some projects want to compile a binary in different configurations, but not necessarily its dependencies. For example, one might want to compile a C++ binary with some sort of sanitizer. The natural place for the "which sanitizer to use" knob is the configuration, but that propagates to the whole transitive closure of the binary, even to places which are obviously unaffected by it (for example, a genrule that generates a source file) or to places where the decision as to which sanitizer to use is different (for example, another binary in the data= attribute.

So it looks like there is some room for the concept of "configuration variable that applies to whatever is built into a binary":.

There are ways one could work around this: for example, one could write their own custom C++ rule that has "remove sanitizer" transition for every dependency that's not through deps=, but that's only a partial answer, because one could imagine cases where this flag needs to be removed from deps=, too (for example, if it's a genrule that generates an object file)

Implementing this purely in Starlark isn't possible because it requires knowing the rule class on both ends of the dependency edge and neither outgoing nor incoming transitions can do that.

What underlying problem are you trying to solve with this feature?

No response

Which operating system are you running Bazel on?

No response

What is the output of bazel info release?

No response

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@lberki lberki added the team-Configurability Issues for Configurability team label Nov 9, 2022
@lberki
Copy link
Contributor Author

lberki commented Nov 9, 2022

cc @digit-google @lizkammer

@gregestren gregestren added the P2 We'll consider working on this in future. (Assignee optional) label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Configurability Issues for Configurability team type: feature request
Projects
None yet
Development

No branches or pull requests

3 participants