[IncrementalCompilation] Support prefix-mapped paths and external module resolution#2128
[IncrementalCompilation] Support prefix-mapped paths and external module resolution#2128cachemeifyoucan wants to merge 1 commit into
Conversation
hjyamauchi
left a comment
There was a problem hiding this comment.
Does this cover the cases for the abstract paths for binary modules as in swiftlang/swift#88113 (comment) ?
|
I don't know why issue 88113 is related here. That problem should be resolved and the example is not using prefix mapping. Prefix mapping is to abstract the path away to allow cache hits regardless of the source/module path and in such case, swift-driver will abstract the path away so that can happen. For regular caching build, there is no path abstraction anymore, so it should just work. If you want to try path prefix mapping, I think this patch should fix the incremental build. If you try it and let me know if you still see problem. |
|
@swift-ci please test |
622a25a to
a0828c1
Compare
|
@swift-ci please test |
| let resolvedPath = VirtualPath.lookup(details.compiledModulePath.path).name | ||
| return (abstractPath, resolvedPath) | ||
| }) | ||
| initialState.graph.setExternalModulePathMap(map) |
There was a problem hiding this comment.
I'm not sure I follow: when will the deserialized external module map path from a prior build get used if we re-compute it from scan results every time?
There was a problem hiding this comment.
Sometimes you don't scan when doing incremental build, and you need to map the path to figure out if you need to scan or not. This is for that purpose.
…ule resolution - Add prefixMapping to IncrementalDependencyAndInputSetup, threaded from Driver. Provide reverseMapPath() to convert prefix-mapped paths back to real paths during .swiftdeps and priors deserialization. - Add pathReverser to SourceFileDependencyGraph deserialization so all identifier strings in .swiftdeps files are reverse-mapped at read time. - Apply pathReverser during priors graph deserialization as well. - Add externalModulePathMap to ExternalDependencyCurrencyCache for resolving abstract module paths (e.g. "B.swiftmodule") to absolute paths during filesystem currency checks. Populated from ExplicitDependencyBuildPlanner scanning results. - Serialize/deserialize externalModulePathMap in priors file via new externalModulePathNode record (version bumped to 1.6.0). - Add integration tests for caching and prefix-mapped caching incremental builds, including upstream dependency invalidation with diagnostics. rdar://174330691 Assisted-By: Claude
a0828c1 to
3b87901
Compare
|
@swift-ci please test |
|
@swift-ci please test windows platform |
|
ping |
Assisted-By: Claude