From 49bc1eb368a83ccea9578ddd838b7ba5aa17e892 Mon Sep 17 00:00:00 2001 From: Ivo List Date: Mon, 7 Dec 2020 14:26:51 +0100 Subject: [PATCH] Update to java_tools javac11 release 10.5 (#12647) * Java_tools javac11 v10.5 rc1. * Regression tests for https://github.com/bazelbuild/bazel/issues/12605 * Java_tools javac11 v10.5 release. --- WORKSPACE | 72 ++++++------- .../build/lib/bazel/rules/java/jdk.WORKSPACE | 18 ++-- src/test/shell/bazel/bazel_java14_test.sh | 100 +++++++++++++++++ src/test/shell/bazel/bazel_java15_test.sh | 102 ++++++++++++++++++ src/test/shell/bazel/bazel_java_test.sh | 101 +++++++++++++++++ .../shell/bazel/testdata/jdk_http_archives | 12 +-- 6 files changed, 354 insertions(+), 51 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 070b97616d2c98..0878e18507ae1c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -146,9 +146,9 @@ distdir_tar( # Keep in sync with the archives fetched as part of building bazel. archives = [ "e0b0291b2c51fbe5a7cfa14473a1ae850f94f021.zip", - "java_tools_javac11_linux-v10.4.zip", - "java_tools_javac11_windows-v10.4.zip", - "java_tools_javac11_darwin-v10.4.zip", + "java_tools_javac11_linux-v10.5.zip", + "java_tools_javac11_windows-v10.5.zip", + "java_tools_javac11_darwin-v10.5.zip", "coverage_output_generator-v2.5.zip", # bazelbuid/stardoc "1ef781ced3b1443dca3ed05dec1989eca1a4e1cd.tar.gz", @@ -187,9 +187,9 @@ distdir_tar( dirname = "derived/distdir", sha256 = { "e0b0291b2c51fbe5a7cfa14473a1ae850f94f021.zip": "fe2e04f91ce8c59d49d91b8102edc6627c6fa2906c1b0e7346f01419ec4f419d", - "java_tools_javac11_linux-v10.4.zip": "7debb49457db2f10990f759b6984c6d4ccb4917a9a9fd402a6f224b5fb0e8e36", - "java_tools_javac11_windows-v10.4.zip": "3a7d802ccefffa6ecf6e190aaae081cf27fc0275e2a8dad7d3a943c63a4d0edc", - "java_tools_javac11_darwin-v10.4.zip": "587a7bc34c95a217a941b01a5a1f8ee48114fbe87e05872a41b7e019e5297a8a", + "java_tools_javac11_linux-v10.5.zip": "355c27c603e8fc64bb0e2d7f809741f42576d5f4540f9ce28fd55922085af639", + "java_tools_javac11_windows-v10.5.zip": "0b4469ca1a9b3f26cb82fb0f4fd00096f0d839ec2fae097e7bdbb982e3a95a59", + "java_tools_javac11_darwin-v10.5.zip": "95aae0a32a170c72a68abb0b9dd6bac7ea3e08c504a5d8c6e8bf7ac51628c98f", "coverage_output_generator-v2.5.zip": "cd14f1cb4559e4723e63b7e7b06d09fcc3bd7ba58d03f354cdff1439bd936a7d", # bazelbuild/stardoc "1ef781ced3b1443dca3ed05dec1989eca1a4e1cd.tar.gz": "5a725b777976b77aa122b707d1b6f0f39b6020f66cd427bb111a585599c857b1", @@ -230,14 +230,14 @@ distdir_tar( "https://mirror.bazel.build/github.com/google/desugar_jdk_libs/archive/e0b0291b2c51fbe5a7cfa14473a1ae850f94f021.zip", "https://github.com/google/desugar_jdk_libs/archive/e0b0291b2c51fbe5a7cfa14473a1ae850f94f021.zip", ], - "java_tools_javac11_linux-v10.4.zip": [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_linux-v10.4.zip", + "java_tools_javac11_linux-v10.5.zip": [ + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_linux-v10.5.zip", ], - "java_tools_javac11_windows-v10.4.zip": [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_windows-v10.4.zip", + "java_tools_javac11_windows-v10.5.zip": [ + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_windows-v10.5.zip", ], - "java_tools_javac11_darwin-v10.4.zip": [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_darwin-v10.4.zip", + "java_tools_javac11_darwin-v10.5.zip": [ + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_darwin-v10.5.zip", ], "coverage_output_generator-v2.5.zip": [ "https://mirror.bazel.build/bazel_coverage_output_generator/releases/coverage_output_generator-v2.5.zip", @@ -545,9 +545,9 @@ http_archive( distdir_tar( name = "test_WORKSPACE_files", archives = [ - "java_tools_javac11_linux-v10.4.zip", - "java_tools_javac11_windows-v10.4.zip", - "java_tools_javac11_darwin-v10.4.zip", + "java_tools_javac11_linux-v10.5.zip", + "java_tools_javac11_windows-v10.5.zip", + "java_tools_javac11_darwin-v10.5.zip", "coverage_output_generator-v2.5.zip", "zulu11.37.17-ca-jdk11.0.6-linux_x64.tar.gz", "zulu11.37.48-ca-jdk11.0.6-linux_aarch64.tar.gz", @@ -579,9 +579,9 @@ distdir_tar( ], dirname = "test_WORKSPACE/distdir", sha256 = { - "java_tools_javac11_linux-v10.4.zip": "7debb49457db2f10990f759b6984c6d4ccb4917a9a9fd402a6f224b5fb0e8e36", - "java_tools_javac11_windows-v10.4.zip": "3a7d802ccefffa6ecf6e190aaae081cf27fc0275e2a8dad7d3a943c63a4d0edc", - "java_tools_javac11_darwin-v10.4.zip": "587a7bc34c95a217a941b01a5a1f8ee48114fbe87e05872a41b7e019e5297a8a", + "java_tools_javac11_linux-v10.5.zip": "355c27c603e8fc64bb0e2d7f809741f42576d5f4540f9ce28fd55922085af639", + "java_tools_javac11_windows-v10.5.zip": "0b4469ca1a9b3f26cb82fb0f4fd00096f0d839ec2fae097e7bdbb982e3a95a59", + "java_tools_javac11_darwin-v10.5.zip": "95aae0a32a170c72a68abb0b9dd6bac7ea3e08c504a5d8c6e8bf7ac51628c98f", "coverage_output_generator-v2.5.zip": "cd14f1cb4559e4723e63b7e7b06d09fcc3bd7ba58d03f354cdff1439bd936a7d", "zulu11.37.17-ca-jdk11.0.6-linux_x64.tar.gz": "360626cc19063bc411bfed2914301b908a8f77a7919aaea007a977fa8fb3cde1", "zulu11.37.48-ca-jdk11.0.6-linux_aarch64.tar.gz": "a452f1b9682d9f83c1c14e54d1446e1c51b5173a3a05dcb013d380f9508562e4", @@ -612,9 +612,9 @@ distdir_tar( "df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz": "f368a8476f4e2e0eccf8a7318b98dafbe30b2600f4e3cf52636e5eb145aba06a", }, urls = { - "java_tools_javac11_linux-v10.4.zip": ["https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_linux-v10.4.zip"], - "java_tools_javac11_windows-v10.4.zip": ["https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_windows-v10.4.zip"], - "java_tools_javac11_darwin-v10.4.zip": ["https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_darwin-v10.4.zip"], + "java_tools_javac11_linux-v10.5.zip": ["https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_linux-v10.5.zip"], + "java_tools_javac11_windows-v10.5.zip": ["https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_windows-v10.5.zip"], + "java_tools_javac11_darwin-v10.5.zip": ["https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_darwin-v10.5.zip"], "coverage_output_generator-v2.5.zip": ["https://mirror.bazel.build/bazel_coverage_output_generator/releases/coverage_output_generator-v2.5.zip"], "zulu11.37.17-ca-jdk11.0.6-linux_x64.tar.gz": ["https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-linux_x64.tar.gz"], "zulu11.37.48-ca-jdk11.0.6-linux_aarch64.tar.gz": ["https://mirror.bazel.build/openjdk/azul-zulu11.37.48-ca-jdk11.0.6/zulu11.37.48-ca-jdk11.0.6-linux_aarch64.tar.gz"], @@ -919,10 +919,10 @@ http_archive( name = "remote_java_tools_linux_for_testing", patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, - sha256 = "7debb49457db2f10990f759b6984c6d4ccb4917a9a9fd402a6f224b5fb0e8e36", + sha256 = "355c27c603e8fc64bb0e2d7f809741f42576d5f4540f9ce28fd55922085af639", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_linux-v10.4.zip", - "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.4/java_tools_javac11_linux-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_linux-v10.5.zip", + "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.5/java_tools_javac11_linux-v10.5.zip", ], ) @@ -931,10 +931,10 @@ http_archive( name = "remote_java_tools_windows_for_testing", patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, - sha256 = "3a7d802ccefffa6ecf6e190aaae081cf27fc0275e2a8dad7d3a943c63a4d0edc", + sha256 = "0b4469ca1a9b3f26cb82fb0f4fd00096f0d839ec2fae097e7bdbb982e3a95a59", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_windows-v10.4.zip", - "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.4/java_tools_javac11_windows-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_windows-v10.5.zip", + "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.5/java_tools_javac11_windows-v10.5.zip", ], ) @@ -943,10 +943,10 @@ http_archive( name = "remote_java_tools_darwin_for_testing", patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, - sha256 = "587a7bc34c95a217a941b01a5a1f8ee48114fbe87e05872a41b7e019e5297a8a", + sha256 = "95aae0a32a170c72a68abb0b9dd6bac7ea3e08c504a5d8c6e8bf7ac51628c98f", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_darwin-v10.4.zip", - "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.4/java_tools_javac11_darwin-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_darwin-v10.5.zip", + "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.5/java_tools_javac11_darwin-v10.5.zip", ], ) @@ -955,9 +955,9 @@ http_archive( name = "remote_java_tools_javac11_test_linux", patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, - sha256 = "7debb49457db2f10990f759b6984c6d4ccb4917a9a9fd402a6f224b5fb0e8e36", + sha256 = "355c27c603e8fc64bb0e2d7f809741f42576d5f4540f9ce28fd55922085af639", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_linux-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_linux-v10.5.zip", ], ) @@ -966,9 +966,9 @@ http_archive( name = "remote_java_tools_javac11_test_windows", patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, - sha256 = "3a7d802ccefffa6ecf6e190aaae081cf27fc0275e2a8dad7d3a943c63a4d0edc", + sha256 = "0b4469ca1a9b3f26cb82fb0f4fd00096f0d839ec2fae097e7bdbb982e3a95a59", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_windows-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_windows-v10.5.zip", ], ) @@ -977,9 +977,9 @@ http_archive( name = "remote_java_tools_javac11_test_darwin", patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, - sha256 = "587a7bc34c95a217a941b01a5a1f8ee48114fbe87e05872a41b7e019e5297a8a", + sha256 = "95aae0a32a170c72a68abb0b9dd6bac7ea3e08c504a5d8c6e8bf7ac51628c98f", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_darwin-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_darwin-v10.5.zip", ], ) diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE index e06c7591dcf120..275aa365d80b0f 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE @@ -163,10 +163,10 @@ maybe( maybe( http_archive, name = "remote_java_tools_linux", - sha256 = "7debb49457db2f10990f759b6984c6d4ccb4917a9a9fd402a6f224b5fb0e8e36", + sha256 = "355c27c603e8fc64bb0e2d7f809741f42576d5f4540f9ce28fd55922085af639", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_linux-v10.4.zip", - "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.4/java_tools_javac11_linux-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_linux-v10.5.zip", + "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.5/java_tools_javac11_linux-v10.5.zip", ], ) @@ -174,10 +174,10 @@ maybe( maybe( http_archive, name = "remote_java_tools_windows", - sha256 = "3a7d802ccefffa6ecf6e190aaae081cf27fc0275e2a8dad7d3a943c63a4d0edc", + sha256 = "0b4469ca1a9b3f26cb82fb0f4fd00096f0d839ec2fae097e7bdbb982e3a95a59", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_windows-v10.4.zip", - "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.4/java_tools_javac11_windows-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_windows-v10.5.zip", + "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.5/java_tools_javac11_windows-v10.5.zip", ], ) @@ -185,10 +185,10 @@ maybe( maybe( http_archive, name = "remote_java_tools_darwin", - sha256 = "587a7bc34c95a217a941b01a5a1f8ee48114fbe87e05872a41b7e019e5297a8a", + sha256 = "95aae0a32a170c72a68abb0b9dd6bac7ea3e08c504a5d8c6e8bf7ac51628c98f", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_darwin-v10.4.zip", - "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.4/java_tools_javac11_darwin-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_darwin-v10.5.zip", + "https://github.com/bazelbuild/java_tools/releases/download/javac11_v10.5/java_tools_javac11_darwin-v10.5.zip", ], ) diff --git a/src/test/shell/bazel/bazel_java14_test.sh b/src/test/shell/bazel/bazel_java14_test.sh index ed820373c2741c..59f49d1401a7ad 100755 --- a/src/test/shell/bazel/bazel_java14_test.sh +++ b/src/test/shell/bazel/bazel_java14_test.sh @@ -113,4 +113,104 @@ EOF expect_log "0" } +# Regression test for https://github.com/bazelbuild/bazel/issues/12605 +function test_java15_plugins() { + mkdir -p java/main + cat >java/main/BUILD <java/main/C1.java <java/main/C2.java <java/main/Anno.java <java/main/Proc.java < annotations, RoundEnvironment roundEnv) { + Elements els = processingEnv.getElementUtils(); + for (Element el : roundEnv.getElementsAnnotatedWith(Anno.class)) { + if (els.isDeprecated(el)) { + processingEnv.getMessager().printMessage(Kind.WARNING, "deprecated"); + } + } + return true; + } +} +EOF + + bazel build //java/main:C2 &>"${TEST_log}" || fail "Expected to build" +} + run_suite "Tests new Java 14 language features" diff --git a/src/test/shell/bazel/bazel_java15_test.sh b/src/test/shell/bazel/bazel_java15_test.sh index 124e40a2b130b0..cff1608431245d 100755 --- a/src/test/shell/bazel/bazel_java15_test.sh +++ b/src/test/shell/bazel/bazel_java15_test.sh @@ -114,4 +114,106 @@ EOF expect_log "^World\$" } +# Regression test for https://github.com/bazelbuild/bazel/issues/12605 +function test_java15_plugins() { + mkdir -p java/main + cat >java/main/BUILD <java/main/C1.java <java/main/C2.java <java/main/Anno.java <java/main/Proc.java < annotations, RoundEnvironment roundEnv) { + Elements els = processingEnv.getElementUtils(); + for (Element el : roundEnv.getElementsAnnotatedWith(Anno.class)) { + if (els.isDeprecated(el)) { + processingEnv.getMessager().printMessage(Kind.WARNING, "deprecated"); + } + } + return true; + } +} +EOF + + bazel build //java/main:C2 &>"${TEST_log}" || fail "Expected to build" +} + + + run_suite "Tests new Java 15 language features" diff --git a/src/test/shell/bazel/bazel_java_test.sh b/src/test/shell/bazel/bazel_java_test.sh index b544b21fd551cd..ef1b0f05f4d89a 100755 --- a/src/test/shell/bazel/bazel_java_test.sh +++ b/src/test/shell/bazel/bazel_java_test.sh @@ -1626,4 +1626,105 @@ EOF expect_log "hello 123" } +# Regression test for https://github.com/bazelbuild/bazel/issues/12605 +function test_java15_plugins() { + mkdir -p java/main + cat >java/main/BUILD <java/main/C1.java <java/main/C2.java <java/main/Anno.java <java/main/Proc.java < annotations, RoundEnvironment roundEnv) { + Elements els = processingEnv.getElementUtils(); + for (Element el : roundEnv.getElementsAnnotatedWith(Anno.class)) { + if (els.isDeprecated(el)) { + processingEnv.getMessager().printMessage(Kind.WARNING, "deprecated"); + } + } + return true; + } +} +EOF + + bazel build //java/main:C2 &>"${TEST_log}" || fail "Expected to build" +} + + run_suite "Java integration tests" diff --git a/src/test/shell/bazel/testdata/jdk_http_archives b/src/test/shell/bazel/testdata/jdk_http_archives index 03ad9a6cfb126e..5122a14cd63a2c 100644 --- a/src/test/shell/bazel/testdata/jdk_http_archives +++ b/src/test/shell/bazel/testdata/jdk_http_archives @@ -2,25 +2,25 @@ # This must be kept in sync with the top-level WORKSPACE file. http_archive( name = "remote_java_tools_javac11_test_linux", - sha256 = "7debb49457db2f10990f759b6984c6d4ccb4917a9a9fd402a6f224b5fb0e8e36", + sha256 = "355c27c603e8fc64bb0e2d7f809741f42576d5f4540f9ce28fd55922085af639", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_linux-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_linux-v10.5.zip", ], ) # This must be kept in sync with the top-level WORKSPACE file. http_archive( name = "remote_java_tools_javac11_test_windows", - sha256 = "3a7d802ccefffa6ecf6e190aaae081cf27fc0275e2a8dad7d3a943c63a4d0edc", + sha256 = "0b4469ca1a9b3f26cb82fb0f4fd00096f0d839ec2fae097e7bdbb982e3a95a59", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_windows-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_windows-v10.5.zip", ], ) # This must be kept in sync with the top-level WORKSPACE file. http_archive( name = "remote_java_tools_javac11_test_darwin", - sha256 = "587a7bc34c95a217a941b01a5a1f8ee48114fbe87e05872a41b7e019e5297a8a", + sha256 = "95aae0a32a170c72a68abb0b9dd6bac7ea3e08c504a5d8c6e8bf7ac51628c98f", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.4/java_tools_javac11_darwin-v10.4.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/javac11/v10.5/java_tools_javac11_darwin-v10.5.zip", ], )