Fix headers checking mode for cc_common.compile
Looks like Bazel should always use STRICT headersCheckingMode.
cc_binary & cc_library get this mode from semantic, but for cc_common.compile LOOSE mode used as a default value in CcCompilationHelper.
It leads to extra looseIncludeDirs and some headers checking are missed.
Closes
@@ -1758,7 +1758,9 @@ public abstract class CcModule
.addAdditionalCompilationInputs(
Sequence.cast(additionalInputs, Artifact.class, "additional_inputs"))
.addAditionalIncludeScanningRoots(headersForClifDoNotUseThisParam)
- .setPurpose(common.getPurpose(getSemantics()));
+ .setPurpose(common.getPurpose(getSemantics()))
+ .setHeadersCheckingMode(
+ getSemantics().determineHeadersCheckingMode(actions.getRuleContext()));
if (disallowNopicOutputs) {
helper.setGenerateNoPicAction(false);
}
