Skip to content

Commit a3c2bb3

Browse files
committed
SwiftDriver: remove use of spm_chomp
This function was being imported through `TSCUtility`. Replace the 3 uses of the function with an alternative to allow us to cleave the dependency.
1 parent ab0ca9b commit a3c2bb3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Sources/SwiftDriver/Jobs/DarwinToolchain+LinkerSupport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extension DarwinToolchain {
2020
let result = try executor.checkNonZeroExit(
2121
args: "xcrun", "-toolchain", "default", "-f", "clang",
2222
environment: env
23-
).spm_chomp()
23+
).trimmingCharacters(in: .whitespacesAndNewlines)
2424

2525
return result.isEmpty ? nil : try AbsolutePath(validating: result)
2626
}

Sources/SwiftDriver/Toolchains/DarwinToolchain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public final class DarwinToolchain: Toolchain {
126126
let result = try executor.checkNonZeroExit(
127127
args: "xcrun", "-sdk", "macosx", "--show-sdk-path",
128128
environment: env
129-
).spm_chomp()
129+
).trimmingCharacters(in: .whitespacesAndNewlines)
130130
return try AbsolutePath(validating: result)
131131
}
132132

Sources/SwiftDriver/Toolchains/Toolchain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ extension Toolchain {
293293
let path = try executor.checkNonZeroExit(
294294
args: xcrun, "--find", executable,
295295
environment: env
296-
).spm_chomp()
296+
).trimmingCharacters(in: .whitespacesAndNewlines)
297297
return try AbsolutePath(validating: path)
298298
}
299299

0 commit comments

Comments
 (0)