Skip to content

Conversation

finagolfin
Copy link
Member

This will require more discussion, but this attempts to fix #8958, will have more info soon.

observabilityScope.emit(
warning: """
Multiple SDKs have been configured with this triple \(swiftSDKSelector), so
dropping back to values from original bundle.
Copy link
Member Author

Choose a reason for hiding this comment

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

The reason I had to add all this logic is because one can specify --swift-sdk triple instead of a Swift bundle name, what is termed an artifact ID in the code, and since that triple may be supplied by multiple installed Swift SDKs, the existing logic simply picks the first SDK it finds and warns that it found multiple matching SDKs. Since this local config override then doesn't know which SDK bundle was chosen, as the bundle artifact ID picked is not passed back by these internal methods, this logic has to again search for the bundle chosen and can't use the local config override if multiple bundles matched.

Instead, I would like to make two independent changes to these SDK selection methods:

  1. Only return a result if there is a unique matching SDK bundle ID or triple, error if not. If there is a unique match, pass back both the bundle artifact ID and the SDK, so that this local config override can then be uniquely checked.
  2. Do not allow passing in triples to --swift-sdk, use the --triple flag instead. The use of that flag is currently broken with SDK bundles, as reported in --triple option doesn't take installed Swift SDKs into account #7330 and SwiftPM selects wrong architecture from multi-arch Swift SDK when using --swift-sdk and --triple #9220, so this change would also fix those issues.

@MaxDesiatov, let me know what you think of such proposed fixes, which this pull does not implement, as this pull only uses existing SwiftPM methods.

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.

swift sdk configure settings are not used for cross-compilation

1 participant