From 5bb3c8af23f5767bce1b8bb0aaef31655308e520 Mon Sep 17 00:00:00 2001 From: Artem Chikin Date: Mon, 16 Aug 2021 11:28:57 -0700 Subject: [PATCH] Fix `guard let sdkPath = sdkPath` pattern for compatiblity with older compilers Introduced in https://github.com/apple/swift-driver/pull/796, this passed CI because swift-driver CI uses a recent compiler. This broke SwiftPM CI because it uses a 5.3 compiler which contains a bug which makes such patterns fail to build. --- Sources/swift-build-sdk-interfaces/main.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/swift-build-sdk-interfaces/main.swift b/Sources/swift-build-sdk-interfaces/main.swift index a3b19cbaf..b67d885a5 100644 --- a/Sources/swift-build-sdk-interfaces/main.swift +++ b/Sources/swift-build-sdk-interfaces/main.swift @@ -53,8 +53,8 @@ let verbose = CommandLine.arguments.contains("-v") let skipExecution = CommandLine.arguments.contains("-n") do { - let sdkPath = try getArgumentAsPath("-sdk", "SDKROOT") - guard let sdkPath = sdkPath else { + let sdkPathArg = try getArgumentAsPath("-sdk", "SDKROOT") + guard let sdkPath = sdkPathArg else { diagnosticsEngine.emit(.error("need to set SDKROOT")) exit(1) }