Skip to content

Commit e78566f

Browse files
committed
PackageModel: support the unified swift modules for XCTest
`XCTest` accidentally did not use the directory form of the swiftmodule, which did not matter with a single architecture being available. Migrate to the directory form to match the SDK setup. With the SDK migrating to the architecture independent directory for the modules, follow suit and provide a compatibility path that will allow use of either.
1 parent f9f74f1 commit e78566f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sources/PackageModel/UserToolchain.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,16 @@ public final class UserToolchain: Toolchain {
261261
.appending(component: "XCTest-\(info.defaults.xctestVersion)")
262262

263263
xctest = [
264+
"-I", AbsolutePath("usr/lib/swift/windows", relativeTo: installation).pathString,
265+
// Migration Path
266+
//
267+
// Older Swift (<=5.7) installations placed the
268+
// XCTest Swift module into the architecture
269+
// specified directory. This was in order to match
270+
// the SDK setup. However, the toolchain finally
271+
// gained the ability to consult the architecture
272+
// indepndent directory for Swift modules, allowing
273+
// the merged swiftmodules. XCTest followed suit.
264274
"-I", AbsolutePath("usr/lib/swift/windows/\(triple.arch)", relativeTo: installation).pathString,
265275
"-L", AbsolutePath("usr/lib/swift/windows/\(triple.arch)", relativeTo: installation).pathString,
266276
]

0 commit comments

Comments
 (0)