Skip to content

Commit 788801a

Browse files
Konstantin Ermancopybara-github
Konstantin Erman
authored andcommitted
Enable C++ deps pruning on Windows when PARSE_SHOWINCLUDES is available.
This fixes #14947. Closes #17928. PiperOrigin-RevId: 521446074 Change-Id: I4bc155f0245bc1933e86cd0b37762263437ed1fe
1 parent aa2407f commit 788801a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ private ImmutableList<Artifact> getBuiltinIncludeFiles() {
346346
return result.build();
347347
}
348348

349+
private boolean shouldParseShowIncludes() {
350+
return featureConfiguration.isEnabled(CppRuleClasses.PARSE_SHOWINCLUDES);
351+
}
352+
349353
/**
350354
* Returns the list of mandatory inputs for the {@link CppCompileAction} as configured.
351355
*/
@@ -361,7 +365,7 @@ NestedSet<Artifact> buildMandatoryInputs() {
361365
if (grepIncludes != null) {
362366
realMandatoryInputsBuilder.add(grepIncludes);
363367
}
364-
if (!shouldScanIncludes && dotdFile == null) {
368+
if (!shouldScanIncludes && dotdFile == null && !shouldParseShowIncludes()) {
365369
realMandatoryInputsBuilder.addTransitive(ccCompilationContext.getDeclaredIncludeSrcs());
366370
realMandatoryInputsBuilder.addTransitive(additionalPrunableHeaders);
367371
}
@@ -482,8 +486,7 @@ public boolean useDotdFile(Artifact sourceFile) {
482486
}
483487

484488
public boolean dotdFilesEnabled() {
485-
return cppSemantics.needsDotdInputPruning(configuration)
486-
&& !featureConfiguration.isEnabled(CppRuleClasses.PARSE_SHOWINCLUDES);
489+
return cppSemantics.needsDotdInputPruning(configuration) && !shouldParseShowIncludes();
487490
}
488491

489492
public boolean serializedDiagnosticsFilesEnabled() {

0 commit comments

Comments
 (0)