From b295c1bd8dc2625ef980e368270875ff3423ad44 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Fri, 7 Oct 2022 18:00:51 +0200 Subject: [PATCH] Fix strict deps violation in singlejar build singlejar and hence the `NONPREBUILT_TOOLCHAIN_CONFIGURATION` did not build with `--features=layering_check` due to includes being used from indirect dependencies. Work towards https://github.com/bazelbuild/bazel/issues/13944#issuecomment-1271745466 --- src/test/shell/bazel/bazel_java_tools_test.sh | 14 ++++++++++++++ tools/jdk/BUILD.java_tools | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/test/shell/bazel/bazel_java_tools_test.sh b/src/test/shell/bazel/bazel_java_tools_test.sh index 554a06af145630..94c570ddf410ce 100755 --- a/src/test/shell/bazel/bazel_java_tools_test.sh +++ b/src/test/shell/bazel/bazel_java_tools_test.sh @@ -192,8 +192,22 @@ function test_java_tools_singlejar_builds() { bazel build @local_java_tools//:singlejar_cc_bin || fail "singlejar failed to build" } +function test_java_tools_singlejar_builds_with_layering_check() { + type -P clang || return + + bazel build --repo_env=CC=clang --features=layering_check \ + @local_java_tools//:singlejar_cc_bin || fail "singlejar failed to build with layering check" +} + function test_java_tools_ijar_builds() { bazel build @local_java_tools//:ijar_cc_binary || fail "ijar failed to build" } +function test_java_tools_ijar_builds_with_layering_check() { + type -P clang || return + + bazel build --repo_env=CC=clang --features=layering_check \ + @local_java_tools//:ijar_cc_binary || fail "ijar failed to build with layering check" +} + run_suite "Java tools archive tests" diff --git a/tools/jdk/BUILD.java_tools b/tools/jdk/BUILD.java_tools index a01a945f98b925..e210eff23130fc 100644 --- a/tools/jdk/BUILD.java_tools +++ b/tools/jdk/BUILD.java_tools @@ -381,6 +381,8 @@ cc_binary( malloc = ":malloc", visibility = ["//visibility:public"], deps = [ + ":combiners", + ":diag", ":options", ":output_jar", "//java_tools/zlib",