Skip to content

Commit

Permalink
Enable C++ deps pruning on Windows when PARSE_SHOWINCLUDES is availab…
Browse files Browse the repository at this point in the history
…le. (bazelbuild#17957)

This fixes bazelbuild#14947.

Closes bazelbuild#17928.

PiperOrigin-RevId: 521446074
Change-Id: I4bc155f0245bc1933e86cd0b37762263437ed1fe

Co-authored-by: Konstantin Erman <kerman@tableau.com>
  • Loading branch information
ShreeM01 and Konstantin Erman authored Apr 4, 2023
1 parent 2c1a63b commit d3b59ad
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ private ImmutableList<Artifact> getBuiltinIncludeFiles() {
return result.build();
}

private boolean shouldParseShowIncludes() {
return featureConfiguration.isEnabled(CppRuleClasses.PARSE_SHOWINCLUDES);
}

/**
* Returns the list of mandatory inputs for the {@link CppCompileAction} as configured.
*/
Expand All @@ -352,7 +356,7 @@ NestedSet<Artifact> buildMandatoryInputs() {
if (grepIncludes != null) {
realMandatoryInputsBuilder.add(grepIncludes);
}
if (!shouldScanIncludes && dotdFile == null) {
if (!shouldScanIncludes && dotdFile == null && !shouldParseShowIncludes()) {
realMandatoryInputsBuilder.addTransitive(ccCompilationContext.getDeclaredIncludeSrcs());
realMandatoryInputsBuilder.addTransitive(additionalPrunableHeaders);
}
Expand Down Expand Up @@ -473,8 +477,7 @@ public boolean useDotdFile(Artifact sourceFile) {
}

public boolean dotdFilesEnabled() {
return cppSemantics.needsDotdInputPruning(configuration)
&& !featureConfiguration.isEnabled(CppRuleClasses.PARSE_SHOWINCLUDES);
return cppSemantics.needsDotdInputPruning(configuration) && !shouldParseShowIncludes();
}

public boolean serializedDiagnosticsFilesEnabled() {
Expand Down

0 comments on commit d3b59ad

Please sign in to comment.