Skip to content

Commit 01d4294

Browse files
authored
Merge pull request #1649 from DougGregor/ignore-prebuilt-in-prebuilt
Ignore prebuilt module cache when building the prebuilt module cache
2 parents ab6d90f + dc26b11 commit 01d4294

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Sources/swift-build-sdk-interfaces/main.swift

+12
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,18 @@ do {
157157
try localFileSystem.createDirectory(mcpPath, recursive: true)
158158
}
159159
}
160+
161+
// When building modules for an SDK, ignore any existing prebuilt modules.
162+
// modules. Do so by passing an intentially-bad path for the prebuilt
163+
// module cache path that's derived from the output path (but not the same
164+
// as that path). This prohibits the frontend scanning job from adding the
165+
// default prebuilt module cache path, while ensuring that we find no
166+
// prebuilt modules during this scan.
167+
args.append("-Xfrontend")
168+
args.append("-prebuilt-module-cache-path")
169+
args.append("-Xfrontend")
170+
args.append(outputDir.appending(component: "__nonexistent__").pathString)
171+
160172
let baselineABIDir = try getArgumentAsPath("-baseline-abi-dir")
161173
var driver = try Driver(args: args,
162174
diagnosticsOutput: .engine(diagnosticsEngine),

0 commit comments

Comments
 (0)