Skip to content

Commit

Permalink
Disable header include validation via feature flag. Fixes #14346.
Browse files Browse the repository at this point in the history
  • Loading branch information
amberdixon committed Dec 8, 2021
1 parent b8bc284 commit 075867e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public class CppCompileAction extends AbstractAction implements IncludeScannable
this.executionInfo = executionInfo;
this.actionName = actionName;
this.featureConfiguration = featureConfiguration;
this.needsIncludeValidation = cppSemantics.needsIncludeValidation();
this.needsIncludeValidation = cppSemantics.needsIncludeValidation() && !cppConfiguration.disableCppIncludeValidation();
this.actionClassId = actionClassId;
this.builtInIncludeDirectories = builtInIncludeDirectories;
this.additionalInputs = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,10 @@ public boolean validateTopLevelHeaderInclusions() {
return cppOptions.validateTopLevelHeaderInclusions;
}

public boolean disableCppIncludeValidation() {
return cppOptions.disableCppIncludeValidation;
}

public boolean appleGenerateDsym() {
return appleGenerateDsym;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,16 @@ public String getTypeDescription() {
+ " position-independent executables (\"-pie\").")
public boolean forcePic;

@Option(
name = "disable_cpp_include_validation",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.INPUT_STRICTNESS,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE},
help =
"If true, Bazel will not validate inclusions.")
public boolean disableCppIncludeValidation;

@Option(
name = "process_headers_in_dependencies",
defaultValue = "false",
Expand Down

0 comments on commit 075867e

Please sign in to comment.