Skip to content

Commit d03b98e

Browse files
authored
Merge pull request #1234 from artemcm/OnlyScanSwiftSources
[Dependency Scanning] Only specify Swift source-file inputs as inputs to the dependency scanning action.
2 parents 9fc9848 + ef039aa commit d03b98e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public extension Driver {
8383
}
8484

8585
// Pass on the input files
86-
commandLine.append(contentsOf: inputFiles.map { .path($0.file) })
86+
commandLine.append(contentsOf: inputFiles.filter { $0.type == .swift }.map { .path($0.file) })
8787
return (inputs, commandLine)
8888
}
8989

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
10321032
"-I", swiftModuleInterfacesPath.nativePathString(escaped: true),
10331033
"-I", stdlibPath.nativePathString(escaped: true),
10341034
"-I", shimsPath.nativePathString(escaped: true),
1035+
"/tmp/Foo.o",
10351036
"-import-objc-header",
10361037
"-explicit-module-build",
10371038
"-working-directory", path.nativePathString(escaped: true),
@@ -1049,6 +1050,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
10491050

10501051
// Ensure we do not propagate the usual PCH-handling arguments to the scanner invocation
10511052
XCTAssertFalse(scannerCommand.contains("-pch-output-dir"))
1053+
XCTAssertFalse(scannerCommand.contains("Foo.o"))
10521054

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

0 commit comments

Comments
 (0)