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

Preparation tracking needs to be per file rather than per target #1975

Open
bnbarham opened this issue Feb 11, 2025 · 1 comment
Open

Preparation tracking needs to be per file rather than per target #1975

bnbarham opened this issue Feb 11, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@bnbarham
Copy link
Contributor

bnbarham commented Feb 11, 2025

We currently track preparation per target with the assumption that a change in a target only causes dependents to be re-prepared, not the target itself. This is mostly true for our existing build systems, but isn't in the more general case:

  • Plugins could depend on a configuration file within the target and then generate source. If we don't re-prepare after a change to the configuration file, we'd miss updating source.
  • For mixed language targets (which we don't have in SwiftPM today), any .swift change must re-prepare so that the generated header is rebuilt.

We should instead track preparation separately for the files (or file types?) of a target.

As an extension we could also either:

  1. Generate fake targets in the build graph for plugin generation (which targets could then depend on so that they are re-prepared on input file changes)
  2. Add the input files of the plugin command to the files for the target they're generating files for (with some flag to mark them as such)
  3. Give generated files an extra input files field
@bnbarham bnbarham added the enhancement New feature or request label Feb 11, 2025
@ahoppen
Copy link
Member

ahoppen commented Feb 11, 2025

Synced to Apple’s issue tracker as rdar://142670165

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