-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Darwin] Further restrict inference of the simulator environment #30771
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
[Darwin] Further restrict inference of the simulator environment #30771
Conversation
@swift-ci please test |
Seems like we should also remove this from |
Build failed |
Linux failure is unrelated. Trying again... |
@swift-ci please test source compatibility |
@swift-ci please smoke test Linux |
GitHub connectivity problems affected the compatibility suite. Sigh. |
1 similar comment
GitHub connectivity problems affected the compatibility suite. Sigh. |
@swift please test source compatibility |
Build failed |
2d66f2b
to
8e0717c
Compare
8e0717c
to
36bc9e3
Compare
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please clean test |
36bc9e3
to
7346da6
Compare
@swift-ci please clean test |
@swift-ci please test source compatibility |
@swift-ci please clean test |
@swift-ci please test source compatibility |
Build failed |
Build failed |
7346da6
to
462a783
Compare
@swift-ci please test |
Build failed |
Build failed |
Much of this pull request came in via #30843. I'll rebase the rest on top of this. |
@@ -172,6 +174,13 @@ macro(configure_sdk_darwin | |||
"${SWIFT_SDK_${prefix}_ARCHITECTURES}" # rhs | |||
SWIFT_SDK_${prefix}_MODULE_ARCHITECTURES) # result | |||
|
|||
# Determine whether this is a simulator SDK. | |||
if ( ${xcrun_name} MATCHES "simulator" ) |
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.
The convention in LLVM (and Swift) is not have spaces after the if
and not to have spaces inside the (
.
if ( ${xcrun_name} MATCHES "simulator" ) | |
if(xcrun_name MATCHES simulator) |
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 had no idea, thank you!
@@ -181,6 +190,12 @@ macro(configure_sdk_darwin | |||
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE | |||
"${arch}-apple-${SWIFT_SDK_${prefix}_TRIPLE_NAME}") | |||
|
|||
# If this is a simulator target, append -simulator. | |||
if (SWIFT_SDK_${prefix}_IS_SIMULATOR) |
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.
if (SWIFT_SDK_${prefix}_IS_SIMULATOR) | |
if(SWIFT_SDK_${prefix}_IS_SIMULATOR) |
if (SWIFT_SDK_${prefix}_IS_SIMULATOR) | ||
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE | ||
"${SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE}-simulator") | ||
endif () |
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.
endif () | |
endif() |
The *-simulator target triples have been used consistently in tools for several years to indicate simulator targets. Stop inferring the simulator part, rdar://problem/35810403.
It's just Triple::isSimulatorEnvironment() now.
Localize the hack to infer simulator-ness of the target in the driver itself, when it first processes the target. Emit a warning about the missing "-simulator" and correct the triple immediately. This gives a longer grace period for tools that might still not pass through the simulator environment, while narrowing the hack.
462a783
to
643491e
Compare
@swift-ci please test |
@swift-ci please test source compatibility |
@swift-ci please test |
@swift-ci please test source compatibility |
Build failed |
Build failed |
Build failed |
Build failed |
Some code paths that see target triples go through the frontend without seeing the driver. Therefore, perform the same "simulator" inference for x86 iOS/tvOS/watchOS triples also in the frontend, to ensure that we remain compatible. Also make sure that -print-target-info performs the appropriate adjustment.
@swift-ci please test |
@swift-ci please test source compatibility |
Build failed |
Build failed |
@swift-ci please test |
1 similar comment
@swift-ci please test |
Build failed |
@swift-ci test platform Linux |
@swift-ci smoke test Linux |
1 similar comment
@swift-ci smoke test Linux |
When this was merged, the Linux PR testing started failing in lldb tests. First Failure here: https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04/4933/ I have no idea what's going on, it doesn't make much sense, but the revert unblocked things. |
The *-simulator target triples have been used mostly consistently in build systems for
several years to indicate simulator targets... except for Swift's own CMake configuration
and
build-script
, which was still not doing it until recently. There are still.swiftinterface
files around that depend on the inference.
Rather than outright removing inference of the "simulator" environment, move it into
the driver and warn that it's happening, so other tools can move off it over time. This
ensures that all frontend/linker/etc. jobs see the "simulator" environment, so the hack is
only in a single place.
This is as far as we can go toward completely removing the hack (rdar://problem/35810403),
because of the need to continue supporting existing
.swiftinterface
files.