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

For Bazel builds, support setting custom execution properties per-target #913

Open
jgold2-stripe opened this issue Oct 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@jgold2-stripe
Copy link

We build Perfetto using the supporting infra in the bazel/ directory, and use a remote execution backend. For at least one of the targets, we need to set a custom property to allocate more memory for its actions.

The only way we've found at the moment is to set a custom value for rule_overrides.cc_library, and in our own function, test the value of kwargs["name"] and inject the execution properties we want. This works, and we are not blocked.

But, I wanted to raise this in case it is something that could be better supported directly.

@LalitMaganti
Copy link
Collaborator

But, I wanted to raise this in case it is something that could be better supported directly.

I think in general we would be open to doing this but I'm not really sure how we could make that better tbh. At the end of the day there needs to be some lookup by target name to make decision on the options. Do you have some idea on how we should improve this?

@jgold2-stripe
Copy link
Author

The only thing that jumps to mind immediately would be for a user like us to specify, via our perfetto_cfg.bzl, something like a list of target matchers.

There could be lots of ways to specify targets that match, or even at the action level, similar to how it is done with --strategy_regexp in Bazel.

Or maybe people just supply a list of functions that take as input an action mnemonic and target name and return either a dict of execution properties or None. Then the various perfetto rules would call each of these functions and merge in all non-empty/non-null results. Then people can use regexp or whatever they want in their own functions.

@LalitMaganti
Copy link
Collaborator

Ack that makes sense. I think we'll keep this on the backlog but no plans to do anything on this now.

@LalitMaganti LalitMaganti added the enhancement New feature or request label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants