Skip to content

Commit f9ab798

Browse files
committed
Merge remote-tracking branch 'origin/main' into release/5.10
2 parents 0002983 + de5d5e5 commit f9ab798

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

Sources/CoreCommands/Options.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,8 @@ public struct BuildOptions: ParsableArguments {
477477
)
478478
public var linkTimeOptimizationMode: LinkTimeOptimizationMode?
479479

480-
@Flag(help: .hidden)
481-
public var enableGetTaskAllowEntitlement: Bool = false
482-
483-
@Flag(help: .hidden)
484-
public var disableGetTaskAllowEntitlement: Bool = false
480+
@Flag(inversion: .prefixedEnableDisable, help: .hidden)
481+
public var getTaskAllowEntitlement: Bool? = nil
485482

486483
// @Flag works best when there is a default value present
487484
// if true, false aren't enough and a third state is needed

Sources/CoreCommands/SwiftTool.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,7 @@ public final class SwiftTool {
682682
component: targetTriple.platformBuildPathComponent(buildSystem: options.build.buildSystem)
683683
)
684684

685-
if !targetTriple.isMacOSX && (
686-
options.build.disableGetTaskAllowEntitlement || options.build.enableGetTaskAllowEntitlement
687-
) {
685+
if options.build.getTaskAllowEntitlement != nil && !targetTriple.isMacOSX {
688686
observabilityScope.emit(warning: Self.entitlementsMacOSWarning)
689687
}
690688

@@ -705,8 +703,7 @@ public final class SwiftTool {
705703
debugInfoFormat: options.build.debugInfoFormat.buildParameter,
706704
targetTriple: targetTriple,
707705
shouldEnableDebuggingEntitlement:
708-
(options.build.configuration == .debug && !options.build.disableGetTaskAllowEntitlement) ||
709-
(options.build.enableGetTaskAllowEntitlement && !options.build.disableGetTaskAllowEntitlement)
706+
options.build.getTaskAllowEntitlement ?? (options.build.configuration == .debug)
710707
),
711708
driverParameters: .init(
712709
canRenameEntrypointFunctionName: driverSupport.checkSupportedFrontendFlags(

Tests/WorkspaceTests/WorkspaceTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5017,7 +5017,7 @@ final class WorkspaceTests: XCTestCase {
50175017
do {
50185018
let ws = try workspace.getOrCreateWorkspace()
50195019
let pinsStore = try ws.pinsStore.load()
5020-
let fooPin = pinsStore.pins.values.first(where: { $0.packageRef.identity.description == "foo" })!
5020+
let fooPin = try XCTUnwrap(pinsStore.pins.values.first(where: { $0.packageRef.identity.description == "foo" }))
50215021

50225022
let fooRepo = workspace.repositoryProvider
50235023
.specifierMap[RepositorySpecifier(path: try AbsolutePath(

0 commit comments

Comments
 (0)