-
Notifications
You must be signed in to change notification settings - Fork 199
[SwiftDriver] PathRemapping and Cache Replay Support #1453
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
[SwiftDriver] PathRemapping and Cache Replay Support #1453
Conversation
Depends on: swiftlang/swift#68660 and swiftlang/swift#68684 |
Sources/SwiftDriver/ExplicitModuleBuilds/ExplicitDependencyBuildPlanner.swift
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
// Add cached diagnostics entry for primary files, or the first input for multithreaded compilation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the order of inputs here will invalidate the corresponding cache entries for this whole compilation, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the order of the file matters for cache key. Not sure if that really matters for the compilation but the order is unlikely to change in most cases.
Currently, file passed through filelist vs. argument will get different key, and there is a FIXME in swift somewhere to address that sometime.
d9e75f7
to
03054e2
Compare
03054e2
to
33bd1b1
Compare
Updated to match new APIs. |
@swift-ci please test |
ping |
33bd1b1
to
c3cc47d
Compare
@swift-ci please test |
c3cc47d
to
be14c2d
Compare
@swift-ci please test |
be14c2d
to
56516af
Compare
@swift-ci please test |
@swift-ci please smoke test macOS |
@swift-ci please test macOS platform |
56516af
to
eefc658
Compare
@swift-ci please test |
eefc658
to
36503c8
Compare
@swift-ci please test |
36503c8
to
474fc4e
Compare
@swift-ci please test |
474fc4e
to
808cc4d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks, otherwise LGTM!
return callback | ||
} | ||
|
||
func getContext() -> UnsafeMutableRawPointer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be more clearly named as takeContext()
since it returns a +1 object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is take
indicating +1 or -1? Should this be copyContext()
or retainContext()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I change to retain()
.
347ff17
to
bc87263
Compare
@swift-ci please test |
bc87263
to
95345ae
Compare
Teach swift-driver to remap path when needed. This involves: * Infer SDK/toolchain related path that needs to remapped * Send path remap related arguments to swift-frontend for depscanning * Send reverse map to swift-frontend for diagnostics replay * Constructing the compilation command for main module using remapped path
Teach swift-driver to replay cached compilation result using libSwiftScan APIs directly. Jobs constructed from swift-driver is going to have a new field for all the cache keys associated with the job. The Executor can choose to query and replay using those cache keys if possible, instead of executing the build command. rdar://117947710
…ration Re-unify caching availability check behind swift feature query and adjust the default caching build configuration changes.
Remove extra `-Xcc` in the command-line.`
95345ae
to
2de866d
Compare
@artemcm Some changes after I change the configuration in swift-frontend and swift most of the checks for if swift-frontend/libSwiftScan supports caching behind swift feature json flag. |
@swift-ci please test |
Teach swift-driver to use newly added functions in swift-frontend and libSwiftScan.