Skip to content

[6.0 🍒][PrebuiltModuleGen] Ensure the dependency scanner always ignores existing prebuilt modules #1652

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
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
13 changes: 13 additions & 0 deletions Sources/swift-build-sdk-interfaces/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,19 @@ do {
args.append("-Xfrontend")
args.append(outputDir.appending(component: "__nonexistent__").pathString)

// If the compiler/scanner supports it, instruct it to ignore any existing prebuilt
// modules for which a textual interface is discovered, ensuring that modules
// always build from interface when one is available.
if let supportedFlagsTestDriver = try? Driver(args: ["swiftc", "-v"],
executor: executor,
compilerExecutableDir: swiftcPath.parentDirectory),
supportedFlagsTestDriver.isFrontendArgSupported(.moduleLoadMode) {
args.append("-Xfrontend")
args.append("-module-load-mode")
args.append("-Xfrontend")
args.append("only-interface")
}

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