Skip to content

Commit

Permalink
Enable C++ deps pruning on Windows when PARSE_SHOWINCLUDES is available.
Browse files Browse the repository at this point in the history
This fixes bazelbuild#14947.

Closes bazelbuild#17928.

PiperOrigin-RevId: 521446074
Change-Id: I4bc155f0245bc1933e86cd0b37762263437ed1fe
  • Loading branch information
Konstantin Erman authored and copybara-github committed Apr 3, 2023
1 parent aa2407f commit 788801a
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,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 @@ -361,7 +365,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 @@ -482,8 +486,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 788801a

Please sign in to comment.