Skip to content

Verify usage of -o arguments in multi-threading mode. #711

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

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Jun 11, 2021

Causing the behavior to be analagous to the Legacy driver's here:
https://github.com/apple/swift/blob/main/lib/Driver/Driver.cpp#L2415
Otherwise, this isn't a supported flow and leads to driver crashes downstream.

Also ensure that we do not perform the check that ensures the same output is not produced more than once for standard-out outputs. This allows things like -emit-ir to actually function with -wmo -num-threads and be output correctly.

…reading mode

Causing the behavior to be analagous to the Legacy driver's here:
https://github.com/apple/swift/blob/main/lib/Driver/Driver.cpp#L2415

Otherwise, this isn't a supported flow and leads to driver crashes downstream.

Resolves rdar://79171618
@artemcm artemcm requested review from davidungar and nkcsgexi June 11, 2021 19:07
@artemcm
Copy link
Contributor Author

artemcm commented Jun 11, 2021

@swift-ci please test

@artemcm
Copy link
Contributor Author

artemcm commented Jun 11, 2021

Thanks @cltnschlosser !

@artemcm artemcm merged commit d05dd6e into swiftlang:main Jun 11, 2021
@artemcm artemcm deleted the AllowMultipleStdOutOutputs branch June 11, 2021 21:59
@@ -24,6 +24,7 @@ public struct Driver {
case relativeFrontendPath(String)
case subcommandPassedToDriver
case integratedReplRemoved
case cannotSpecify_OForMultipleOutputs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might help users to list the outputs in here, and print them with the error message.

@@ -191,7 +191,8 @@ public final class MultiJobExecutor {
to producerMap: inout [VirtualPath.Handle: Int]
) {
for output in job.outputs {
if let otherJobIndex = producerMap.updateValue(index, forKey: output.fileHandle) {
if output.file != .standardOutput,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment explaining why the error is skipped for .standardOutput could help here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the updateValue gets skipped. Maybe producerMap should exclude stdouts? Does it already?? Is there a comment on the var??

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.

3 participants