@@ -30,7 +30,17 @@ import Dispatch
3030/// An abstraction of a cache and query-engine of inter-module dependencies
3131public class InterModuleDependencyOracle {
3232 /// Allow external clients to instantiate the oracle
33- public init ( ) { }
33+ /// - Parameter scannerRequiresPlaceholderModules: Configures this driver's/oracle's scanner invocations to
34+ /// specify external module dependencies to be treated as placeholders. This is required in contexts
35+ /// where the dependency scanning action is invoked for a module which depends on another module
36+ /// that is part of the same build but has not yet been built. Treating it as a placeholder
37+ /// will allow the scanning action to not fail when it fails to detect this dependency on
38+ /// the filesystem. For example, SwiftPM plans all targets belonging to a package before *any* of them
39+ /// are built. So this setting is meant to be used there. In contexts where planning a module
40+ /// necessarily means all of its dependencies have already been built this is not necessary.
41+ public init ( scannerRequiresPlaceholderModules: Bool = false ) {
42+ self . scannerRequiresPlaceholderModules = scannerRequiresPlaceholderModules
43+ }
3444
3545 @_spi ( Testing) public func getDependencies( workingDirectory: AbsolutePath ,
3646 moduleAliases: [ String : String ] ? = nil ,
@@ -145,5 +155,7 @@ public class InterModuleDependencyOracle {
145155
146156 /// A reference to an instance of the compiler's libSwiftScan shared library
147157 private var swiftScanLibInstance : SwiftScan ? = nil
158+
159+ internal let scannerRequiresPlaceholderModules : Bool
148160}
149161
0 commit comments