From 4df2949c07a15bc7ff0dd4df5d7cc2b1a8501a91 Mon Sep 17 00:00:00 2001 From: WeijunDeng Date: Tue, 14 Oct 2025 16:28:03 +0800 Subject: [PATCH] [Incremental Builds]When a file changed, do not affect nodes that have a fingerprint and have not changed. --- .../ModuleDependencyGraphParts/Tracer.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraphParts/Tracer.swift b/Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraphParts/Tracer.swift index 6bd8fc8f9..8d91c139c 100644 --- a/Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraphParts/Tracer.swift +++ b/Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraphParts/Tracer.swift @@ -86,6 +86,15 @@ extension ModuleDependencyGraph.Tracer { // If this use also provides something, follow it for use in graph.nodeFinder.uses(of: definition) { + if (definition.key.aspect == .interface) { + // .swift or .swiftmodule + if case .sourceFileProvide(name: _) = definition.key.designator { + if use.keyAndFingerprint.fingerprint != nil { + // When a file changed, do not affect nodes that have a fingerprint and have not changed. + continue + } + } + } collectNextPreviouslyUntracedDependent(of: use) } traceDeparture(pathLengthAfterArrival);