From 56882d598ae2741d87733dda5aca0eb395563989 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 27 Sep 2024 05:11:55 -0700 Subject: [PATCH] Stop exporting unused java builtins to native `BootClassPathInfo.create` was unused after the android rules deletion. PiperOrigin-RevId: 679546563 Change-Id: I3e8f56c4f808c9cb6d53685fc297dc9d95ff630d --- .../lib/rules/java/BootClassPathInfo.java | 29 ------------------- .../starlark/builtins_bzl/common/exports.bzl | 3 -- 2 files changed, 32 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/BootClassPathInfo.java b/src/main/java/com/google/devtools/build/lib/rules/java/BootClassPathInfo.java index 03d1cdda72255c..af9a0cb5ca4461 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/BootClassPathInfo.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/BootClassPathInfo.java @@ -15,12 +15,8 @@ import static com.google.devtools.build.lib.skyframe.BzlLoadValue.keyForBuiltins; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import com.google.devtools.build.lib.actions.Artifact; -import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.cmdline.Label; -import com.google.devtools.build.lib.collect.nestedset.Depset; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.collect.nestedset.Order; @@ -29,12 +25,10 @@ import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException; import com.google.devtools.build.lib.packages.StarlarkInfo; import com.google.devtools.build.lib.packages.StarlarkInfoWithSchema; -import com.google.devtools.build.lib.packages.StarlarkProvider; import com.google.devtools.build.lib.packages.StarlarkProviderWrapper; import com.google.devtools.build.lib.packages.StructImpl; import com.google.devtools.build.lib.vfs.PathFragment; import java.util.Optional; -import net.starlark.java.eval.EvalException; import net.starlark.java.eval.Starlark; /** Information about the system APIs for a Java compilation. */ @@ -76,29 +70,6 @@ public static BootClassPathInfo empty() { return EMPTY; } - public static BootClassPathInfo create(RuleContext ruleContext, NestedSet bootclasspath) - throws RuleErrorException, InterruptedException { - if (bootclasspath.isEmpty()) { - return empty(); - } - ruleContext.initStarlarkRuleContext(); - StructImpl javaCommon = (StructImpl) ruleContext.getStarlarkDefinedBuiltin("java_common"); - try { - StarlarkProvider starlarkProvider = - javaCommon.getValue("BootClassPathInfo", StarlarkProvider.class); - StarlarkInfo starlarkBootClassPathInfo = - (StarlarkInfo) - Starlark.call( - ruleContext.getStarlarkThread(), - starlarkProvider.createRawConstructor(), - ImmutableList.of(), - ImmutableMap.of("bootclasspath", Depset.of(Artifact.class, bootclasspath))); - return PROVIDER.wrap(starlarkBootClassPathInfo); - } catch (EvalException e) { - throw new RuleErrorException(e); - } - } - private BootClassPathInfo(StructImpl underlying) { super(underlying); } diff --git a/src/main/starlark/builtins_bzl/common/exports.bzl b/src/main/starlark/builtins_bzl/common/exports.bzl index e72cd06f3d8bbf..7bb6bee0856dc3 100755 --- a/src/main/starlark/builtins_bzl/common/exports.bzl +++ b/src/main/starlark/builtins_bzl/common/exports.bzl @@ -43,7 +43,6 @@ load(":common/cc/fdo/fdo_prefetch_hints.bzl", "fdo_prefetch_hints") load(":common/cc/fdo/fdo_profile.bzl", "fdo_profile") load(":common/cc/fdo/memprof_profile.bzl", "memprof_profile") load(":common/cc/fdo/propeller_optimize.bzl", "propeller_optimize") -load(":common/java/java_binary_deploy_jar.bzl", get_java_build_info = "get_build_info") load(":common/java/java_common.bzl", "java_common") load(":common/java/java_info.bzl", "JavaInfo", "JavaPluginInfo") load(":common/objc/apple_common.bzl", "apple_common") @@ -104,7 +103,5 @@ exported_to_java = { "j2objc_mapping_file_info_union": objc_common.j2objc_mapping_file_info_union, "j2objc_entry_class_info_union": objc_common.j2objc_entry_class_info_union, "init_cc_compilation_context": cc_compilation_helper.init_cc_compilation_context, - "java_common": java_common, - "get_build_info": get_java_build_info, "get_toolchain_global_make_variables": cc_helper.get_toolchain_global_make_variables, }