File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Sources/swift-build-sdk-interfaces Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,19 @@ do {
169169 args. append ( " -Xfrontend " )
170170 args. append ( outputDir. appending ( component: " __nonexistent__ " ) . pathString)
171171
172+ // If the compiler/scanner supports it, instruct it to ignore any existing prebuilt
173+ // modules for which a textual interface is discovered, ensuring that modules
174+ // always build from interface when one is available.
175+ if let supportedFlagsTestDriver = try ? Driver ( args: [ " swiftc " , " -v " ] ,
176+ executor: executor,
177+ compilerExecutableDir: swiftcPath. parentDirectory) ,
178+ supportedFlagsTestDriver. isFrontendArgSupported ( . moduleLoadMode) {
179+ args. append ( " -Xfrontend " )
180+ args. append ( " -module-load-mode " )
181+ args. append ( " -Xfrontend " )
182+ args. append ( " only-interface " )
183+ }
184+
172185 let baselineABIDir = try getArgumentAsPath ( " -baseline-abi-dir " )
173186 var driver = try Driver ( args: args,
174187 diagnosticsOutput: . engine( diagnosticsEngine) ,
You can’t perform that action at this time.
0 commit comments