diff --git a/WORKSPACE b/WORKSPACE index d68457ac913bec..945bf2760e4bcc 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -387,14 +387,6 @@ dist_http_archive( name = "build_bazel_rules_nodejs", ) -http_archive( - name = "java_tools_langtools_javac11", - sha256 = "cf0814fa002ef3d794582bb086516d8c9ed0958f83f19799cdb08949019fe4c7", - urls = [ - "https://mirror.bazel.build/bazel_java_tools/jdk_langtools/langtools_jdk11_v2.zip", - ], -) - dist_http_archive( name = "platforms", ) @@ -666,4 +658,3 @@ debian_deps() load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") bazel_skylib_workspace() - diff --git a/scripts/packages/debian/copyright b/scripts/packages/debian/copyright index 25981ab8c9be25..7f6ab842ae118e 100644 --- a/scripts/packages/debian/copyright +++ b/scripts/packages/debian/copyright @@ -25,7 +25,6 @@ License: Eclipse Distribution License 1.0 License: Eclipse Public License License: Eclipse Public License Version 1.0 License: GNU GPL v2 with Classpath exception -License: GNU GPL v2 with Classpath exception (plus other licenses, see third_party/java/jdk/langtools/LICENSE file). License: GNU GPL v2 with Classpath exception, portions MIT License: MIT License: MIT license diff --git a/src/BUILD b/src/BUILD index 18df981315f2ff..764ea1b679ff06 100644 --- a/src/BUILD +++ b/src/BUILD @@ -528,7 +528,6 @@ genrule( "//third_party/ijar:transitive_sources", "//third_party/java/jacoco:transitive_sources", "//third_party/java/proguard:srcs", - "@java_tools_langtools_javac11//:srcs", ], outs = ["java_tools_dist.zip"], cmd = "zip -qXr $@ $$(echo $(SRCS) | sort)", @@ -548,9 +547,7 @@ JAVA_TOOLS_DEPLOY_JARS = [ release_archive( name = "jars_java_tools_zip", - srcs = JAVA_TOOLS_DEPLOY_JARS + [ - "@java_tools_langtools_javac11//:javac_jar", - ], + srcs = JAVA_TOOLS_DEPLOY_JARS, package_dir = "java_tools", visibility = ["//visibility:private"], ) diff --git a/src/create_embedded_tools.py b/src/create_embedded_tools.py index 785e14b80a556d..9574e6e781031e 100644 --- a/src/create_embedded_tools.py +++ b/src/create_embedded_tools.py @@ -37,7 +37,6 @@ ('*tools/cpp/BUILD.tools', lambda x: 'tools/cpp/BUILD'), ('*tools/cpp/runfiles/generated_*', lambda x: 'tools/cpp/runfiles/' + os.path.basename(x)[len('generated_'):]), - ('*BUILD.java_langtools', lambda x: 'third_party/java/jdk/langtools/BUILD'), ('*launcher.exe', lambda x: 'tools/launcher/launcher.exe'), ('*def_parser.exe', lambda x: 'tools/def_parser/def_parser.exe'), ('*zipper.exe', lambda x: 'tools/zip/zipper/zipper.exe'), diff --git a/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java b/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java index 503c47cb47b139..19a0709cce543a 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java @@ -184,7 +184,6 @@ public void setupMockClient(MockToolsConfig config, List workspaceConten "java_toolchain_alias(name = 'current_java_toolchain')", "java_runtime_alias(name = 'current_java_runtime')", "java_host_runtime_alias(name = 'current_host_java_runtime')", - "filegroup(name='langtools', srcs=['jdk/lib/tools.jar'])", "filegroup(name='bootclasspath', srcs=['jdk/jre/lib/rt.jar'])", "filegroup(name='extdir', srcs=glob(['jdk/jre/lib/ext/*']))", "filegroup(name='java', srcs = ['jdk/jre/bin/java'])", diff --git a/src/test/java/com/google/devtools/build/lib/blackbox/bazel/BUILD b/src/test/java/com/google/devtools/build/lib/blackbox/bazel/BUILD index 35f6cd4fc5557e..dcd794cc8d5167 100644 --- a/src/test/java/com/google/devtools/build/lib/blackbox/bazel/BUILD +++ b/src/test/java/com/google/devtools/build/lib/blackbox/bazel/BUILD @@ -78,11 +78,9 @@ java_library( "JavaToolsSetup.java", ], data = [ - ":langtools-copy", "//src/java_tools/junitrunner/java/com/google/testing/junit/runner:Runner_deploy.jar", "//src/tools/singlejar", "//third_party/ijar", - "//third_party/java/jdk/langtools:test-srcs", "@bazel_tools//tools/jdk:current_java_runtime", ], visibility = [":tests"], @@ -92,15 +90,6 @@ java_library( ], ) -# needed by java tools -genrule( - name = "langtools-copy", - testonly = 1, - srcs = ["//third_party/java/jdk/langtools:javac_jar"], - outs = ["langtools.jar"], - cmd = "cp $< $@", -) - java_library( name = "cxx", testonly = 1, diff --git a/src/test/java/com/google/devtools/build/lib/blackbox/bazel/JavaToolsSetup.java b/src/test/java/com/google/devtools/build/lib/blackbox/bazel/JavaToolsSetup.java index d5e923deb00a8f..81456d4c4523ae 100644 --- a/src/test/java/com/google/devtools/build/lib/blackbox/bazel/JavaToolsSetup.java +++ b/src/test/java/com/google/devtools/build/lib/blackbox/bazel/JavaToolsSetup.java @@ -17,7 +17,6 @@ import static com.google.common.truth.Truth.assertThat; import com.google.devtools.build.lib.blackbox.framework.BlackBoxTestContext; -import com.google.devtools.build.lib.blackbox.framework.PathUtils; import com.google.devtools.build.lib.blackbox.framework.ToolsSetup; import java.io.IOException; import java.nio.file.Files; @@ -40,16 +39,5 @@ public void setup(BlackBoxTestContext context) throws IOException { Files.copy(buildFiles.get(0), buildFile); assertThat(buildFile.toFile().setWritable(true)).isTrue(); } - - String packageSubpath = JavaToolsSetup.class.getPackage().getName().replace('.', '/'); - Path langToolsJar = - RunfilesUtil.find(String.format("io_bazel/src/test/java/%s/langtools.jar", packageSubpath)); - Files.copy(langToolsJar, jdkDirectory.resolve("langtools.jar")); - PathUtils.writeBuild( - jdkDirectory, "filegroup(name = \"test-langtools\", srcs = [\"langtools.jar\"])"); - - PathUtils.copyTree( - RunfilesUtil.find("io_bazel/third_party/java/jdk/langtools/BUILD").getParent(), - context.getWorkDir().resolve("third_party/java/jdk/langtools")); } } diff --git a/src/test/shell/bazel/BUILD b/src/test/shell/bazel/BUILD index 5c19f21fde6b18..a72684d6430307 100644 --- a/src/test/shell/bazel/BUILD +++ b/src/test/shell/bazel/BUILD @@ -14,14 +14,6 @@ filegroup( visibility = ["//src/test/shell:__pkg__"], ) -genrule( - name = "langtools-copy", - testonly = 1, - srcs = ["//third_party/java/jdk/langtools:javac_jar"], - outs = ["langtools.jar"], - cmd = "cp $< $@", -) - gen_workspace_stanza( name = "rules_proto_stanza", out = "rules_proto_stanza.txt", @@ -51,7 +43,6 @@ filegroup( "cc_api_rules.bzl", "remote_helpers.sh", "testing_server.py", - ":langtools-copy", "//examples:srcs", "//src/conditions:srcs", "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass:GenClass_deploy.jar", @@ -64,7 +55,6 @@ filegroup( "//src/tools/singlejar", "//third_party:srcs", "//third_party/ijar", - "//third_party/java/jdk/langtools:test-srcs", "//tools:srcs", "@bazel_skylib//:test_deps", "@bazel_tools//tools/jdk:current_java_runtime", diff --git a/src/test/shell/bazel/bazel_java_test_defaults.sh b/src/test/shell/bazel/bazel_java_test_defaults.sh index f46e161dd735c4..6e91384d18c0f2 100755 --- a/src/test/shell/bazel/bazel_java_test_defaults.sh +++ b/src/test/shell/bazel/bazel_java_test_defaults.sh @@ -186,33 +186,6 @@ EOF expect_log 'javabuilder = \["//:VanillaJavaBuilder"\]' } -# Specific toolchain attributes - jvm_opts containing location function - can be overridden. -function test_default_java_toolchain_manualConfigurationWithLocation() { - cat > BUILD <& $TEST_log || fail "failed to query //:toolchain" - - expect_log 'jvm_opts = \["-XX:+UseParallelOldGC", "-XX:-CompactStrings", "-Xbootclasspath/p:$(location @remote_java_tools//:javac_jar)",' - expect_log 'tools = \["@remote_java_tools//:javac_jar"\]' -} - # JVM8_TOOLCHAIN_CONFIGURATION shall override Java 8 internal compiler classes. function test_default_java_toolchain_jvm8Toolchain() { cat > BUILD <& $TEST_log || fail "failed to query //:jvm8_toolchain" expect_log ":JavaBuilder" - expect_log ":javac_jar" expect_not_log ":VanillaJavaBuilder" } @@ -246,7 +218,6 @@ EOF expect_log ":JavaBuilder" expect_not_log ":VanillaJavaBuilder" - expect_not_log ":javac_jar" } # VANILLA_TOOLCHAIN_CONFIGURATION shall use VanillaJavaBuilder and not override any JDK internal compiler classes. @@ -265,7 +236,6 @@ EOF expect_log ":VanillaJavaBuilder" expect_not_log ":JavaBuilder" - expect_not_log ":javac_jar" } # PREBUILT_TOOLCHAIN_CONFIGURATION shall use prebuilt ijar and singlejar binaries. diff --git a/src/test/shell/bazel/bazel_java_tools_dist_test.sh b/src/test/shell/bazel/bazel_java_tools_dist_test.sh index ef6c2b32cb8619..a9c99cfc12d960 100755 --- a/src/test/shell/bazel/bazel_java_tools_dist_test.sh +++ b/src/test/shell/bazel/bazel_java_tools_dist_test.sh @@ -126,10 +126,6 @@ function test_java_tools_has_junitrunner() { expect_path_in_java_tools "src/java_tools/junitrunner/java/com/google/testing/junit/runner/util" } -function test_java_tools_has_javac() { - expect_path_in_java_tools "javac-9+181-r4173-1.srcjar" -} - function test_java_tools_has_jacocoagent() { expect_path_in_java_tools "third_party/java/jacoco/org.jacoco.agent-.*-sources.jar" expect_path_in_java_tools "third_party/java/jacoco/org.jacoco.core-.*-sources.jar" diff --git a/src/test/shell/bazel/bazel_java_tools_test.sh b/src/test/shell/bazel/bazel_java_tools_test.sh index bb2f8bf056765f..fed65f4f0e7caa 100755 --- a/src/test/shell/bazel/bazel_java_tools_test.sh +++ b/src/test/shell/bazel/bazel_java_tools_test.sh @@ -152,10 +152,6 @@ function test_java_tools_has_Runner() { expect_path_in_java_tools "java_tools/Runner_deploy.jar" } -function test_java_tools_has_javac() { - expect_path_in_java_tools "java_tools/javac-9+181-r4173-1.jar" -} - function test_java_tools_has_Jacoco() { expect_path_in_java_tools "java_tools/JacocoCoverage_jarjar_deploy.jar" } diff --git a/src/test/shell/testenv.sh.tmpl b/src/test/shell/testenv.sh.tmpl index 180b4d4d77edcd..e3d255ab6f3df9 100755 --- a/src/test/shell/testenv.sh.tmpl +++ b/src/test/shell/testenv.sh.tmpl @@ -94,11 +94,9 @@ if [[ $PLATFORM =~ msys ]]; then else jdk_dir="${TEST_SRCDIR}/local_jdk" fi -langtools="$(rlocation io_bazel/src/test/shell/bazel/langtools.jar)" # Tools directory location tools_dir="$(dirname $(rlocation io_bazel/tools/BUILD))" -langtools_dir="$(dirname $(rlocation io_bazel/third_party/java/jdk/langtools/BUILD))" # Platforms default_host_platform="@local_config_platform//:host" @@ -135,14 +133,6 @@ function copy_tools_directory() { if [ -f tools/build_defs/repo/BUILD.repo ]; then cp tools/build_defs/repo/BUILD.repo tools/build_defs/repo/BUILD fi - # To support custom langtools - cp ${langtools} tools/jdk/langtools.jar - cat >>tools/jdk/BUILD <<'EOF' -filegroup(name = "test-langtools", srcs = ["langtools.jar"]) -EOF - - mkdir -p third_party/java/jdk/langtools - cp -R ${langtools_dir}/* third_party/java/jdk/langtools chmod -R +w . } @@ -606,13 +596,9 @@ function create_new_workspace() { workspaces+=(${new_workspace_dir}) cd ${new_workspace_dir} mkdir tools - mkdir -p third_party/java/jdk/langtools copy_tools_directory - [ -e third_party/java/jdk/langtools/javac-9+181-r4173-1.jar ] \ - || ln -s "${langtools_path}" third_party/java/jdk/langtools/javac-9+181-r4173-1.jar - write_workspace_file "WORKSPACE" "$WORKSPACE_NAME" maybe_setup_python_windows_tools diff --git a/third_party/ijar/test/BUILD b/third_party/ijar/test/BUILD index bed1af6dfccdad..95bf0722d7f2f1 100644 --- a/third_party/ijar/test/BUILD +++ b/third_party/ijar/test/BUILD @@ -14,7 +14,6 @@ sh_test( "$(JAVABASE)/bin/jar", "$(JAVABASE)/bin/javap", "$(location //third_party/ijar)", - "$(location //third_party/java/jdk/langtools:javac_jar)", # We assume unzip and zip to be on the path "unzip", "zip", @@ -48,7 +47,6 @@ sh_test( # wrong. "libwrongcentraldir.jar", "@bazel_tools//tools/jdk:current_java_runtime", - "//third_party/java/jdk/langtools:javac_jar", ], shard_count = 5, tags = ["zip"], diff --git a/third_party/ijar/test/ijar_test.sh b/third_party/ijar/test/ijar_test.sh index e916046bca5eee..905d0382642441 100755 --- a/third_party/ijar/test/ijar_test.sh +++ b/third_party/ijar/test/ijar_test.sh @@ -28,8 +28,6 @@ JAVAP=$1 shift IJAR=$1 shift -LANGTOOLS8=$1 -shift UNZIP=$1 shift ZIP=$1 diff --git a/tools/jdk/BUILD b/tools/jdk/BUILD index 1603fe3dce609a..b78e0a337094ce 100644 --- a/tools/jdk/BUILD +++ b/tools/jdk/BUILD @@ -9,7 +9,6 @@ filegroup( name = "srcs", srcs = [ "BUILD", - "BUILD.java_langtools", "BUILD.java_tools", "BUILD.java_tools_prebuilt", "BUILD-jdk", # Tools are build from the workspace for tests. diff --git a/tools/jdk/BUILD.java_langtools b/tools/jdk/BUILD.java_langtools deleted file mode 100644 index 799613c0c89807..00000000000000 --- a/tools/jdk/BUILD.java_langtools +++ /dev/null @@ -1,8 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) # Apache 2.0 - -alias( - name = "javac_jar", - actual = "@remote_java_tools//:javac_jar", -) diff --git a/tools/jdk/BUILD.java_tools b/tools/jdk/BUILD.java_tools index 7bab8164ec192a..3cedfc37dcd442 100644 --- a/tools/jdk/BUILD.java_tools +++ b/tools/jdk/BUILD.java_tools @@ -60,11 +60,6 @@ filegroup( srcs = ["java_tools/turbine_direct_binary_deploy.jar"], ) -filegroup( - name = "javac_jar", - srcs = ["java_tools/javac-9+181-r4173-1.jar"], -) - java_import( name = "jacoco-agent", jars = ["java_tools/third_party/java/jacoco/org.jacoco.agent-0.8.7.jar"], diff --git a/tools/jdk/BUILD.tools b/tools/jdk/BUILD.tools index 205bf456c65c3a..e333013714d435 100644 --- a/tools/jdk/BUILD.tools +++ b/tools/jdk/BUILD.tools @@ -127,11 +127,6 @@ alias( actual = "@local_jdk//:jar", ) -alias( - name = "javac", - actual = "@local_jdk//:javac", -) - alias( name = "javadoc", actual = "@local_jdk//:javadoc", @@ -264,10 +259,6 @@ alias( actual = "@remote_java_tools//:VanillaJavaBuilder", ) -alias( - name = "javac_jar", - actual = "@remote_java_tools//:javac_jar", -) alias( name = "JacocoCoverageRunner", diff --git a/tools/jdk/default_java_toolchain.bzl b/tools/jdk/default_java_toolchain.bzl index 6b74b117897d76..c58aa177f28bb8 100644 --- a/tools/jdk/default_java_toolchain.bzl +++ b/tools/jdk/default_java_toolchain.bzl @@ -14,10 +14,6 @@ """Bazel rules for creating Java toolchains.""" -JDK8_JVM_OPTS = [ - "-Xbootclasspath/p:$(location @remote_java_tools//:javac_jar)", -] - # JVM options, without patching java.compiler and jdk.compiler modules. BASE_JDK9_JVM_OPTS = [ # Allow JavaBuilder to access internal javac APIs. diff --git a/tools/jdk/jdk.BUILD b/tools/jdk/jdk.BUILD index 6a95e85b09dca1..034d79d61b52f0 100644 --- a/tools/jdk/jdk.BUILD +++ b/tools/jdk/jdk.BUILD @@ -165,12 +165,18 @@ filegroup( #This folder holds security policies filegroup( name = "jdk-conf", - srcs = glob(["conf/**"], allow_empty = True), + srcs = glob( + ["conf/**"], + allow_empty = True, + ), ) filegroup( name = "jdk-include", - srcs = glob(["include/**"], allow_empty = True), + srcs = glob( + ["include/**"], + allow_empty = True, + ), ) filegroup( @@ -195,19 +201,6 @@ java_runtime( ], ) -filegroup( - name = "langtools", - srcs = ["lib/tools.jar"], - deprecation = DEPRECATION_MESSAGE, -) - -java_import( - name = "langtools-neverlink", - deprecation = DEPRECATION_MESSAGE, - jars = ["lib/tools.jar"], - neverlink = 1, -) - config_setting( name = "windows", constraint_values = ["@platforms//os:windows"],