Bring back [Explicit Module Builds] Serialize and re-use the inter-module dependency graph as incremental build state #1236
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Second attempt at landing #1230
Which previously caused compiler lit test regressions in main CI.
Building on top of #621, on an incremental build, load a prior dependency graph, check if it is still valid:
More concretely, computation of the initial incremental state in
computeIncrementalStateForPlanning
will attempt to read out and validate a prior serialized inter-module dependency graph. If validated, such graph will become a part of the initial incremental state itself.During build planning, at the stage of computing inter-module dependencies, the dependency scanning action will be skipped if the initial incremental state contains a still-valid prior inter-module dependency graph.
In both cases, if a prior graph is being re-used, or if a new graph was computed via a dependency scanning action, the graph will become a component of the incremental build state to be serialized after the build is complete.
This change does not yet result in skipping the actual module build jobs in the planning output, which can be done with this, but this is left to a followup PR.
There is also some notable overlap between this and what is already done for detecting changes in input files to the current compilation:
Once explicit builds become the default, we can consolidate the two approaches into one.
Partially resolves rdar://66801475