Skip to content

[Dependency Scanning] Do not include PCH-handling command-line flags on the scanning jobs #841

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
Sep 20, 2021
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public extension Driver {
commandLine.appendFlag("-frontend")
commandLine.appendFlag("-scan-dependencies")
try addCommonFrontendOptions(commandLine: &commandLine, inputs: &inputs,
bridgingHeaderHandling: .precompiled,
bridgingHeaderHandling: .ignored,
moduleDependencyGraphUse: .dependencyScan)
// FIXME: MSVC runtime flags

Expand Down Expand Up @@ -224,7 +224,7 @@ public extension Driver {
commandLine.appendFlag("-scan-dependencies")
commandLine.appendFlag("-import-prescan")
try addCommonFrontendOptions(commandLine: &commandLine, inputs: &inputs,
bridgingHeaderHandling: .precompiled,
bridgingHeaderHandling: .ignored,
moduleDependencyGraphUse: .dependencyScan)
// FIXME: MSVC runtime flags

Expand Down Expand Up @@ -255,7 +255,7 @@ public extension Driver {
commandLine.appendFlag("-frontend")
commandLine.appendFlag("-scan-dependencies")
try addCommonFrontendOptions(commandLine: &commandLine, inputs: &inputs,
bridgingHeaderHandling: .precompiled,
bridgingHeaderHandling: .ignored,
moduleDependencyGraphUse: .dependencyScan)

let batchScanInputFilePath = try serializeBatchScanningModuleArtifacts(moduleInfos: moduleInfos)
Expand Down
4 changes: 4 additions & 0 deletions Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
var driver = try Driver(args: ["swiftc",
"-I", cHeadersPath,
"-I", swiftModuleInterfacesPath,
"-import-objc-header",
"-experimental-explicit-module-build",
"-working-directory", path.pathString,
"-disable-clang-target",
Expand All @@ -772,6 +773,9 @@ final class ExplicitModuleBuildTests: XCTestCase {
scannerCommand.removeFirst()
}

// Ensure we do not propagate the ususal PCH-handling arguments to the scanner invocation
XCTAssertFalse(scannerCommand.contains("-pch-output-dir"))

// Here purely to dump diagnostic output in a reasonable fashion when things go wrong.
let lock = NSLock()

Expand Down