Skip to content

Commit f3bc3b7

Browse files
authored
Warn if specified --toolchain path doesn't exist (#7058)
The least we can do is issue a warning if a given path is non-existent.
1 parent 1de30cc commit f3bc3b7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sources/CoreCommands/SwiftTool.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,16 @@ public final class SwiftTool {
807807
swiftSDK.targetTriple = triple
808808
}
809809
if let binDir = options.build.customCompileToolchain {
810+
if !self.fileSystem.exists(binDir) {
811+
self.observabilityScope.emit(
812+
warning: """
813+
Toolchain directory specified through a command-line option doesn't exist and is ignored: `\(
814+
binDir
815+
)`
816+
"""
817+
)
818+
}
819+
810820
swiftSDK.add(toolsetRootPath: binDir.appending(components: "usr", "bin"))
811821
}
812822
if let sdk = options.build.customCompileSDK {

0 commit comments

Comments
 (0)