diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD index 4ec5588541ba1b..18dbec994c1baf 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD @@ -1,5 +1,5 @@ -load("@rules_java//java:defs.bzl", "java_binary", "java_library") load("//tools/build_rules:java_rules_skylark.bzl", "bootstrap_java_binary", "bootstrap_java_library") +load("@rules_java//java:defs.bzl", "java_binary", "java_library") # Description: # The Java library builders, which are used by Bazel to compile Java @@ -170,7 +170,6 @@ bootstrap_java_library( name = "starlark-deps", srcs = ["//:bootstrap-derived-java-srcs"], jars = [ - "//third_party:auto_value-jars", "//:bootstrap-derived-java-jars", "//third_party:bootstrap_guava_and_error_prone-jars", "//third_party:jsr305-jars", @@ -178,6 +177,7 @@ bootstrap_java_library( "//third_party/grpc-java:bootstrap-grpc-jars", "//third_party:tomcat_annotations_api-jars", ], + neverlink_jars = ["//third_party:auto_value-jars"], tags = ["manual"], ) @@ -209,6 +209,7 @@ bootstrap_java_binary( "javac/WerrorCustomOption.java", ], main_class = "com.google.devtools.build.buildjar.VanillaJavaBuilder", + neverlink_jars = ["//third_party:auto_value-jars"], tags = ["manual"], deps = [ ":starlark-deps", diff --git a/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh b/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh index 5d6456e09dc507..506df879a1b136 100755 --- a/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh +++ b/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh @@ -104,11 +104,22 @@ function test_bootstrap() { env EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk" ./compile.sh \ || fail "Expected to be able to bootstrap bazel" + ./output/bazel \ --server_javabase=$JAVABASE --host_jvm_args=--add-opens=java.base/java.nio=ALL-UNNAMED \ version --nognu_format &> "${TEST_log}" \ || fail "Generated bazel not working" expect_log "${SOURCE_DATE_EPOCH}" + + # TODO: make the build work without network and check for success + # the repo cache is currently missing: + # 1) canonical IDs + # 2) remote jdks & java_tools (if not using a custom java_toolchain) + ./output/bazel \ + --server_javabase=$JAVABASE --host_jvm_args=--add-opens=java.base/java.nio=ALL-UNNAMED \ + build --nobuild --repository_cache=derived/repository_cache \ + //src:bazel_nojdk &> "${TEST_log}" || true + expect_not_log "FATAL: bazel crashed due to an internal error" } run_suite "bootstrap test"