Remove redundant init_make_variables method, since variable expansion is implicitly done in common.copts and common.linkopts.
PiperOrigin-RevId: 435004405
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcStarlarkInternal.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcStarlarkInternal.java
index e8911ac..34d3e79 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcStarlarkInternal.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcStarlarkInternal.java
@@ -15,12 +15,9 @@
package com.google.devtools.build.lib.rules.cpp;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.docgen.annot.DocCategory;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.CommandLineExpansionException;
-import com.google.devtools.build.lib.analysis.MakeVariableSupplier.MapBackedMakeVariableSupplier;
-import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.starlark.StarlarkActionFactory;
import com.google.devtools.build.lib.analysis.starlark.StarlarkRuleContext;
import com.google.devtools.build.lib.cmdline.Label;
@@ -29,7 +26,6 @@
import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException;
import com.google.devtools.build.lib.packages.Type;
import com.google.devtools.build.lib.rules.cpp.CcBinary.CcLauncherInfo;
-import com.google.devtools.build.lib.rules.cpp.CcCommon.CcFlagsSupplier;
import com.google.devtools.build.lib.rules.cpp.CcLinkingContext.Linkstamp;
import com.google.devtools.build.lib.starlarkbuildapi.FileApi;
import com.google.devtools.build.lib.starlarkbuildapi.NativeComputedDefaultApi;
@@ -118,23 +114,6 @@
}
@StarlarkMethod(
- name = "init_make_variables",
- documented = false,
- parameters = {
- @Param(name = "ctx", positional = false, named = true),
- @Param(name = "cc_toolchain", positional = false, named = true),
- })
- public void initMakeVariables(
- StarlarkRuleContext starlarkRuleContext, CcToolchainProvider ccToolchain) {
- ImmutableMap.Builder<String, String> toolchainMakeVariables = ImmutableMap.builder();
- ccToolchain.addGlobalMakeVariables(toolchainMakeVariables);
- RuleContext ruleContext = starlarkRuleContext.getRuleContext();
- ruleContext.initConfigurationMakeVariableContext(
- new MapBackedMakeVariableSupplier(toolchainMakeVariables.buildOrThrow()),
- new CcFlagsSupplier(starlarkRuleContext.getRuleContext()));
- }
-
- @StarlarkMethod(
name = "get_build_info",
documented = false,
parameters = {@Param(name = "ctx")})
diff --git a/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl b/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl
index 06feb98..4c1126b 100755
--- a/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl
+++ b/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl
@@ -29,7 +29,6 @@
cc_toolchain = common.toolchain
- cc_internal.init_make_variables(ctx = ctx, cc_toolchain = cc_toolchain)
feature_configuration = cc_common.configure_features(
ctx = ctx,
cc_toolchain = cc_toolchain,