Skip to content

Commit c3962e9

Browse files
committed
macOS 27.0 architecture updates
1 parent a865736 commit c3962e9

46 files changed

Lines changed: 430 additions & 305 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Sources/SWBApplePlatform/Specs/DriverKit.xcspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
Name = "Intel 64-bit";
8383
Description = "64-bit Intel";
8484
PerArchBuildSettingName = "Intel 64-bit";
85+
DeploymentTargetRange = ( "0", "27" );
8586
},
8687
{
8788
_Domain = driverkit;

Sources/SWBApplePlatform/Specs/macOSArchitectures.xcspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
PerArchBuildSettingName = "Intel 64-bit";
8080
ListInEnum = NO;
8181
SortNumber = 106;
82+
DeploymentTargetRange = ( "10.4.4", "27" );
8283
},
8384
{
8485
_Domain = macosx;

Sources/SWBTestSupport/RunDestinationTestSupport.swift

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ package protocol _RunDestinationInfo {
2828
extension _RunDestinationInfo {
2929
/// A generic run destination targeting macOS, using the public SDK.
3030
package static var anyMac: Self {
31-
return generic(sdk: "macosx", sdkVariant: "macos", supportedArchitectures: ["arm64", "arm64e", "x86_64", "x86_64h"])
31+
return generic(sdk: "macosx", sdkVariant: "macos", supportedArchitectures: ["arm64", "arm64e"])
3232
}
3333

3434
/// A generic run destination targeting Mac Catalyst, using the public SDK.
3535
package static var anyMacCatalyst: Self {
36-
return generic(sdk: "macosx", sdkVariant: MacCatalystInfo.sdkVariantName, supportedArchitectures: ["arm64", "arm64e", "x86_64", "x86_64h"])
36+
return generic(sdk: "macosx", sdkVariant: MacCatalystInfo.sdkVariantName, supportedArchitectures: ["arm64", "arm64e"])
3737
}
3838

3939
/// A generic run destination targeting iOS, using the public SDK.
@@ -86,7 +86,14 @@ extension _RunDestinationInfo {
8686
static func destination(operatingSystem: OperatingSystem) -> Self {
8787
switch operatingSystem {
8888
case .macOS:
89-
macOS
89+
switch Architecture.host.stringValue {
90+
case "arm64":
91+
macOSAppleSilicon
92+
case "x86_64":
93+
macOSIntel
94+
default:
95+
preconditionFailure("Unknown architecture \(Architecture.host.stringValue ?? "<nil>")")
96+
}
9097
case .iOS(let simulator):
9198
simulator ? iOSSimulator : iOS
9299
case .tvOS(let simulator):
@@ -119,18 +126,8 @@ extension _RunDestinationInfo {
119126

120127
/// A run destination targeting macOS, using the public SDK.
121128
package static var macOS: Self {
122-
#if os(macOS)
123-
switch Architecture.host.stringValue {
124-
case "arm64":
125-
return macOSAppleSilicon
126-
case "x86_64":
127-
return macOSIntel
128-
default:
129-
preconditionFailure("Unknown architecture \(Architecture.host.stringValue ?? "<nil>")")
130-
}
131-
#else
132-
return macOSIntel
133-
#endif
129+
// Default to Apple Silicon now that x86 is no longer supported in new versions of macOS
130+
return .macOSAppleSilicon
134131
}
135132

136133
/// A run destination targeting macOS running on Intel, using the public SDK.
@@ -150,19 +147,8 @@ extension _RunDestinationInfo {
150147

151148
/// A run destination targeting macOS (Mac Catalyst), using the public SDK.
152149
package static var macCatalyst: Self {
153-
#if os(macOS)
154-
switch Architecture.host.stringValue {
155-
case "arm64":
156-
// FIXME: <rdar://78361860> Use results.runDestinationTargetArchitecture in our tests where appropriate so that this works
157-
fallthrough // return macCatalystAppleSilicon
158-
case "x86_64":
159-
return macCatalystIntel
160-
default:
161-
preconditionFailure("Unknown architecture \(Architecture.host.stringValue ?? "<nil>")")
162-
}
163-
#else
164-
return macCatalystIntel
165-
#endif
150+
// Default to Apple Silicon now that x86 is no longer supported in new versions of macOS
151+
return .macCatalystAppleSilicon
166152
}
167153

168154
/// A run destination targeting macOS (Mac Catalyst) running on Intel, using the public SDK.

Sources/SWBTestSupport/SkippedTestSupport.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ extension Trait where Self == Testing.ConditionTrait {
329329
requireMinimumXcodeBuildVersion("17A1", sourceLocation: sourceLocation)
330330
}
331331

332+
package static func requireXcode27(sourceLocation: SourceLocation = #_sourceLocation) -> Self {
333+
requireMinimumXcodeBuildVersion("27A1", sourceLocation: sourceLocation)
334+
}
335+
332336
package static func requireXcode26dot4(sourceLocation: SourceLocation = #_sourceLocation) -> Self {
333337
requireMinimumXcodeBuildVersion("17E1", sourceLocation: sourceLocation)
334338
}

Tests/SWBBuildSystemTests/BuildBacktraceTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ fileprivate struct BuildBacktraceTests: CoreBasedTests {
263263
}
264264
}
265265

266-
@Test(.requireSDKs(.macOS))
266+
@Test(.requireSDKs(.macOS), .requireXcode26())
267267
func backtracesForDeletedOutputs() async throws {
268268
try await withTemporaryDirectory { tmpDirPath async throws -> Void in
269269
let testWorkspace = TestWorkspace(

Tests/SWBBuildSystemTests/BuildCommandTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ fileprivate struct BuildCommandTests: CoreBasedTests {
287287
}
288288

289289
/// Check assembling of a single file.
290-
@Test(.requireSDKs(.macOS))
290+
@Test(.requireSDKs(.macOS), .requireXcode26())
291291
func assembleSingleFile() async throws {
292-
try await runSingleFileTask(BuildParameters(configuration: "Debug", activeRunDestination: .macOSIntel), buildCommand: .generateAssemblyCode(buildOnlyTheseFiles: [Path("")]), fileName: "File.m") { results, excludedTypes, inputs, outputs in
292+
try await runSingleFileTask(BuildParameters(configuration: "Debug", activeRunDestination: .macOSIntel, overrides: ["MACOSX_DEPLOYMENT_TARGET": "26.0"]), buildCommand: .generateAssemblyCode(buildOnlyTheseFiles: [Path("")]), fileName: "File.m") { results, excludedTypes, inputs, outputs in
293293
results.consumeTasksMatchingRuleTypes(excludedTypes)
294294
try results.checkTask(.matchRuleType("Assemble"), .matchRuleItemBasename("File.m"), .matchRuleItem("normal"), .matchRuleItem(results.runDestinationTargetArchitecture)) { task in
295295
task.checkCommandLineContainsUninterrupted(["-x", "objective-c"])
@@ -301,7 +301,7 @@ fileprivate struct BuildCommandTests: CoreBasedTests {
301301
}
302302

303303
// Ensure that RUN_CLANG_STATIC_ANALYZER=YES doesn't interfere with the assemble build command
304-
try await runSingleFileTask(BuildParameters(configuration: "Debug", activeRunDestination: .macOSIntel, overrides: ["RUN_CLANG_STATIC_ANALYZER": "YES"]), buildCommand: .generateAssemblyCode(buildOnlyTheseFiles: [Path("")]), fileName: "File.m") { results, excludedTypes, inputs, outputs in
304+
try await runSingleFileTask(BuildParameters(configuration: "Debug", activeRunDestination: .macOSIntel, overrides: ["RUN_CLANG_STATIC_ANALYZER": "YES", "MACOSX_DEPLOYMENT_TARGET": "26.0"]), buildCommand: .generateAssemblyCode(buildOnlyTheseFiles: [Path("")]), fileName: "File.m") { results, excludedTypes, inputs, outputs in
305305
results.consumeTasksMatchingRuleTypes(excludedTypes)
306306
try results.checkTask(.matchRuleType("Assemble"), .matchRuleItemBasename("File.m"), .matchRuleItem("normal"), .matchRuleItem(results.runDestinationTargetArchitecture)) { task in
307307
task.checkCommandLineContainsUninterrupted(["-x", "objective-c"])
@@ -313,7 +313,7 @@ fileprivate struct BuildCommandTests: CoreBasedTests {
313313
}
314314

315315
// Include the single file to assemble in multiple targets
316-
try await runSingleFileTask(BuildParameters(configuration: "Debug", activeRunDestination: .macOSIntel), buildCommand: .generateAssemblyCode(buildOnlyTheseFiles: [Path("")]), fileName: "File.m", multipleTargets: true) { results, excludedTypes, inputs, outputs in
316+
try await runSingleFileTask(BuildParameters(configuration: "Debug", activeRunDestination: .macOSIntel, overrides: ["MACOSX_DEPLOYMENT_TARGET": "26.0"]), buildCommand: .generateAssemblyCode(buildOnlyTheseFiles: [Path("")]), fileName: "File.m", multipleTargets: true) { results, excludedTypes, inputs, outputs in
317317
let firstOutput = try #require(outputs.sorted()[safe: 0])
318318
let secondOutput = try #require(outputs.sorted()[safe: 1])
319319
results.consumeTasksMatchingRuleTypes(excludedTypes)

Tests/SWBBuildSystemTests/BuildDescriptionConstructionTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ fileprivate struct BuildDescriptionConstructionTests: CoreBasedTests {
854854

855855
@Test(.requireSDKs(.macOS))
856856
func packageDiamondProblemDiagnosticWithBundleLoader() async throws {
857+
let core = try await getCore()
857858
try await withTemporaryDirectory { tmpDir in
858859
let workspace = try await TestWorkspace("Workspace",
859860
sourceRoot: tmpDir,
@@ -874,8 +875,8 @@ fileprivate struct BuildDescriptionConstructionTests: CoreBasedTests {
874875
"PRODUCT_NAME": "$(TARGET_NAME)",
875876
"USE_HEADERMAP": "NO",
876877
"SKIP_INSTALL": "YES",
877-
"MACOSX_DEPLOYMENT_TARGET": "10.15",
878-
"IPHONEOS_DEPLOYMENT_TARGET": "13.0",
878+
"MACOSX_DEPLOYMENT_TARGET": core.loadSDK(.macOS).defaultDeploymentTarget,
879+
"IPHONEOS_DEPLOYMENT_TARGET": core.loadSDK(.iOS).defaultDeploymentTarget,
879880
"SUPPORTED_PLATFORMS": "$(AVAILABLE_PLATFORMS)",
880881
"SUPPORTS_MACCATALYST": "YES",
881882
]),

Tests/SWBBuildSystemTests/BuildOperationTests.swift

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3097,7 +3097,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script
30973097
}
30983098

30993099
/// Check the actual behavior of mutable tasks in an [incremental] build.
3100-
@Test(.requireSDKs(.macOS))
3100+
@Test(.requireSDKs(.macOS), .requireXcode26())
31013101
func actualMutableBehaviors() async throws {
31023102
func checkScenario(_ name: String, expectedTasks: [String], generic: Bool = false, settings: [String: String] = [:], enableSigning: Bool = false, targetType: TestStandardTarget.TargetType = .commandLineTool) async throws {
31033103
let targetName = targetType == .framework ? "Fwk" : "Tool"
@@ -3239,6 +3239,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script
32393239
try await checkScenario("Universal Tool Mutation", expectedTasks: ["ScanDependencies", "ScanDependencies", "CompileC", "CompileC", "CreateUniversalBinary", "Ld", "Ld", "Strip"], generic: true, settings: [
32403240
"STRIP_INSTALLED_PRODUCT": "YES",
32413241
"ARCHS": "x86_64 x86_64h",
3242+
"MACOSX_DEPLOYMENT_TARGET": "26.0",
32423243
"VALID_ARCHS[sdk=macosx*]": "$(inherited) x86_64h"])
32433244

32443245
// Check the behavior of signing a framework.
@@ -3481,7 +3482,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script
34813482
}
34823483

34833484
/// Tests that content such as headers is removed from frameworks when they are processed by a copy files build phase.
3484-
@Test(.requireSDKs(.macOS, .iOS), arguments: [.anyMac, .anyiOSDevice, .anyMacCatalyst] as [RunDestinationInfo])
3485+
@Test(.requireSDKs(.macOS, .iOS), .requireXcode27(), arguments: [.anyMac, .anyiOSDevice, .anyMacCatalyst] as [RunDestinationInfo])
34853486
func copiedFrameworkContentPruning(runDestination: RunDestinationInfo) async throws {
34863487
try await withTemporaryDirectory { tmpDirPath in
34873488
let testWorkspace = TestWorkspace(
@@ -3551,7 +3552,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script
35513552
let signableTargets: Set<String> = ["App", "App2"]
35523553

35533554
let sourceDynamicFrameworkPath = tmpDirPath.join("ADynamicFwk.framework")
3554-
try await tester.fs.writeFramework(sourceDynamicFrameworkPath, archs: runDestination.platform == "macosx" ? ["arm64", "x86_64"] : ["arm64"], platform: #require(runDestination.buildVersionPlatform(core)), infoLookup: core, static: false) { _, _, headersDir, resourcesDir in
3555+
try await tester.fs.writeFramework(sourceDynamicFrameworkPath, archs: ["arm64"], platform: #require(runDestination.buildVersionPlatform(core)), infoLookup: core, static: false) { _, _, headersDir, resourcesDir in
35553556
try await tester.fs.writeFileContents(headersDir.join("ADynamicFwk.h")) { $0 <<< "" }
35563557
try await tester.fs.writePlist(resourcesDir.join("ADynamicResource.plist"), .plDict([:]))
35573558
try await tester.fs.writePlist(resourcesDir.join("Info.plist"), .plDict([
@@ -3589,7 +3590,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script
35893590
let bundleSupportedPlatforms = try #require(platform?.additionalInfoPlistEntries["CFBundleSupportedPlatforms"])
35903591

35913592
let sourceStaticFrameworkPath = tmpDirPath.join("AStaticFwk.framework")
3592-
try await tester.fs.writeFramework(sourceStaticFrameworkPath, archs: runDestination.platform == "macosx" ? ["arm64", "x86_64"] : ["arm64"], platform: #require(runDestination.buildVersionPlatform(core)), infoLookup: core, static: true) { _, _, headersDir, resourcesDir in
3593+
try await tester.fs.writeFramework(sourceStaticFrameworkPath, archs: ["arm64"], platform: #require(runDestination.buildVersionPlatform(core)), infoLookup: core, static: true) { _, _, headersDir, resourcesDir in
35933594
try await tester.fs.writeFileContents(headersDir.join("AStaticFwk.h")) { $0 <<< "" }
35943595
try await tester.fs.writePlist(resourcesDir.join("AStaticResource.plist"), .plDict([:]))
35953596
try await tester.fs.writePlist(resourcesDir.join("Info.plist"), .plDict([
@@ -3669,7 +3670,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script
36693670
} else {
36703671
let minos = try #require(vtoolOutput.components(separatedBy: "\n").first(where: { $0.contains("minos") })?.trimmingPrefix(while: { $0.isWhitespace }))
36713672
#expect(minos == (runDestination.buildVersionPlatform(core) == .macCatalyst ? "minos 14.2" : "minos 11.0"))
3672-
#expect(try Set(MachO(reader: BinaryReader(data: tester.fs.read(Path(frameworkPath)))).slices().map { $0.arch }) == ["arm64", "x86_64"])
3673+
#expect(try Set(MachO(reader: BinaryReader(data: tester.fs.read(Path(frameworkPath)))).slices().map { $0.arch }) == ["arm64"])
36733674
}
36743675
}
36753676

@@ -7253,7 +7254,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script
72537254
try await test(buildSettings: ["ENABLE_ENHANCED_SECURITY": "NO", "ENABLE_POINTER_AUTHENTICATION": "YES"], expectedArchs: ["arm64e"])
72547255
}
72557256

7256-
@Test(.requireSDKs(.macOS))
7257+
@Test(.requireSDKs(.macOS), .requireXcode26())
72577258
func pointerAuthenticationBuildSetting_macOS() async throws {
72587259
func test(buildSettings: [String: String], expectedArchs: [String], line: UInt = #line) async throws {
72597260

@@ -7314,14 +7315,14 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script
73147315
}
73157316
}
73167317

7317-
try await test(buildSettings: ["ENABLE_POINTER_AUTHENTICATION": "YES"], expectedArchs: ["x86_64", "arm64", "arm64e"])
7318-
try await test(buildSettings: ["ENABLE_POINTER_AUTHENTICATION": "NO"], expectedArchs: ["x86_64", "arm64"])
7318+
try await test(buildSettings: ["ENABLE_POINTER_AUTHENTICATION": "YES", "MACOSX_DEPLOYMENT_TARGET": "26.0"], expectedArchs: ["x86_64", "arm64", "arm64e"])
7319+
try await test(buildSettings: ["ENABLE_POINTER_AUTHENTICATION": "NO", "MACOSX_DEPLOYMENT_TARGET": "26.0"], expectedArchs: ["x86_64", "arm64"])
73197320

73207321
// ENABLE_ENHANCED_SECURITY enables pointer authentication unless ENABLE_POINTER_AUTHENTICATION is explicitly disabled.
7321-
try await test(buildSettings: ["ENABLE_ENHANCED_SECURITY": "YES"], expectedArchs: ["x86_64", "arm64", "arm64e"])
7322-
try await test(buildSettings: ["ENABLE_ENHANCED_SECURITY": "NO"], expectedArchs: ["x86_64", "arm64"])
7323-
try await test(buildSettings: ["ENABLE_ENHANCED_SECURITY": "YES", "ENABLE_POINTER_AUTHENTICATION": "NO"], expectedArchs: ["x86_64", "arm64"])
7324-
try await test(buildSettings: ["ENABLE_ENHANCED_SECURITY": "NO", "ENABLE_POINTER_AUTHENTICATION": "YES"], expectedArchs: ["x86_64", "arm64e"])
7322+
try await test(buildSettings: ["ENABLE_ENHANCED_SECURITY": "YES", "MACOSX_DEPLOYMENT_TARGET": "26.0"], expectedArchs: ["x86_64", "arm64", "arm64e"])
7323+
try await test(buildSettings: ["ENABLE_ENHANCED_SECURITY": "NO", "MACOSX_DEPLOYMENT_TARGET": "26.0"], expectedArchs: ["x86_64", "arm64"])
7324+
try await test(buildSettings: ["ENABLE_ENHANCED_SECURITY": "YES", "ENABLE_POINTER_AUTHENTICATION": "NO", "MACOSX_DEPLOYMENT_TARGET": "26.0"], expectedArchs: ["x86_64", "arm64"])
7325+
try await test(buildSettings: ["ENABLE_ENHANCED_SECURITY": "NO", "ENABLE_POINTER_AUTHENTICATION": "YES", "MACOSX_DEPLOYMENT_TARGET": "26.0"], expectedArchs: ["x86_64", "arm64e"])
73257326
}
73267327

73277328
@Test(.requireSDKs(.macOS))

0 commit comments

Comments
 (0)