Skip to content

Commit fb3bbb7

Browse files
committed
[Incremental Builds][Explicit Module Builds] Treat Binary-only Swift module dependencies as up-to-date
Instead of conservatively assuming them to be new/updated in order to invalidate their dependents. This behavior is no longer necessary since the implementation of swiftlang#1628 (adce133) which will ensure that if a binary module dependnecy is newer than any of its dependents they will get invalidated and re-built.
1 parent dafcec6 commit fb3bbb7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Sources/SwiftDriver/ExplicitModuleBuilds/InterModuleDependencies/CommonDependencyOperations.swift

+7-6
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ internal extension InterModuleDependencyGraph {
367367
}
368368
}
369369

370-
// Check if any of the textual sources of this module are newer than this module
370+
// Check if any of the input sources of this module are newer than this module
371371
switch checkedModuleInfo.details {
372372
case .swift(let swiftDetails):
373373
if let moduleInterfacePath = swiftDetails.moduleInterfacePath {
@@ -400,11 +400,12 @@ internal extension InterModuleDependencyGraph {
400400
}
401401
}
402402
case .swiftPrebuiltExternal(_):
403-
// TODO: We have to give-up here until we have a way to verify the timestamp of the binary module.
404-
// We can do better here by knowing if this module hasn't changed - which would allows us to not
405-
// invalidate any of the dependencies that depend on it.
406-
reporter?.report("Unable to verify binary module dependency up-to-date: \(moduleID.moduleNameForDiagnostic)")
407-
return false;
403+
// We do not verify the binary module itself being out-of-date if we do not have a textual
404+
// interface it was built from, but we can safely treat it as up-to-date, particularly
405+
// because if it is newer than any of the modules they depend on it, they will
406+
// still get invalidated in the check above for whether a module has
407+
// any dependencies newer than it.
408+
return true;
408409
case .swiftPlaceholder(_):
409410
// TODO: This should never ever happen. Hard error?
410411
return false;

0 commit comments

Comments
 (0)