From 12b655b582c0d4eee5d7f62da62957336557cd96 Mon Sep 17 00:00:00 2001 From: djasper Date: Mon, 30 Nov 2020 23:39:09 -0800 Subject: [PATCH] Don't add discovered headers to an action's inputs. We already have a scheduling dependency through a middleman and are still returning them from discoverInputs() to properly declare Skyframe deps for invalidation. Without this change, the current attempt to clearAdditionalInputs() is not helpful as a reference to the created list of additional inputs is retained. PiperOrigin-RevId: 344960874 --- .../devtools/build/lib/rules/cpp/CppCompileAction.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java index 9fec2e5bc38438..87da5e139040a7 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java @@ -583,13 +583,10 @@ public NestedSet discoverInputs(ActionExecutionContext actionExecution } topLevelModules = topLevelModulesBuilder.build(); discoveredModulesBuilder.addTransitive(topLevelModules); - NestedSet discoveredModules = discoveredModulesBuilder.buildInterruptibly(); + discoveredModules = discoveredModulesBuilder.buildInterruptibly(); additionalInputs = NestedSetBuilder.fromNestedSet(additionalInputs).addTransitive(discoveredModules).build(); - if (outputFile.isFileType(CppFileTypes.CPP_MODULE)) { - this.discoveredModules = discoveredModules; - } usedModules = null; return additionalInputs; } @@ -1381,7 +1378,10 @@ public ActionContinuationOrResult beginExecution(ActionExecutionContext actionEx } if (shouldScanIncludes) { - updateActionInputs(additionalInputs); + updateActionInputs(discoveredModules); + } + if (!outputFile.isFileType(CppFileTypes.CPP_MODULE)) { + this.discoveredModules = null; } ActionExecutionContext spawnContext;