Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Sources/SWBAndroidPlatform/AndroidSDK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ public import Foundation

let metaPath = ndkPath.path.join("meta")

guard #available(macOS 14, *) else {
throw StubError.error("Unsupported macOS version")
}

if version < Self.minimumNDKVersion {
throw Error.unsupportedVersion(path: ndkPath, minimumVersion: Self.minimumNDKVersion)
}
Expand Down
6 changes: 2 additions & 4 deletions Sources/SWBCore/SpecImplementations/Tools/CodeSign.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,8 @@ public final class CodesignToolSpec : CommandLineToolSpec, SpecIdentifierType, @
commandLine.append(contentsOf: ["--launch-constraint-responsible", responsibleProcessLaunchConstraint.str])
}

if cbc.producer.systemInfo?.operatingSystemVersion >= Version(14) {
if let libraryLoadConstraint = cbc.producer.signingSettings?.libraryConstraint {
commandLine.append(contentsOf: ["--library-constraint", libraryLoadConstraint.str])
}
if let libraryLoadConstraint = cbc.producer.signingSettings?.libraryConstraint {
commandLine.append(contentsOf: ["--library-constraint", libraryLoadConstraint.str])
}

// Add the path to the file to sign.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1087,22 +1087,13 @@ fileprivate struct CodeSignTaskConstructionTests: CoreBasedTests {
let testWorkspace = TestWorkspace("aWorkspace", projects: [testProject])
let tester = try await TaskConstructionTester(getCore(), testWorkspace)

// Check --library-constraint is passed when the build setting is configured on macOS 14
await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", overrides: ["LIBRARY_LOAD_CONSTRAINT": "/tmp/LibraryLoadConstraint.plist"]), runDestination: .macOS, systemInfo: SystemInfo(operatingSystemVersion: Version(14), productBuildVersion: "99A98", nativeArchitecture: "arm64")) { results in
// Check --library-constraint is passed
await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", overrides: ["LIBRARY_LOAD_CONSTRAINT": "/tmp/LibraryLoadConstraint.plist"]), runDestination: .macOS) { results in
results.checkTarget("Tool") { target in
results.checkTask(.matchTarget(target), .matchRuleType("CodeSign")) { task in
task.checkCommandLineMatches(["/usr/bin/codesign", "--force", "--sign", "-", "--entitlements", .suffix("Tool.xcent"), "--generate-entitlement-der", "--library-constraint", .suffix("LibraryLoadConstraint.plist"), "/tmp/aProject.dst/usr/local/bin/Tool"])
}
}
}

// Check --library-constraint is *not* passed when the build setting is configured on macOS 13
await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", overrides: ["LIBRARY_LOAD_CONSTRAINT": "/tmp/LibraryLoadConstraint.plist"]), runDestination: .macOS, systemInfo: SystemInfo(operatingSystemVersion: Version(13), productBuildVersion: "99A98", nativeArchitecture: "arm64")) { results in
results.checkTarget("Tool") { target in
results.checkTask(.matchTarget(target), .matchRuleType("CodeSign")) { task in
task.checkCommandLineMatches(["/usr/bin/codesign", "--force", "--sign", "-", "--entitlements", .suffix("Tool.xcent"), "--generate-entitlement-der", "/tmp/aProject.dst/usr/local/bin/Tool"])
}
}
}
}
}