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

[Explicit Module Builds][Incremental Builds] Only re-build module dependencies which have changed or whose dependencies have changed. #1413

Merged
merged 1 commit into from Aug 15, 2023

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Aug 11, 2023

Up until now, incremental explicit builds behaved on an all-or-nothing basis: if any of the dependencies have changed, or new dependencies were added, then the driver launches a full dependency scan, followed by re-building all dependency modules.

Now, instead, we take a fine-grained approach to rebuilding module dependencies. The overall incremental build flow w.r.t. explicit module dependencies is now as-follows:

  1. If there is a prior inter-module dependency graph and the source import set has not changed, and all dependencies are up-to-date, skip the dependency scan and re-use the prior graph.
  2. When computing the first compilation wave's mandatory pre-compile jobs, examine each module dependency in the graph (either re-used prior or newly-computed). If any of the module's inputs are newer than the output, or if the output does not exist, this module is invalidated and must be re-compiled. Necessarily, every module in the graph between the root and the invalidated module must also be invalidated and re-compiled.

(Note: that we do not need to concern ourselves with changes to the compile command of a given module changing from the prior build - if that happened, then the module output path will have changed to reflect the change in the context hash, and expected output will be missing at the new expected path.)

Resolves rdar://113638007

@artemcm artemcm changed the title [Explicit Module Builds][Incremental Builds] Only re-built module dependencies which have changed or whose dependencies have changed. [Explicit Module Builds][Incremental Builds] Only re-build module dependencies which have changed or whose dependencies have changed. Aug 14, 2023
@artemcm artemcm force-pushed the FineGrainedIncrementalExplicitDeps branch 5 times, most recently from 5ba20ee to c6cfb18 Compare August 14, 2023 20:28
@artemcm
Copy link
Contributor Author

artemcm commented Aug 14, 2023

@swift-ci test

@artemcm artemcm force-pushed the FineGrainedIncrementalExplicitDeps branch from c6cfb18 to 295ee41 Compare August 14, 2023 22:12
@artemcm artemcm marked this pull request as ready for review August 14, 2023 22:13
@artemcm
Copy link
Contributor Author

artemcm commented Aug 14, 2023

@swift-ci test

@artemcm artemcm force-pushed the FineGrainedIncrementalExplicitDeps branch from 295ee41 to 81294b5 Compare August 14, 2023 23:04
@artemcm
Copy link
Contributor Author

artemcm commented Aug 14, 2023

@swift-ci test

@artemcm artemcm force-pushed the FineGrainedIncrementalExplicitDeps branch from 81294b5 to 12cbd13 Compare August 14, 2023 23:13
@artemcm
Copy link
Contributor Author

artemcm commented Aug 14, 2023

@swift-ci test

…endencies

which have changed or whose dependencies have changed.

Resolves rdar://113638007
@artemcm artemcm force-pushed the FineGrainedIncrementalExplicitDeps branch from 12cbd13 to a52491b Compare August 15, 2023 15:39
@artemcm
Copy link
Contributor Author

artemcm commented Aug 15, 2023

@swift-ci test

@artemcm
Copy link
Contributor Author

artemcm commented Aug 15, 2023

@swift-ci test Windows platform

@artemcm artemcm merged commit 9a4465c into apple:main Aug 15, 2023
3 checks passed
@artemcm artemcm deleted the FineGrainedIncrementalExplicitDeps branch August 15, 2023 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants