Skip to content

Commit 6c67f4e

Browse files
committed
Adjust incrementalCompilationCachingBasic to reproduce issue 88113
Need to not use load module interface to reproduce issue 88113 and add a note that it needs to be fixed with prefix mapping enabled.
1 parent 0823a82 commit 6c67f4e

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

Tests/SwiftDriverTests/Helpers/IncrementalTestHarness.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ final class IncrementalTestHarness {
157157
}
158158
}
159159

160-
init(config: TestBuildConfig = .implicitModule) throws {
160+
init(config: TestBuildConfig = .implicitModule, preferInterfaceModuleLoadMode: Bool = true) throws {
161161
self.config = config
162162

163163
guard let sdkArgs = try Driver.sdkArgumentsForTesting() else {
@@ -204,7 +204,7 @@ final class IncrementalTestHarness {
204204

205205
Thread.sleep(forTimeInterval: 1)
206206
let driver = try! Driver(args: ["swiftc"])
207-
if driver.isFrontendArgSupported(.moduleLoadMode) {
207+
if preferInterfaceModuleLoadMode && driver.isFrontendArgSupported(.moduleLoadMode) {
208208
self.extraExplicitBuildArgs = ["-Xfrontend", "-module-load-mode", "-Xfrontend", "prefer-interface"]
209209
}
210210
}

Tests/SwiftDriverTests/Helpers/TestBuildConfig.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ enum TestBuildConfig: CaseIterable, CustomStringConvertible, Sendable {
6565
available([.cachingBuild, .cachingPrefixMapped])
6666
}
6767

68+
/// Not prefix mapped caching build.
69+
static var cachingNonPrefixed: [TestBuildConfig] {
70+
available([.cachingBuild])
71+
}
72+
6873
/// Not prefix mapped explicit build.
6974
static var explicitNonPrefixed: [TestBuildConfig] {
7075
available([.explicitModule, .cachingBuild])

Tests/SwiftDriverTests/IncrementalExplicitBuildTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ struct IncrementalExplicitBuildTests: DiagVerifiable {
4242
try h.checkReactionToTouchingAll(checkDiagnostics: true)
4343
}
4444

45-
@Test(.serialized, arguments: TestBuildConfig.cachingConfigs)
45+
// FIXME: the cachingPrefixMapped config doesn't currently work (the issue 88113)
46+
@Test(.serialized, arguments: TestBuildConfig.cachingNonPrefixed)
4647
func incrementalCompilationCachingBasic(config: TestBuildConfig) async throws {
47-
let h = try IncrementalTestHarness(config: config)
48+
// Set preferInterfaceModuleLoadMode false to reproduce the issue 88113
49+
let h = try IncrementalTestHarness(config: config, preferInterfaceModuleLoadMode: false)
4850
try h.buildInitialState(checkDiagnostics: false)
4951
try h.touch("other")
5052
try h.doABuild(

0 commit comments

Comments
 (0)