Skip to content

Commit d42422b

Browse files
committed
Drop x86_64 from simulator builds at deployment targets 27+
Mirrors the existing macOS x86_64 clamp, for the iOS, tvOS, watchOS and xrOS simulators. Adds a test covering the clamped (arm64-only) behavior. resolves: rdar://179972645 assisted by Claude Opus 4.8
1 parent 748f336 commit d42422b

5 files changed

Lines changed: 23 additions & 0 deletions

File tree

Sources/SWBApplePlatform/Specs/iOSSimulator.xcspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
Identifier = x86_64;
3131
PerArchBuildSettingName = "Intel 64-bit";
3232
SortNumber = 106;
33+
DeploymentTargetRange = ( "0", "27" );
3334
},
3435

3536
{

Sources/SWBApplePlatform/Specs/tvOSSimulator.xcspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
Identifier = x86_64;
3131
PerArchBuildSettingName = "Intel 64-bit";
3232
SortNumber = 106;
33+
DeploymentTargetRange = ( "0", "27" );
3334
},
3435

3536

Sources/SWBApplePlatform/Specs/watchOSSimulator.xcspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
Identifier = x86_64;
3939
PerArchBuildSettingName = "Intel 64-bit";
4040
SortNumber = 106;
41+
DeploymentTargetRange = ( "0", "27" );
4142
},
4243

4344
{

Sources/SWBApplePlatform/Specs/xrOSSimulator.xcspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
Identifier = x86_64;
3131
PerArchBuildSettingName = "Intel 64-bit";
3232
SortNumber = 106;
33+
DeploymentTargetRange = ( "0", "27" );
3334
},
3435

3536
{

Tests/SWBCoreTests/SettingsTests.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4961,6 +4961,25 @@ import SWBTestSupport
49614961
}
49624962
}
49634963

4964+
@Test(.requireSDKs(.iOS), .requireXcode27())
4965+
func activeRunDestination_Simulator_x86_64ClampedAtDefaultDeploymentTarget() async throws {
4966+
// Build all standard archs. The clamp then drops x86_64 from a simulator build at the
4967+
// default (>= 27) deployment target.
4968+
try await testActiveRunDestinationiOS(extraBuildSettings: [
4969+
"ONLY_ACTIVE_ARCH": "NO",
4970+
], runDestination: .iOSSimulator) { context, settings, scope throws in
4971+
#expect(settings.errors == [])
4972+
#expect(settings.warnings == [])
4973+
#expect(scope.evaluate(BuiltinMacros.PLATFORM_NAME) == "iphonesimulator")
4974+
#expect(scope.evaluate(BuiltinMacros.PLATFORM_FAMILY_NAME) == "iOS")
4975+
#expect(scope.evaluate(BuiltinMacros.SDKROOT) == context.sdkRegistry.lookup("iphonesimulator")?.path)
4976+
#expect(!scope.evaluate(BuiltinMacros.ONLY_ACTIVE_ARCH))
4977+
#expect(scope.evaluate(BuiltinMacros.ARCHS) == ["arm64"])
4978+
try #require(scope.evaluate(try scope.namespace.declareStringMacro("x86_64")) == "")
4979+
try #require(scope.evaluate(try scope.namespace.declareStringMacro("arm64")) == "YES")
4980+
}
4981+
}
4982+
49644983
@Test(.requireSDKs(.macOS), .requireXcode26())
49654984
func activeRunDestination_ONLY_ACTIVE_ARCH_interaction() async throws {
49664985
// Prefer the run destination's targetArchitecture

0 commit comments

Comments
 (0)