Skip to content

Commit abb7902

Browse files
committed
SwiftDriver: speculative changes to support Windows macros
The test suite is currently entirely broken on Windows (awaiting @cachemeifyoucan to fix swiftlang#1431). This speculatively changes the driver to alter the search paths to match swiftlang/swift#68322).
1 parent e7b2840 commit abb7902

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Sources/SwiftDriver/Toolchains/DarwinToolchain.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,21 @@ extension VirtualPath {
482482
// Given a virtual path pointing into a toolchain/SDK/platform, produce the
483483
// path to `swift-plugin-server`.
484484
fileprivate var pluginServerPath: VirtualPath {
485+
#if os(Windows)
486+
self.appending(components: "bin", "swift-plugin-server.exe")
487+
#else
485488
self.appending(components: "bin", "swift-plugin-server")
489+
#endif
486490
}
487491

488492
// Given a virtual path pointing into a toolchain/SDK/platform, produce the
489493
// path to the plugins.
490494
var pluginPath: VirtualPath {
495+
#if os(Windows)
496+
self.appending(components: "bin")
497+
#else
491498
self.appending(components: "lib", "swift", "host", "plugins")
499+
#endif
492500
}
493501

494502
// Given a virtual path pointing into a toolchain/SDK/platform, produce the

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6849,8 +6849,12 @@ final class SwiftDriverTests: XCTestCase {
68496849
#endif
68506850

68516851
XCTAssertTrue(job.commandLine.contains(.flag("-plugin-path")))
6852+
#if os(Windows)
6853+
XCTAssertTrue(job.commandLine.contains(.path(.absolute(try driver.toolchain.executableDir.parentDirectory.appending(components: "bin")))))
6854+
#else
68526855
XCTAssertTrue(job.commandLine.contains(.path(.absolute(try driver.toolchain.executableDir.parentDirectory.appending(components: "lib", "swift", "host", "plugins")))))
68536856
XCTAssertTrue(job.commandLine.contains(.path(.absolute(try driver.toolchain.executableDir.parentDirectory.appending(components: "local", "lib", "swift", "host", "plugins")))))
6857+
#endif
68546858
}
68556859

68566860
func testClangModuleValidateOnce() throws {

0 commit comments

Comments
 (0)