-
Notifications
You must be signed in to change notification settings - Fork 211
PrebuiltModuleGen: dedupe prebuilt module jobs #1972
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
base: main
Are you sure you want to change the base?
Conversation
@swift-ci please test |
var seen: Set<String> = [] | ||
var result: [Job] = [] | ||
for job in jobs { | ||
assert(job.outputs.count == 1) |
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.
Would be worthwhile to also assert on job kind being an emit module from interface here.
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 actually changed the fix of deduping to an earlier step. Mind taking another look?
var result: [Job] = [] | ||
for job in jobs { | ||
assert(job.outputs.count == 1) | ||
let key = job.outputs.first!.file.absolutePath!.pathString |
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.
Instead of file
, it should be sufficient to have the hash set operate on fileHandle
, as those will map to the same underlying absolute path string, and it won't be necessary to do .absolutePath!.pathString
.
@@ -772,6 +772,21 @@ extension Driver { | |||
return allJobs | |||
} | |||
|
|||
/// Dedupe jobs by output paths | |||
func dedupeJobs(_ jobs: [Job]) -> [Job] { |
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.
Nit: something like dedupeCompileSwiftModuleFromInterfaceJobs
would be a more-descriptive name
…ules. We collect these Swift module names from the outputs of dependency scanning. However, we've noticed dupes in the output, leading to build system reporting fatal errors. As a fix, we dedupe the module names before generating prebuilt module cache. rdar://158615938
@swift-ci please smoke test |
@swift-ci please smoke test |
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
@swift-ci please test |
This prevents issues that we can find same module in multiple different locations.
rdar://158615938