From e0dcb24db172384318d194c38a724ce3f1c01d4a Mon Sep 17 00:00:00 2001 From: kotlaja Date: Fri, 30 Jun 2023 22:17:19 +0200 Subject: [PATCH] Make grep_includes optional inside cc_common.register_linkstamp_compile_action (#18823) * Make grep_includes optional inside register_linkstamp_compile_action * Update CcModule.java --- .../google/devtools/build/lib/rules/cpp/CcModule.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcModule.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcModule.java index 6e959e14cc01be..5065e3169627bf 100755 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcModule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcModule.java @@ -2629,7 +2629,12 @@ private static void validateExtensions( doc = "feature_configuration to be queried.", positional = false, named = true), - @Param(name = "grep_includes", documented = false, positional = false, named = true), + @Param( + name = "grep_includes", + documented = false, + positional = false, + named = true, + defaultValue = "None"), @Param(name = "source_file", documented = false, positional = false, named = true), @Param(name = "output_file", documented = false, positional = false, named = true), @Param(name = "compilation_inputs", documented = false, positional = false, named = true), @@ -2645,7 +2650,7 @@ public void registerLinkstampCompileAction( StarlarkActionFactory starlarkActionFactoryApi, CcToolchainProvider ccToolchain, FeatureConfigurationForStarlark featureConfigurationForStarlark, - Artifact grepIncludes, + Object grepIncludes, Artifact sourceFile, Artifact outputFile, Depset compilationInputs, @@ -2664,7 +2669,7 @@ public void registerLinkstampCompileAction( CppLinkstampCompileHelper.createLinkstampCompileAction( ruleContext, ruleContext, - grepIncludes, + convertFromNoneable(grepIncludes, /* defaultValue= */ null), ruleContext.getConfiguration(), sourceFile, outputFile,