Skip to content

Commit

Permalink
Properly return separate module as an allowed derived input. Otherwis…
Browse files Browse the repository at this point in the history
…e, the

action cache does not properly understand these inputs.

RELNOTES: None.
PiperOrigin-RevId: 359729150
  • Loading branch information
djasper authored and copybara-github committed Feb 26, 2021
1 parent 073ae81 commit 2f00d4f
Showing 1 changed file with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1217,13 +1217,21 @@ public CcToolchainVariables getOverwrittenVariables() {

@Override
public NestedSet<Artifact> getAllowedDerivedInputs() {
return NestedSetBuilder.fromNestedSet(mandatoryInputs)
.addTransitive(additionalPrunableHeaders)
.addTransitive(inputsForInvalidation)
.addTransitive(getDeclaredIncludeSrcs())
.addTransitive(ccCompilationContext.getTransitiveModules(usePic))
.add(getSourceFile())
.build();
NestedSetBuilder<Artifact> builder =
NestedSetBuilder.fromNestedSet(mandatoryInputs)
.addTransitive(additionalPrunableHeaders)
.addTransitive(inputsForInvalidation)
.addTransitive(getDeclaredIncludeSrcs())
.addTransitive(ccCompilationContext.getTransitiveModules(usePic))
.add(getSourceFile());

// The separate module is an allowed input to all compiles of this context except for its own
// compile.
Artifact separateModule = ccCompilationContext.getSeparateHeaderModule(usePic);
if (separateModule != null && !separateModule.equals(outputFile)) {
builder.add(separateModule);
}
return builder.build();
}

/**
Expand Down

0 comments on commit 2f00d4f

Please sign in to comment.