Skip to content

Ignore prebuilt module cache when building the prebuilt module cache #1649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Sources/swift-build-sdk-interfaces/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ do {
try localFileSystem.createDirectory(mcpPath, recursive: true)
}
}

// When building modules for an SDK, ignore any existing prebuilt modules.
// modules. Do so by passing an intentially-bad path for the prebuilt
// module cache path that's derived from the output path (but not the same
// as that path). This prohibits the frontend scanning job from adding the
// default prebuilt module cache path, while ensuring that we find no
// prebuilt modules during this scan.
args.append("-Xfrontend")
args.append("-prebuilt-module-cache-path")
args.append("-Xfrontend")
args.append(outputDir.appending(component: "__nonexistent__").pathString)

let baselineABIDir = try getArgumentAsPath("-baseline-abi-dir")
var driver = try Driver(args: args,
diagnosticsOutput: .engine(diagnosticsEngine),
Expand Down