diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java index c876299fed39b9..3deb37b52aa358 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java @@ -720,15 +720,17 @@ public NestedSet getPossibleInputsForTesting() { * * @param spawnResult the executor action that created the possibly stripped .jdeps output * @param outputDepsProto path to the .jdeps output - * @param artifactsToPathMap all inputs to the current action plus any additional artifacts that - * may be referenced in the .jdeps file by path + * @param actionInputs all inputs to the current action + * @param additionalArtifactsForPathMapping any additional artifacts that may be referenced in the + * .jdeps file by path * @param actionExecutionContext the action execution context * @return the full deps proto (also written to disk to satisfy the action's declared output) */ static Deps.Dependencies createFullOutputDeps( SpawnResult spawnResult, Artifact outputDepsProto, - Iterable artifactsToPathMap, + NestedSet actionInputs, + NestedSet additionalArtifactsForPathMapping, ActionExecutionContext actionExecutionContext, PathMapper pathMapper) throws IOException { @@ -747,7 +749,8 @@ static Deps.Dependencies createFullOutputDeps( // For each of the action's generated inputs, revert its mapped path back to its original path. BiMap mappedToOriginalPath = HashBiMap.create(); - for (Artifact actionInput : artifactsToPathMap) { + for (Artifact actionInput : + Iterables.concat(actionInputs.toList(), additionalArtifactsForPathMapping.toList())) { if (actionInput.isSourceArtifact()) { continue; } @@ -831,7 +834,12 @@ private Deps.Dependencies readFullOutputDeps( SpawnResult result = Iterables.getOnlyElement(results); try { return createFullOutputDeps( - result, outputDepsProto, getInputs().toList(), actionExecutionContext, pathMapper); + result, + outputDepsProto, + getInputs(), + getAdditionalArtifactsForPathMapping(), + actionExecutionContext, + pathMapper); } catch (IOException e) { throw ActionExecutionException.fromExecException( new EnvironmentalExecException( diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java index d3e0d80e5c31b2..a3a6b62e2542da 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java @@ -124,8 +124,8 @@ protected void afterExecute( JavaCompileAction.createFullOutputDeps( spawnResult, outputDepsProto, - Iterables.concat( - getInputs().toList(), getAdditionalArtifactsForPathMapping().toList()), + getInputs(), + getAdditionalArtifactsForPathMapping(), context, pathMapper); JavaCompileActionContext javaContext = context.getContext(JavaCompileActionContext.class);