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

[fud2] Reduce Redundancy in Emitted Ninja Files from High Level Rhai #2246

Open
2 tasks
jku20 opened this issue Aug 5, 2024 · 0 comments
Open
2 tasks

[fud2] Reduce Redundancy in Emitted Ninja Files from High Level Rhai #2246

jku20 opened this issue Aug 5, 2024 · 0 comments
Labels
C: fud2 experimental driver

Comments

@jku20
Copy link
Collaborator

jku20 commented Aug 5, 2024

Issue

Currently generated Ninja can be redundant. The two most egregious examples

  • Duplicate rules with different names are not collected into a single rule and reused. This comes up when Rhai functions wrap around shell or shell_deps and are used in more than one op.
  • Duplicate variable definitions are not collected into a single variable which is reused. This comes up when a value from the config files is used in more than one op.

Ideas for Implementation

One method for reducing this redundancy is for the Emitter to only emit the Ninja file after receiving being manipulated by all EmitBuilds first. It can then recognize repeated variables and rules to optimize the final Ninja.

An upside of this method is it is pretty self contained. A downside is it doesn't provide much path to allow the user to name common rules which occur in the final Ninja. If this feature is even wanted though is unclear (it might just be fine to understand the names of rules in the final Ninja will be a bit opaque).

@jku20 jku20 added the C: fud2 experimental driver label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: fud2 experimental driver
Projects
None yet
Development

No branches or pull requests

1 participant