Skip to content

Commit 20c26c2

Browse files
committed
[Platform paths for Darwin macros] Don't escape paths
1 parent 1b17f33 commit 20c26c2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/SwiftDriver/Toolchains/DarwinToolchain.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,10 @@ public final class DarwinToolchain: Toolchain {
429429
// that SDK's plugin server).
430430
let sdkPathRoot = VirtualPath.lookup(sdkPath).appending(components: "usr")
431431
commandLine.appendFlag(.externalPluginPath)
432-
commandLine.appendFlag("\(sdkPathRoot.pluginPath.name)#\(sdkPathRoot.pluginServerPath.name.spm_shellEscaped())")
432+
commandLine.appendFlag("\(sdkPathRoot.pluginPath.name)#\(sdkPathRoot.pluginServerPath.name)")
433433

434434
commandLine.appendFlag(.externalPluginPath)
435-
commandLine.appendFlag("\(sdkPathRoot.localPluginPath.name)#\(sdkPathRoot.pluginServerPath.name.spm_shellEscaped())")
435+
commandLine.appendFlag("\(sdkPathRoot.localPluginPath.name)#\(sdkPathRoot.pluginServerPath.name)")
436436

437437
// Determine the platform path. For simulator platforms, look into the
438438
// corresponding device platform instance.
@@ -452,10 +452,10 @@ public final class DarwinToolchain: Toolchain {
452452
// platform's plugin server).
453453
let platformPathRoot = platformPath.appending(components: "Developer", "usr")
454454
commandLine.appendFlag(.externalPluginPath)
455-
commandLine.appendFlag("\(platformPathRoot.pluginPath.name)#\(platformPathRoot.pluginServerPath.name.spm_shellEscaped())")
455+
commandLine.appendFlag("\(platformPathRoot.pluginPath.name)#\(platformPathRoot.pluginServerPath.name)")
456456

457457
commandLine.appendFlag(.externalPluginPath)
458-
commandLine.appendFlag("\(platformPathRoot.localPluginPath.name)#\(platformPathRoot.pluginServerPath.name.spm_shellEscaped())")
458+
commandLine.appendFlag("\(platformPathRoot.localPluginPath.name)#\(platformPathRoot.pluginServerPath.name)")
459459
}
460460
}
461461
}

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6876,7 +6876,7 @@ final class SwiftDriverTests: XCTestCase {
68766876
func pluginPathTest(platform: String, searchPlatform: String) throws {
68776877
let sdkRoot = testInputsPath.appending(
68786878
components: ["PlatformChecks", "\(platform).platform", "Developer", "SDKs", "\(platform).sdk"])
6879-
var driver = try Driver(args: ["swiftc", "-typecheck", "foo.swift", "-sdk", VirtualPath.absolute(sdkRoot).name, "-plugin-path", "PluginA", "-external-plugin-path", "PluginB#Bexe", "-load-plugin-library", "PluginB2", "-plugin-path", "PluginC"])
6879+
var driver = try Driver(args: ["swiftc", "-typecheck", "foo.swift", "-sdk", VirtualPath.absolute(sdkRoot).name, "-plugin-path", "PluginA", "-external-plugin-path", "Plugin~B#Bexe", "-load-plugin-library", "PluginB2", "-plugin-path", "PluginC"])
68806880
guard driver.isFrontendArgSupported(.pluginPath) && driver.isFrontendArgSupported(.externalPluginPath) else {
68816881
return
68826882
}
@@ -6889,7 +6889,7 @@ final class SwiftDriverTests: XCTestCase {
68896889
let pluginAIndex = job.commandLine.firstIndex(of: .path(VirtualPath.relative(.init("PluginA"))))
68906890
XCTAssertNotNil(pluginAIndex)
68916891

6892-
let pluginBIndex = job.commandLine.firstIndex(of: .path(VirtualPath.relative(.init("PluginB#Bexe"))))
6892+
let pluginBIndex = job.commandLine.firstIndex(of: .path(VirtualPath.relative(.init("Plugin~B#Bexe"))))
68936893
XCTAssertNotNil(pluginBIndex)
68946894
XCTAssertLessThan(pluginAIndex!, pluginBIndex!)
68956895

0 commit comments

Comments
 (0)