From cff4351645f562537cf2befed92d9137d6df5e15 Mon Sep 17 00:00:00 2001 From: Nevena Kotlaja Date: Fri, 30 Jun 2023 16:51:57 +0200 Subject: [PATCH 1/2] Make grep_includes optional inside register_linkstamp_compile_action --- .../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..4a2361c0d98f4e 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, From 8ccc9da4a0954fe75a26a4c4021ecd000d4883a5 Mon Sep 17 00:00:00 2001 From: kotlaja Date: Fri, 30 Jun 2023 17:02:03 +0200 Subject: [PATCH 2/2] Update CcModule.java --- .../java/com/google/devtools/build/lib/rules/cpp/CcModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4a2361c0d98f4e..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 @@ -2633,7 +2633,7 @@ private static void validateExtensions( name = "grep_includes", documented = false, positional = false, - named = true + named = true, defaultValue = "None"), @Param(name = "source_file", documented = false, positional = false, named = true), @Param(name = "output_file", documented = false, positional = false, named = true),