-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Do not inherit host destination's extra flags for target destination when cross-compiling #3703
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
Do not inherit host destination's extra flags for target destination when cross-compiling #3703
Conversation
@swift-ci please smoke test |
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.
Looks reasonable to me.
a09680a
to
497f846
Compare
Sources/Workspace/Destination.swift
Outdated
@@ -178,6 +178,24 @@ public struct Destination: Encodable, Equatable { | |||
} | |||
/// Cache storage for sdk platform path. | |||
private static var _sdkPlatformFrameworkPath: (fwk: AbsolutePath, lib: AbsolutePath)? = nil | |||
|
|||
/// Returns a default destination of a given target environment | |||
public static func defaultDestination(target: Triple, hostDestination: Destination) -> Destination? { |
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.
target
has a very specific meaning in SwiftPM, hence my suggestion to label it for
. another alternative is to label it triple
or targetTriple
, tho I think the type already says that its a triple - which is also why labeling hostDestination: Destination
is redundant as Destination is already communicated by the type.
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.
Oh, sorry. I overlooked your comment around labels. I followed defaultDestination(for triple: Triple, host: Destination) -> Destination?
Host environment specific flags, such as XCTest module directory, were implicitly inherited by target destination. It caused unexpected reference to host module file, so drop them explicitly
497f846
to
0ceb626
Compare
@swift-ci please smoke test |
…wiftlang#3703) Host environment specific flags, such as XCTest module directory, were implicitly inherited by target destination. It caused unexpected reference to host module file, so drop them explicitly
Do not inherit host destination's extra flags for target destination
Motivation:
Host environment specific flags, such as XCTest module directory, were implicitly inherited by target destination. It caused unexpected reference to host module file when cross-compiling for WASI, so drop them explicitly
Modifications:
Create a new fresh Destination for WASI target and move some logic into Destination to be more generic for different targets.
CC: @MaxDesiatov