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

Adds support for generated code being compiled by multiple rules. #3347

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

cemeceme
Copy link
Contributor

@cemeceme cemeceme commented Feb 2, 2025

Fixes #3318, fixes #3168

Currently, if a rule creates multiple outputs that are not known at initial run, there is no way to have please generate the required rules in a pre or post build step.

This pull request adds two mechanisms to handle that:
1.) Rules builds and waits for new dependencies that get added in pre and post build steps.
2.) Adds a way to define single outputs from rules.

The second point works similar to the way that named outputs work. Using the character + followed by the output, it is now possible to select only that output from a rule. In practice, this is only meant to be used in conjunction with get_outs(). I only chose + due to its similarity for |, and of course this can be adjusted to any other separator if needed.

For an example of how to use this, I have written a custom implementation of the cc-rules, that rely on this feature. See this section for how the rules are generated.

Also note that as @peterebden stated in #3318, if a build depends on runtime generated rules, it keep hold of its build runner until the dependencies finish building. However, the fact that multiple threads can work on a potentially large number of generated files still means that build times can be sped up significantly as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant