Skip to content

Commit d8e7311

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

44 files changed

Lines changed: 383 additions & 266 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: 6 additions & 27 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.
@@ -119,18 +119,8 @@ extension _RunDestinationInfo {
119119

120120
/// A run destination targeting macOS, using the public SDK.
121121
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
122+
// Default to Apple Silicon now that x86 is no longer supported in new versions of macOS
123+
return .macOSAppleSilicon
134124
}
135125

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

151141
/// A run destination targeting macOS (Mac Catalyst), using the public SDK.
152142
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
143+
// Default to Apple Silicon now that x86 is no longer supported in new versions of macOS
144+
return .macCatalystAppleSilicon
166145
}
167146

168147
/// 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/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))

Tests/SWBBuildSystemTests/HostBuildToolBuildOperationTests.swift

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import SWBUtil
2323

2424
@Suite
2525
fileprivate struct HostBuildToolBuildOperationTests: CoreBasedTests {
26-
@Test(.requireSDKs(.macOS, .iOS))
26+
@Test(.requireSDKs(.macOS, .iOS), .requireXcode26())
2727
func buildingHostTools() async throws {
2828
try await withTemporaryDirectory { tmpDirPath async throws -> Void in
2929
let testProject = try await TestProject(
@@ -178,6 +178,9 @@ fileprivate struct HostBuildToolBuildOperationTests: CoreBasedTests {
178178
"CODE_SIGNING_ALLOWED": "NO",
179179
"SDKROOT": "auto",
180180
"SUPPORTED_PLATFORMS": "$(AVAILABLE_PLATFORMS)",
181+
// Workaround for CI which have Intel hosts.
182+
"MACOSX_DEPLOYMENT_TARGET": "26.0",
183+
"IPHONEOS_DEPLOYMENT_TARGET": "26.0",
181184
]),
182185
],
183186
targets: [
@@ -228,6 +231,8 @@ fileprivate struct HostBuildToolBuildOperationTests: CoreBasedTests {
228231
"CODE_SIGNING_ALLOWED": "NO",
229232
"SDKROOT": "auto",
230233
"SUPPORTED_PLATFORMS": "$(AVAILABLE_PLATFORMS)",
234+
"MACOSX_DEPLOYMENT_TARGET": "26.0",
235+
"IPHONEOS_DEPLOYMENT_TARGET": "26.0",
231236
]),
232237
],
233238
targets: [
@@ -314,7 +319,7 @@ fileprivate struct HostBuildToolBuildOperationTests: CoreBasedTests {
314319
}
315320
}
316321

317-
@Test(.requireSDKs(.macOS, .iOS), arguments: [RunDestinationInfo.anyMac, .anyMacCatalyst, .anyiOSDevice])
322+
@Test(.requireSDKs(.macOS, .iOS), .requireXcode26(), arguments: [RunDestinationInfo.anyMac, .anyMacCatalyst, .anyiOSDevice])
318323
func testHostToolsAndDependenciesAreBuiltDuringIndexingPreparation(destination: RunDestinationInfo) async throws {
319324
let testProject = try await TestProject(
320325
"aProject",
@@ -329,6 +334,9 @@ fileprivate struct HostBuildToolBuildOperationTests: CoreBasedTests {
329334
"GENERATE_INFOPLIST_FILE": "YES",
330335
"PRODUCT_NAME": "$(TARGET_NAME)",
331336
"CODE_SIGNING_ALLOWED": "NO",
337+
// Workaround for CI which have Intel hosts.
338+
"MACOSX_DEPLOYMENT_TARGET": "26.0",
339+
"IPHONEOS_DEPLOYMENT_TARGET": "26.0",
332340
]),
333341
],
334342
targets: [
@@ -421,7 +429,7 @@ fileprivate struct HostBuildToolBuildOperationTests: CoreBasedTests {
421429
}
422430
}
423431

424-
@Test(.requireSDKs(.macOS, .iOS), arguments: [RunDestinationInfo.anyMac, .anyMacCatalyst, .anyiOSDevice], [true, false])
432+
@Test(.requireSDKs(.macOS, .iOS), .requireXcode26(), arguments: [RunDestinationInfo.anyMac, .anyMacCatalyst, .anyiOSDevice], [true, false])
425433
func testHostToolsAndDependenciesAreBuiltDuringIndexingPreparationForPackage(
426434
destination: RunDestinationInfo, targetBuild: Bool
427435
) async throws {
@@ -440,6 +448,8 @@ fileprivate struct HostBuildToolBuildOperationTests: CoreBasedTests {
440448
"CODE_SIGNING_ALLOWED": "NO",
441449
"SDKROOT": "auto",
442450
"SUPPORTED_PLATFORMS": "$(AVAILABLE_PLATFORMS)",
451+
// Workaround for CI which have Intel hosts.
452+
"MACOSX_DEPLOYMENT_TARGET": "26.0",
443453
]),
444454
],
445455
targets: [
@@ -606,7 +616,7 @@ fileprivate struct HostBuildToolBuildOperationTests: CoreBasedTests {
606616
}
607617
}
608618

609-
@Test(.requireSDKs(.macOS))
619+
@Test(.requireSDKs(.macOS), .requireXcode26())
610620
func hostToolsAreNotFullyBuiltWhenNotPreparingDependents() async throws {
611621
try await withTemporaryDirectory { tmpDirPath async throws -> Void in
612622
let testProject = try await TestProject(
@@ -622,6 +632,8 @@ fileprivate struct HostBuildToolBuildOperationTests: CoreBasedTests {
622632
"GENERATE_INFOPLIST_FILE": "YES",
623633
"PRODUCT_NAME": "$(TARGET_NAME)",
624634
"CODE_SIGNING_ALLOWED": "NO",
635+
// Workaround for CI which have Intel hosts.
636+
"MACOSX_DEPLOYMENT_TARGET": "26.0",
625637
]),
626638
],
627639
targets: [

0 commit comments

Comments
 (0)