diff --git a/.bazelrc b/.bazelrc index c150dd00c..163ffecbf 100644 --- a/.bazelrc +++ b/.bazelrc @@ -6,15 +6,15 @@ build --enable_platform_specific_config build -c opt # Ensure that paths of files printed by our examples are valid. build --nozip_undeclared_test_outputs -# Allow build to start before all external deps have been fetched. -common --experimental_merged_skyframe_analysis_execution # C/C++ # GCC is supported on a best-effort basis. common --repo_env=CC=clang -build --incompatible_enable_cc_toolchain_resolution # Required by abseil-cpp. build --cxxopt=-std=c++14 +# Silence protobuf compilation warnings. +build --host_copt=-Wno-unused-function +build --host_copt=-Wno-unknown-warning-option # Requires a relatively modern clang. build:ci --features=layering_check build:macos --apple_crosstool_top=@local_config_apple_cc//:toolchain diff --git a/.bazelversion b/.bazelversion index c579054ee..f1f0535f1 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -b29649fbdc983cd62a58b9b09ef699867e7c5b69 +1f12a4d8f82efa3eac5e1a708833e8ed53e54327 diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 18009d5b2..aa4b7a6ca 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -13,16 +13,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_java", - patch_args = ["-p1"], - patches = [ - # https://github.com/bazelbuild/rules_java/pull/114 - # Remove unnecessary dependency on a Java runtime for the target platform. - "//third_party:rules_java-use-bootstrap-runtime-toolchain-type.patch", - ], - sha256 = "fd1d5538c8e5bbf890e1e31e983139b89710aacd0a5327ddf9afe12090ed9c78", - strip_prefix = "rules_java-ca72739da10036e1d2cf2aaeab78fae87673e43f", + sha256 = "7b0d9ba216c821ee8697dedc0f9d0a705959ace462a3885fe9ba0347ba950111", urls = [ - "https://github.com/bazelbuild/rules_java/archive/ca72739da10036e1d2cf2aaeab78fae87673e43f.tar.gz", + "https://github.com/bazelbuild/rules_java/releases/download/6.5.1/rules_java-6.5.1.tar.gz", ], ) @@ -35,10 +28,10 @@ rules_java_toolchains() http_archive( name = "com_google_protobuf", patches = ["//third_party:protobuf-disable-layering_check.patch"], - sha256 = "0930b1a6eb840a2295dfcb13bb5736d1292c3e0d61a90391181399327be7d8f1", - strip_prefix = "protobuf-24.1", + sha256 = "616bb3536ac1fff3fb1a141450fa28b875e985712170ea7f1bfe5e5fc41e2cd8", + strip_prefix = "protobuf-24.4", # Keep in sync with com_google_protobuf_protobuf_java in repositories.bzl. - urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v24.1/protobuf-24.1.tar.gz"], + urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protobuf-24.4.tar.gz"], ) http_archive( @@ -94,14 +87,9 @@ http_archive( http_archive( name = "contrib_rules_jvm", - patch_args = ["-p1"], - patches = [ - # https://github.com/bazel-contrib/rules_jvm/pull/194 - "//third_party:rules_jvm-fix-junit5-for-early-access-builds.patch", - ], - sha256 = "90ecdf08d7e8817b2247eea77826db872db8866da84b3a824f58d6661aca917f", - strip_prefix = "rules_jvm-0.14.0", - url = "https://github.com/bazel-contrib/rules_jvm/releases/download/v0.14.0/rules_jvm-v0.14.0.tar.gz", + sha256 = "4d62589dc6a55e74bbe33930b826d593367fc777449a410604b2ad7c6c625ef7", + strip_prefix = "rules_jvm-0.19.0", + url = "https://github.com/bazel-contrib/rules_jvm/releases/download/v0.19.0/rules_jvm-v0.19.0.tar.gz", ) http_archive( @@ -129,15 +117,15 @@ http_file( http_file( name = "jacocoagent", downloaded_file_path = "jacocoagent.jar", - sha256 = "191734a0b7ef97606e6a09ae584c4acab47eb30fcb4c555d3d440d4e0d71d73d", - urls = ["https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.9/org.jacoco.agent-0.8.9-runtime.jar"], + sha256 = "40d25997de4c625769bf5d1283eb855b87c9caef4ca1fa03b8ef0b752ba4b54a", + urls = ["https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.10/org.jacoco.agent-0.8.10-runtime.jar"], ) http_file( name = "jacococli", downloaded_file_path = "jacococli.jar", - sha256 = "29c7754338512599f742ebfedd095c9c93800fefbce407500eceb16f0ed5a20d", - urls = ["https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/0.8.9/org.jacoco.cli-0.8.9-nodeps.jar"], + sha256 = "c821fe4f59dc5c1bb29341a259b6c9e49d6425f200f4ac0e373bf46bbfa54cf2", + urls = ["https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/0.8.10/org.jacoco.cli-0.8.10-nodeps.jar"], ) http_jar( @@ -222,20 +210,6 @@ load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") protobuf_deps() -http_file( - name = "jacocoagent", - downloaded_file_path = "jacocoagent.jar", - sha256 = "67de51e9ca1db044f3a3d10613518befb02e8eee1015f2ff6d56cfb9d4506546", - urls = ["https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.8/org.jacoco.agent-0.8.8-runtime.jar"], -) - -http_file( - name = "jacococli", - downloaded_file_path = "jacococli.jar", - sha256 = "c449591174982bbc003d1290003fcbc7b939215436922d2f0f25239d110d531a", - urls = ["https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/0.8.8/org.jacoco.cli-0.8.8-nodeps.jar"], -) - load("//third_party/android:android_configure.bzl", "android_configure") android_configure(name = "configure_android_rules") diff --git a/maven_install.json b/maven_install.json index 0e626fb36..25f4fd112 100644 --- a/maven_install.json +++ b/maven_install.json @@ -1,6 +1,6 @@ { "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", - "__INPUT_ARTIFACTS_HASH": 68876267, + "__INPUT_ARTIFACTS_HASH": 68877449, "__RESOLVED_ARTIFACTS_HASH": 1123237997, "conflict_resolution": { "junit:junit:4.12": "junit:junit:4.13.2" diff --git a/repositories.bzl b/repositories.bzl index 6662cef53..cd07d4590 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -43,59 +43,39 @@ def jazzer_dependencies(android = False): maybe( http_archive, name = "io_bazel_rules_kotlin", - patch_args = ["-p1"], - patches = [ - # https://github.com/bazelbuild/rules_kotlin/pull/1000 - # Remove unnecessary dependency on a Java runtime for the target platform. - "//third_party:rules_kotlin-remove-java-runtime-dep.patch", - # https://github.com/bazelbuild/rules_kotlin/pull/1005 - # Required for compatibility with recent Bazel 7 pre-releases. - "//third_party:rules_kotlin-remove-java-info-transitive-deps.patch", - ], - sha256 = "01293740a16e474669aba5b5a1fe3d368de5832442f164e4fbfc566815a8bc3a", - url = "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.8/rules_kotlin_release.tgz", + sha256 = "a630cda9fdb4f56cf2dc20a4bf873765c41cf00e9379e8d59cd07b24730f4fde", + url = "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.8.1/rules_kotlin_release.tgz", ) maybe( http_archive, name = "rules_jvm_external", - patch_args = ["-p1"], - patches = [ - # https://github.com/bazelbuild/rules_jvm_external/pull/958 - # Allows javadoc targets to reference other javadoc targets. - "//third_party:rules_jvm_external-javadoc-deps.patch", - # https://github.com/bazelbuild/rules_jvm_external/pull/960 - # Forwards the toolchains attribute on java_export to all underlying targets and - # evaluates Make variables from deps in pom_file. - "//third_party:rules_jvm_external-toolchains-attribute.patch", - ], - sha256 = "aa17db9b810b22e411bf722095be34eeb66c76819b9c3423ad7740f452016aa3", - strip_prefix = "rules_jvm_external-4b073de468eff9741406f475acb04e94bee7c9d0", - url = "https://github.com/bazelbuild/rules_jvm_external/archive/4b073de468eff9741406f475acb04e94bee7c9d0.tar.gz", + sha256 = "5061364ad9c53de3d2072975f6c14768f2982bbf4101442306270554b317772e", + strip_prefix = "rules_jvm_external-f0c92a5aa7a9ea457ec3b89c76c59ff72829d9d7", + url = "https://github.com/bazelbuild/rules_jvm_external/archive/f0c92a5aa7a9ea457ec3b89c76c59ff72829d9d7.tar.gz", ) maybe( http_archive, name = "build_bazel_apple_support", - sha256 = "ce80afe548fd71ef27b48cb48a283ca21256a0900caec3c7ed9416241e000bfe", - strip_prefix = "apple_support-dab92884a6f031e63ac263e5de8a02f13ac42508", - url = "https://github.com/bazelbuild/apple_support/archive/dab92884a6f031e63ac263e5de8a02f13ac42508.tar.gz", + sha256 = "62cb8c6658739d22986bbe4b025fe9f0f42cce91394096dc85d64b120ccde229", + url = "https://github.com/bazelbuild/apple_support/releases/download/1.10.1/apple_support.1.10.1.tar.gz", ) maybe( http_archive, name = "com_google_absl", - sha256 = "5366d7e7fa7ba0d915014d387b66d0d002c03236448e1ba9ef98122c13b35c36", - strip_prefix = "abseil-cpp-20230125.3", - url = "https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.3.tar.gz", + sha256 = "987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed", + strip_prefix = "abseil-cpp-20230802.1", + url = "https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.1.tar.gz", ) maybe( http_archive, name = "com_github_johnynek_bazel_jar_jar", - sha256 = "85260ebdaf86cf0ce6d0d0f0a3268a09f628c815513141a6b99a023116523f96", - strip_prefix = "bazel_jar_jar-78c8c13ff437e8397ffe80c9a4c905376720a339", - url = "https://github.com/bazeltools/bazel_jar_jar/archive/78c8c13ff437e8397ffe80c9a4c905376720a339.tar.gz", + sha256 = "7487df7cf64ef85bdd5ffc6a0aff92c46ff7550a663c41b262d53f9dc90cd53d", + strip_prefix = "bazel_jar_jar-4e7bf26da8bc8c955578fd8c8a2c763757d344df", + url = "https://github.com/bazeltools/bazel_jar_jar/archive/4e7bf26da8bc8c955578fd8c8a2c763757d344df.tar.gz", ) maybe( @@ -111,9 +91,9 @@ def jazzer_dependencies(android = False): http_archive, build_file = Label("//third_party:classgraph.BUILD"), name = "com_github_classgraph_classgraph", - sha256 = "62ba0109800ba55f4ccd9a7ba5f73a050293b90237c25e96132ca40d7f4e438f", - strip_prefix = "classgraph-classgraph-4.8.161", - url = "https://github.com/classgraph/classgraph/archive/refs/tags/classgraph-4.8.161.tar.gz", + sha256 = "83f3c193e90b77487cfc24fb6f73e9624e7478d9be4f94e2b20a29165a1aa906", + strip_prefix = "classgraph-classgraph-4.8.162", + url = "https://github.com/classgraph/classgraph/archive/refs/tags/classgraph-4.8.162.tar.gz", ) maybe( @@ -126,36 +106,36 @@ def jazzer_dependencies(android = False): maybe( http_jar, name = "net_bytebuddy_byte_buddy_agent", - sha256 = "55f19862b870f5d85890ba5386b1b45e9bbc88d5fe1f819abe0c788b4929fa6b", - url = "https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent/1.14.5/byte-buddy-agent-1.14.5.jar", + sha256 = "f7c60fd229df2b0f4e390f50e0582a23ac1d895645df0d487c54dd67a289800b", + url = "https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent/1.14.8/byte-buddy-agent-1.14.8.jar", ) maybe( http_jar, name = "org_ow2_asm_asm", - sha256 = "b62e84b5980729751b0458c534cf1366f727542bb8d158621335682a460f0353", - url = "https://repo1.maven.org/maven2/org/ow2/asm/asm/9.5/asm-9.5.jar", + sha256 = "3c6fac2424db3d4a853b669f4e3d1d9c3c552235e19a319673f887083c2303a1", + url = "https://repo1.maven.org/maven2/org/ow2/asm/asm/9.6/asm-9.6.jar", ) maybe( http_jar, name = "org_ow2_asm_asm_commons", - sha256 = "72eee9fbafb9de8d9463f20dd584a48ceeb7e5152ad4c987bfbe17dd4811c9ae", - url = "https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/9.5/asm-commons-9.5.jar", + sha256 = "7aefd0d5c0901701c69f7513feda765fb6be33af2ce7aa17c5781fc87657c511", + url = "https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/9.6/asm-commons-9.6.jar", ) maybe( http_jar, name = "org_ow2_asm_asm_tree", - sha256 = "3c33a648191079aeaeaeb7c19a49b153952f9e40fe86fbac5205554ddd9acd94", - url = "https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.5/asm-tree-9.5.jar", + sha256 = "c43ecf17b539c777e15da7b5b86553b377e2d39a683de6285567d5283888e7ef", + url = "https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.6/asm-tree-9.6.jar", ) maybe( http_jar, name = "com_github_jsqlparser_jsqlparser", - sha256 = "61b02b8520fda987b7bc12878833b223234450e505de83c36e78abe6d69c0184", - url = "https://repo1.maven.org/maven2/com/github/jsqlparser/jsqlparser/4.6/jsqlparser-4.6.jar", + sha256 = "9d25de1d79a669352f0d535daee906c2e35e8162e6894d82ea3f0aad8545655e", + url = "https://repo1.maven.org/maven2/com/github/jsqlparser/jsqlparser/4.7/jsqlparser-4.7.jar", ) maybe( @@ -175,9 +155,9 @@ def jazzer_dependencies(android = False): maybe( http_jar, name = "com_google_protobuf_protobuf_java", - sha256 = "b7eb9203fd2dd6e55b929debf2d079c949e0f9a85f15ec3a298b7534bc7ebd41", + sha256 = "e5655522be1aa5cc1f2f092aa036b0445157f294928eedf1332ac938c7b69686", # Keep in sync with com_google_protobuf in WORKSPACE. - url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.24.1/protobuf-java-3.24.1.jar", + url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.24.4/protobuf-java-3.24.4.jar", ) maybe( @@ -189,9 +169,9 @@ def jazzer_dependencies(android = False): Label("//third_party:jacoco-make-probe-inserter-subclassable.patch"), Label("//third_party:jacoco-ignore-offline-instrumentation.patch"), ], - sha256 = "b6b90469db034dff01a8577d8e91da51bc40f328a988359028652771f20abf1d", - strip_prefix = "jacoco-0.8.9", - url = "https://github.com/jacoco/jacoco/archive/refs/tags/v0.8.9.tar.gz", + sha256 = "5c72dea2d13eef33a4d972d157186fc12d85149bc042186953efe1be50c220ee", + strip_prefix = "jacoco-0.8.10", + url = "https://github.com/jacoco/jacoco/archive/refs/tags/v0.8.10.tar.gz", ) maybe( diff --git a/third_party/rules_java-use-bootstrap-runtime-toolchain-type.patch b/third_party/rules_java-use-bootstrap-runtime-toolchain-type.patch deleted file mode 100644 index 53ea8d978..000000000 --- a/third_party/rules_java-use-bootstrap-runtime-toolchain-type.patch +++ /dev/null @@ -1,313 +0,0 @@ -From 94f42bb23139a34acda5a0230f7db87bc32c9cf2 Mon Sep 17 00:00:00 2001 -From: Fabian Meumertzheim -Date: Fri, 9 Jun 2023 09:48:21 +0200 -Subject: [PATCH 1/4] Obtain bootstrap class path from dedicated runtime - toolchain type - -This decouples the concepts of a Java runtime used to run on the target -platform from the Java runtime that provides the bootstrap class path -used during compilation. - -The former needs constraints on the target platform, whereas the latter -should not have any constraints on the target platform to allow for -cross-compilation to target platforms for which a JDK runtime is not -available (e.g. Android). - -Work towards #17085 -Work towards https://github.com/bazelbuild/rules_java/issues/64 -Split off from #18262 ---- - toolchains/BUILD | 49 ++++++++++++++++++++++++--- - toolchains/default_java_toolchain.bzl | 27 +++++++-------- - toolchains/local_java_repository.bzl | 12 +++++++ - toolchains/remote_java_repository.bzl | 10 ++++++ - 4 files changed, 80 insertions(+), 18 deletions(-) - -diff --git a/toolchains/BUILD b/toolchains/BUILD -index b8cb35d..b208e7b 100644 ---- a/toolchains/BUILD -+++ b/toolchains/BUILD -@@ -29,14 +29,56 @@ filegroup( - srcs = glob(["*.bzl"]), - ) - --# Used to distinguish toolchains used for Java development, ie the JavaToolchainProvider. -+# A single binary distribution of a JDK (e.g., OpenJDK 17 for Windows arm64) provides three -+# different types of toolchains from the perspective of Bazel: -+ -+# The compilation toolchain, which provides the Java runtime used to execute the Java compiler, as -+# well as various helper tools and settings. -+# -+# Toolchains of this type typically have constraints on the execution platform so that their Java -+# runtime can run the compiler, but not on the target platform as Java compilation outputs are -+# platform independent. -+# -+# Obtain the associated JavaToolchainInfo via: -+# ctx.toolchains["@bazel_tools//tools/jdk:toolchain_type"].java - # TODO: migrate away from using @bazel_tools//tools/jdk:toolchain_type ? - # toolchain_type(name = "toolchain_type") - --# Used to distinguish toolchains used for Java execution, ie the JavaRuntimeInfo. -+# The Java runtime that executable Java compilation outputs (e.g., java_binary with -+# create_executable = True) will run on. -+# -+# Toolchains of this type typically have constraints on the target platform so that the runtime's -+# native 'java' binary can be run there, but not on the execution platform as building an executable -+# Java target only requires copying or symlinking the runtime, which can be done on any platform. -+# -+# Obtain the associated JavaRuntimeInfo via: -+# ctx.toolchains["@bazel_tools//tools/jdk:runtime_toolchain_type"].java_runtime - # TODO: migrate away from using @bazel_tools//tools/jdk:runtime_toolchain_type ? - # toolchain_type(name = "runtime_toolchain_type") - -+# The Java runtime to extract the bootclasspath from that is then used to compile Java sources. -+# -+# As the bootclasspath is platform independent, toolchains of this type may have no constraints. -+# Purely as an optimization to prevent unnecessary fetches of remote runtimes for other -+# architectures, toolchains of this type may have constraints on the execution platform that match -+# those on the corresponding compilation toolchain. -+# -+# Toolchains of this type are only consumed internally by the bootclasspath rule and should not be -+# accessed from Starlark. -+# TODO: migrate away from using @bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type ? -+# toolchain_type(name = "bootstrap_runtime_toolchain_type") -+ -+# The Java runtime to extract the bootclasspath from that is then used to compile Java sources. -+# -+# As the bootclasspath is platform independent, toolchains of this type may have no constraints. -+# Purely as an optimization to prevent unnecessary fetches of remote runtimes for other -+# architectures, toolchains of this type may have constraints on the execution platform that match -+# those on the corresponding compilation toolchain. -+# -+# Toolchains of this type are only consumed internally by the bootclasspath rule and should not be -+# accessed from Starlark. -+# toolchain_type(name = "bootstrap_runtime_toolchain_type") -+ - # Points to toolchain[":runtime_toolchain_type"] (was :legacy_current_java_runtime) - java_runtime_alias(name = "current_java_runtime") - -@@ -201,8 +243,7 @@ alias( - bootclasspath( - name = "platformclasspath", - src = "DumpPlatformClassPath.java", -- host_javabase = ":current_java_runtime", -- target_javabase = ":current_java_runtime", -+ java_runtime_alias = ":current_java_runtime", - ) - - default_java_toolchain( -diff --git a/toolchains/default_java_toolchain.bzl b/toolchains/default_java_toolchain.bzl -index 846302e..e696988 100644 ---- a/toolchains/default_java_toolchain.bzl -+++ b/toolchains/default_java_toolchain.bzl -@@ -204,8 +204,10 @@ def java_runtime_files(name, srcs): - tags = ["manual"], - ) - -+_JAVA_BOOTSTRAP_RUNTIME_TOOLCHAIN_TYPE = Label("@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type") -+ - def _bootclasspath_impl(ctx): -- host_javabase = ctx.attr.host_javabase[java_common.JavaRuntimeInfo] -+ exec_javabase = ctx.attr.java_runtime_alias[java_common.JavaRuntimeInfo] - - class_dir = ctx.actions.declare_directory("%s_classes" % ctx.label.name) - -@@ -220,17 +222,15 @@ def _bootclasspath_impl(ctx): - args.add(ctx.file.src) - - ctx.actions.run( -- executable = "%s/bin/javac" % host_javabase.java_home, -+ executable = "%s/bin/javac" % exec_javabase.java_home, - mnemonic = "JavaToolchainCompileClasses", -- inputs = [ctx.file.src] + ctx.files.host_javabase, -+ inputs = [ctx.file.src] + ctx.files.java_runtime_alias, - outputs = [class_dir], - arguments = [args], - ) - - bootclasspath = ctx.outputs.output_jar - -- inputs = [class_dir] + ctx.files.host_javabase -- - args = ctx.actions.args() - args.add("-XX:+IgnoreUnrecognizedVMOptions") - args.add("--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED") -@@ -240,16 +240,17 @@ def _bootclasspath_impl(ctx): - args.add("DumpPlatformClassPath") - args.add(bootclasspath) - -+ any_javabase = ctx.toolchains[_JAVA_BOOTSTRAP_RUNTIME_TOOLCHAIN_TYPE].java_runtime -+ args.add(any_javabase.java_home) -+ - system_files = ("release", "modules", "jrt-fs.jar") -- system = [f for f in ctx.files.target_javabase if f.basename in system_files] -+ system = [f for f in any_javabase.files.to_list() if f.basename in system_files] - if len(system) != len(system_files): - system = None -- if ctx.attr.target_javabase: -- inputs.extend(ctx.files.target_javabase) -- args.add(ctx.attr.target_javabase[java_common.JavaRuntimeInfo].java_home) - -+ inputs = depset([class_dir] + ctx.files.java_runtime_alias, transitive = [any_javabase.files]) - ctx.actions.run( -- executable = str(host_javabase.java_executable_exec_path), -+ executable = str(exec_javabase.java_executable_exec_path), - mnemonic = "JavaToolchainCompileBootClasspath", - inputs = inputs, - outputs = [bootclasspath], -@@ -267,7 +268,7 @@ def _bootclasspath_impl(ctx): - _bootclasspath = rule( - implementation = _bootclasspath_impl, - attrs = { -- "host_javabase": attr.label( -+ "java_runtime_alias": attr.label( - cfg = "exec", - providers = [java_common.JavaRuntimeInfo], - ), -@@ -276,10 +277,8 @@ _bootclasspath = rule( - cfg = "exec", - allow_single_file = True, - ), -- "target_javabase": attr.label( -- providers = [java_common.JavaRuntimeInfo], -- ), - }, -+ toolchains = [_JAVA_BOOTSTRAP_RUNTIME_TOOLCHAIN_TYPE], - ) - - def bootclasspath(name, **kwargs): -diff --git a/toolchains/local_java_repository.bzl b/toolchains/local_java_repository.bzl -index 3b8c386..1589d39 100644 ---- a/toolchains/local_java_repository.bzl -+++ b/toolchains/local_java_repository.bzl -@@ -101,6 +101,12 @@ def local_java_runtime(name, java_home, version, runtime_name = None, visibility - toolchain_type = Label("@bazel_tools//tools/jdk:runtime_toolchain_type"), - toolchain = runtime_name, - ) -+ native.toolchain( -+ name = "bootstrap_runtime_toolchain_definition", -+ target_settings = [":%s_settings_alias" % name], -+ toolchain_type = Label("@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type"), -+ toolchain = runtime_name, -+ ) - - if type(version) == type("") and version.isdigit() and int(version) > 8: - for version in range(8, int(version) + 1): -@@ -245,6 +251,12 @@ toolchain( - toolchain_type = "@bazel_tools//tools/jdk:runtime_toolchain_type", - toolchain = ":jdk", - ) -+toolchain( -+ name = "bootstrap_runtime_toolchain_definition", -+ target_settings = [":localjdk_setting"], -+ toolchain_type = "@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type", -+ toolchain = ":jdk", -+) - ''' - - _local_java_repository_rule = repository_rule( -diff --git a/toolchains/remote_java_repository.bzl b/toolchains/remote_java_repository.bzl -index 86916ec..65bbe48 100644 ---- a/toolchains/remote_java_repository.bzl -+++ b/toolchains/remote_java_repository.bzl -@@ -82,6 +82,16 @@ toolchain( - toolchain_type = "@bazel_tools//tools/jdk:runtime_toolchain_type", - toolchain = "{toolchain}", - ) -+toolchain( -+ name = "bootstrap_runtime_toolchain", -+ # These constraints are not required for correctness, but prevent fetches of remote JDK for -+ # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in -+ # the same configuration, this constraint will not result in toolchain resolution failures. -+ exec_compatible_with = {target_compatible_with}, -+ target_settings = [":version_or_prefix_version_setting"], -+ toolchain_type = "@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type", -+ toolchain = "{toolchain}", -+) - """.format( - prefix = prefix, - version = version, - -From 962ab9f9075bed19544b7cac0b53e512c62228e8 Mon Sep 17 00:00:00 2001 -From: Fabian Meumertzheim -Date: Wed, 5 Jul 2023 18:28:33 +0200 -Subject: [PATCH 2/4] Register toolchains in MODULE.bazel - ---- - MODULE.bazel | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/MODULE.bazel b/MODULE.bazel -index ac5cd19..d3729b9 100644 ---- a/MODULE.bazel -+++ b/MODULE.bazel -@@ -26,7 +26,10 @@ use_repo(toolchains, "remote_java_tools_darwin_arm64") - # Declare local jdk repo - use_repo(toolchains, "local_jdk") - --register_toolchains("@local_jdk//:runtime_toolchain_definition") -+register_toolchains( -+ "@local_jdk//:runtime_toolchain_definition", -+ "@local_jdk//:bootstrap_runtime_toolchain_definition", -+) - - # Declare all remote jdk toolchain config repos - JDKS = { -@@ -69,7 +72,7 @@ REMOTE_JDK_REPOS = [("remotejdk" + version + "_" + platform) for version in JDKS - repo + "_toolchain_config_repo", - ) for repo in REMOTE_JDK_REPOS] - --[register_toolchains("@" + name + "_toolchain_config_repo//:toolchain") for name in REMOTE_JDK_REPOS] -+[register_toolchains("@" + name + "_toolchain_config_repo//:all") for name in REMOTE_JDK_REPOS] - - # Dev dependencies - bazel_dep(name = "rules_pkg", version = "0.5.1", dev_dependency = True) - -From 58834b48f02deebddbc887f731a9199ce484a6e0 Mon Sep 17 00:00:00 2001 -From: Fabian Meumertzheim -Date: Mon, 31 Jul 2023 18:09:00 +0200 -Subject: [PATCH 3/4] Update Bazel to 7.0.0-pre.20230710.5 - ---- - .bazelversion | 1 + - 1 file changed, 1 insertion(+) - create mode 100644 .bazelversion - -diff --git a/.bazelversion b/.bazelversion -new file mode 100644 -index 0000000..293346f ---- /dev/null -+++ b/.bazelversion -@@ -0,0 +1 @@ -+7.0.0-pre.20230710.5 - -From 6b04a310347861d00ecf6e439e200e559c6a1a90 Mon Sep 17 00:00:00 2001 -From: Fabian Meumertzheim -Date: Tue, 1 Aug 2023 10:45:39 +0200 -Subject: [PATCH 4/4] Add missing WORKSPACE `register_toolchains` calls - ---- - java/repositories.bzl | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/java/repositories.bzl b/java/repositories.bzl -index 7e5b939..a7cf3bd 100644 ---- a/java/repositories.bzl -+++ b/java/repositories.bzl -@@ -551,7 +551,13 @@ def rules_java_toolchains(name = "toolchains"): - - REMOTE_JDK_REPOS = [("remotejdk" + version + "_" + platform) for version in JDKS for platform in JDKS[version]] - -- native.register_toolchains("//toolchains:all") -- native.register_toolchains("@local_jdk//:runtime_toolchain_definition") -+ native.register_toolchains( -+ "//toolchains:all", -+ "@local_jdk//:runtime_toolchain_definition", -+ "@local_jdk//:bootstrap_runtime_toolchain_definition", -+ ) - for name in REMOTE_JDK_REPOS: -- native.register_toolchains("@" + name + "_toolchain_config_repo//:toolchain") -+ native.register_toolchains( -+ "@" + name + "_toolchain_config_repo//:toolchain", -+ "@" + name + "_toolchain_config_repo//:bootstrap_runtime_toolchain", -+ ) diff --git a/third_party/rules_jvm-fix-junit5-for-early-access-builds.patch b/third_party/rules_jvm-fix-junit5-for-early-access-builds.patch deleted file mode 100644 index caf9ab543..000000000 --- a/third_party/rules_jvm-fix-junit5-for-early-access-builds.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 297bdf9a7abb1980cacf911c7f2652884454dacf Mon Sep 17 00:00:00 2001 -From: Fabian Meumertzheim -Date: Mon, 14 Aug 2023 16:17:42 +0200 -Subject: [PATCH] Make JUnit5Runner usable with Early Access builds - -Fixes this crash: -``` -Exception in thread "main" java.lang.NumberFormatException: For input string: "21-ea" - at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) - at java.base/java.lang.Integer.parseInt(Integer.java:661) - at java.base/java.lang.Integer.parseInt(Integer.java:777) - at com.github.bazel_contrib.contrib_rules_jvm.junit5.JUnit5Runner.getSystemExitToggle(JUnit5Runner.java:57) - at com.github.bazel_contrib.contrib_rules_jvm.junit5.JUnit5Runner.main(JUnit5Runner.java:24) -``` ---- - .../bazel_contrib/contrib_rules_jvm/junit5/JUnit5Runner.java | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/java/src/com/github/bazel_contrib/contrib_rules_jvm/junit5/JUnit5Runner.java b/java/src/com/github/bazel_contrib/contrib_rules_jvm/junit5/JUnit5Runner.java -index d331e590..b1e437b2 100644 ---- a/java/src/com/github/bazel_contrib/contrib_rules_jvm/junit5/JUnit5Runner.java -+++ b/java/src/com/github/bazel_contrib/contrib_rules_jvm/junit5/JUnit5Runner.java -@@ -53,7 +53,8 @@ public static void main(String[] args) { - private static SystemExitToggle getSystemExitToggle() { - // In Java 8 and lower, the first part of the version is a 1. - // In Java 9 and higher, the first part of the version is the feature version. -- int featureVersion = Integer.parseInt(System.getProperty("java.version").split("\\.")[0]); -+ // Major versions of early Access builds have an "-ea" suffix. -+ int featureVersion = Integer.parseInt(System.getProperty("java.version").split("[.-]")[0]); - if (featureVersion == 1) { - featureVersion = 8; - } diff --git a/third_party/rules_jvm_external-javadoc-deps.patch b/third_party/rules_jvm_external-javadoc-deps.patch deleted file mode 100644 index b6c376077..000000000 --- a/third_party/rules_jvm_external-javadoc-deps.patch +++ /dev/null @@ -1,255 +0,0 @@ -From 119d0bf53b1a76436095986ffe11a0c97f1757db Mon Sep 17 00:00:00 2001 -From: Fabian Meumertzheim -Date: Mon, 11 Sep 2023 13:05:32 +0200 -Subject: [PATCH] javadoc: Allow `javadoc` targets to reference other `javadoc` - targets - -By setting the `doc_url` attribute on a `javadoc` target, other targets -can depend on it via `doc_deps` and have references resolved -automatically via appropriate `-linkoffline` arguments passed to -javadoc. ---- - private/rules/java_export.bzl | 21 ++++- - private/rules/javadoc.bzl | 77 +++++++++++++++++-- - .../javadoc/JavadocJarMaker.java | 15 ++++ - 3 files changed, 106 insertions(+), 7 deletions(-) - -diff --git a/private/rules/java_export.bzl b/private/rules/java_export.bzl -index 5c576f95..81138db1 100644 ---- a/private/rules/java_export.bzl -+++ b/private/rules/java_export.bzl -@@ -69,6 +69,10 @@ def java_export( - that workspace should be replaced by, or `None` if the exclusion shouldn't be replaced - with an extra dependency. - classifier_artifacts: A dict of classifier -> artifact of additional artifacts to publish to Maven. -+ doc_deps: Other `javadoc` targets that are referenced by the generated `javadoc` target -+ (if not using `tags = ["no-javadoc"]`) -+ doc_url: The URL at which the generated `javadoc` will be hosted (if not using -+ `tags = ["no-javadoc"]`). - visibility: The visibility of the target - kwargs: These are passed to [`java_library`](https://bazel.build/reference/be/java#java_library), - and so may contain any valid parameter for that rule. -@@ -78,6 +82,8 @@ def java_export( - lib_name = "%s-lib" % name - - javadocopts = kwargs.pop("javadocopts", []) -+ doc_deps = kwargs.pop("doc_deps", []) -+ doc_url = kwargs.pop("doc_url", "") - - # Construct the java_library we'll export from here. - native.java_library( -@@ -100,6 +106,8 @@ def java_export( - testonly, - javadocopts, - classifier_artifacts = classifier_artifacts, -+ doc_deps = doc_deps, -+ doc_url = doc_url, - ) - - def maven_export( -@@ -113,7 +121,10 @@ def maven_export( - tags = [], - testonly = False, - javadocopts = [], -- classifier_artifacts = {}): -+ classifier_artifacts = {}, -+ *, -+ doc_deps = [], -+ doc_url = ""): - """ - All arguments are the same as java_export with the addition of: - lib_name: Name of the library that has been built. -@@ -166,6 +177,10 @@ def maven_export( - that should not be included in the maven jar to a `Label` pointing to the dependency - that workspace should be replaced by, or `None` if the exclusion shouldn't be replaced - with an extra dependency. -+ doc_deps: Other `javadoc` targets that are referenced by the generated `javadoc` target -+ (if not using `tags = ["no-javadoc"]`) -+ doc_url: The URL at which the generated `javadoc` will be hosted (if not using -+ `tags = ["no-javadoc"]`). - visibility: The visibility of the target - kwargs: These are passed to [`java_library`](https://bazel.build/reference/be/java#java_library), - and so may contain any valid parameter for that rule. -@@ -176,6 +191,8 @@ def maven_export( - deploy_env = deploy_env if deploy_env else [] - excluded_workspaces = excluded_workspaces if excluded_workspaces else {} - javadocopts = javadocopts if javadocopts else [] -+ doc_url = doc_url if doc_url else "" -+ doc_deps = doc_deps if doc_deps else [] - tags = tags if tags else [] - classifier_artifacts = classifier_artifacts if classifier_artifacts else {} - -@@ -227,6 +244,8 @@ def maven_export( - ":%s-project" % name, - ] + deploy_env, - javadocopts = javadocopts, -+ doc_deps = doc_deps, -+ doc_url = doc_url, - excluded_workspaces = excluded_workspaces.keys(), - additional_dependencies = additional_dependencies, - visibility = visibility, -diff --git a/private/rules/javadoc.bzl b/private/rules/javadoc.bzl -index 3261248a..98ce3a08 100644 ---- a/private/rules/javadoc.bzl -+++ b/private/rules/javadoc.bzl -@@ -1,16 +1,42 @@ - load(":maven_project_jar.bzl", "DEFAULT_EXCLUDED_WORKSPACES") - --def generate_javadoc(ctx, javadoc, source_jars, classpath, javadocopts, output): -+_JavadocInfo = provider( -+ fields = { -+ "element_list": "The element-list or package-list file generated by javadoc", -+ "url": "The URL at which this documentation will be hosted", -+ }, -+) -+ -+def generate_javadoc( -+ ctx, -+ javadoc, -+ source_jars, -+ classpath, -+ javadocopts, -+ doc_deps, -+ output, -+ element_list): -+ inputs = [] -+ transitive_inputs = [] - args = ctx.actions.args() -- args.add_all(["--out", output]) -+ args.add("--out", output) -+ args.add("--element-list", element_list) - args.add_all(source_jars, before_each = "--in") -+ inputs.extend(source_jars) - args.add_all(classpath, before_each = "--cp") -+ transitive_inputs.append(classpath) -+ for dep in doc_deps: -+ dep_info = dep[_JavadocInfo] -+ args.add("-linkoffline") -+ args.add(dep_info.url) -+ args.add(dep_info.element_list.dirname) -+ inputs.append(dep_info.element_list) - args.add_all(javadocopts) - - ctx.actions.run( - executable = javadoc, -- outputs = [output], -- inputs = depset(source_jars, transitive = [classpath]), -+ outputs = [output, element_list], -+ inputs = depset(inputs, transitive = transitive_inputs), - arguments = [args], - ) - -@@ -21,6 +47,10 @@ def _javadoc_impl(ctx): - - jar_file = ctx.actions.declare_file("%s.jar" % ctx.attr.name) - -+ # This needs to be a in a separate directory as javadoc accepts the containing directory as -+ # an argument rather than the file itself. -+ element_list = ctx.actions.declare_file("%s-element-list-dir/element-list" % ctx.attr.name) -+ - # javadoc may need to inspect compile-time dependencies (neverlink) - # of the runtime classpath. - classpath = depset( -@@ -34,11 +64,29 @@ def _javadoc_impl(ctx): - # `None` https://github.com/bazelbuild/bazel/issues/10170). For this - # reason we allow people to set javadocopts via the rule attrs. - -- generate_javadoc(ctx, ctx.executable._javadoc, sources, classpath, ctx.attr.javadocopts, jar_file) -+ generate_javadoc( -+ ctx, -+ ctx.executable._javadoc, -+ sources, -+ classpath, -+ ctx.attr.javadocopts, -+ ctx.attr.doc_deps, -+ jar_file, -+ element_list, -+ ) - -- return [ -+ providers = [ - DefaultInfo(files = depset([jar_file])), - ] -+ if ctx.attr.doc_url: -+ providers.append( -+ _JavadocInfo( -+ element_list = element_list, -+ url = ctx.attr.doc_url, -+ ), -+ ) -+ -+ return providers - - javadoc = rule( - _javadoc_impl, -@@ -61,6 +109,23 @@ javadoc = rule( - options can be passed here. - """, - ), -+ "doc_deps": attr.label_list( -+ doc = """`javadoc` targets referenced by the current target. -+ -+ Use this to automatically add appropriate `-linkoffline` javadoc options to resolve -+ references to packages documented by the given javadoc targets that have `url` -+ specified. -+ """, -+ providers = [ -+ [_JavadocInfo], -+ ], -+ ), -+ "doc_url": attr.string( -+ doc = """The URL at which this documentation will be hosted. -+ -+ This information is only used by javadoc targets depending on this target. -+ """, -+ ), - "excluded_workspaces": attr.string_list( - doc = "A list of bazel workspace names to exclude from the generated jar", - allow_empty = True, -diff --git a/private/tools/java/com/github/bazelbuild/rules_jvm_external/javadoc/JavadocJarMaker.java b/private/tools/java/com/github/bazelbuild/rules_jvm_external/javadoc/JavadocJarMaker.java -index 6e8b57e6..550e075a 100644 ---- a/private/tools/java/com/github/bazelbuild/rules_jvm_external/javadoc/JavadocJarMaker.java -+++ b/private/tools/java/com/github/bazelbuild/rules_jvm_external/javadoc/JavadocJarMaker.java -@@ -22,6 +22,7 @@ - import com.github.bazelbuild.rules_jvm_external.ByteStreams; - import com.github.bazelbuild.rules_jvm_external.zip.StableZipEntry; - import java.io.File; -+import java.io.FileNotFoundException; - import java.io.IOException; - import java.io.InputStream; - import java.io.OutputStream; -@@ -57,6 +58,7 @@ public class JavadocJarMaker { - public static void main(String[] args) throws IOException { - Set sourceJars = new HashSet<>(); - Path out = null; -+ Path elementList = null; - Set classpath = new HashSet<>(); - List options = new ArrayList<>(); - -@@ -80,6 +82,11 @@ public static void main(String[] args) throws IOException { - out = Paths.get(next); - break; - -+ case "--element-list": -+ next = args[++i]; -+ elementList = Paths.get(next); -+ break; -+ - default: - options.add(flag); - break; -@@ -167,6 +174,14 @@ public static void main(String[] args) throws IOException { - return; - } - -+ Path generatedElementList = outputTo.resolve("element-list"); -+ try { -+ Files.copy(generatedElementList, elementList); -+ } catch (FileNotFoundException e) { -+ // Do not fail the action if the generated element-list couldn't be found. -+ Files.createFile(generatedElementList); -+ } -+ - try (OutputStream os = Files.newOutputStream(out); - ZipOutputStream zos = new ZipOutputStream(os); - Stream walk = Files.walk(outputTo)) { diff --git a/third_party/rules_jvm_external-toolchains-attribute.patch b/third_party/rules_jvm_external-toolchains-attribute.patch deleted file mode 100644 index dd282efff..000000000 --- a/third_party/rules_jvm_external-toolchains-attribute.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 6076dba7ccfe859d65adf8926339e8f31d4fb351 Mon Sep 17 00:00:00 2001 -From: Fabian Meumertzheim -Date: Wed, 20 Sep 2023 13:40:24 +0200 -Subject: [PATCH 2/2] java_export: Fix Make variable substitution - -This requires forwarding `toolchains` to all rules as well as evaluating -Make variables for dependency coordinates in `pom_file`. ---- - private/rules/java_export.bzl | 10 +++++++++- - private/rules/pom_file.bzl | 6 +++++- - 2 files changed, 14 insertions(+), 2 deletions(-) - -diff --git a/private/rules/java_export.bzl b/private/rules/java_export.bzl -index 81138db1..51618e82 100644 ---- a/private/rules/java_export.bzl -+++ b/private/rules/java_export.bzl -@@ -84,6 +84,7 @@ def java_export( - javadocopts = kwargs.pop("javadocopts", []) - doc_deps = kwargs.pop("doc_deps", []) - doc_url = kwargs.pop("doc_url", "") -+ toolchains = kwargs.pop("toolchains", []) - - # Construct the java_library we'll export from here. - native.java_library( -@@ -108,6 +109,7 @@ def java_export( - classifier_artifacts = classifier_artifacts, - doc_deps = doc_deps, - doc_url = doc_url, -+ toolchains = toolchains, - ) - - def maven_export( -@@ -124,7 +126,8 @@ def maven_export( - classifier_artifacts = {}, - *, - doc_deps = [], -- doc_url = ""): -+ doc_url = "", -+ toolchains = None): - """ - All arguments are the same as java_export with the addition of: - lib_name: Name of the library that has been built. -@@ -210,6 +213,7 @@ def maven_export( - visibility = visibility, - tags = tags + maven_coordinates_tags, - testonly = testonly, -+ toolchains = toolchains, - ) - - native.filegroup( -@@ -251,6 +255,7 @@ def maven_export( - visibility = visibility, - tags = tags, - testonly = testonly, -+ toolchains = toolchains, - ) - classifier_artifacts.setdefault("javadoc", docs_jar) - -@@ -262,6 +267,7 @@ def maven_export( - visibility = visibility, - tags = tags, - testonly = testonly, -+ toolchains = toolchains, - ) - - maven_publish( -@@ -273,6 +279,7 @@ def maven_export( - visibility = visibility, - tags = tags, - testonly = testonly, -+ toolchains = toolchains, - ) - - # We may want to aggregate several `java_export` targets into a single Maven BOM POM -@@ -287,6 +294,7 @@ def maven_export( - testonly = testonly, - tags = tags, - visibility = visibility, -+ toolchains = toolchains, - ) - - # Finally, alias the primary output -diff --git a/private/rules/pom_file.bzl b/private/rules/pom_file.bzl -index eba5306e..2f8b74b0 100644 ---- a/private/rules/pom_file.bzl -+++ b/private/rules/pom_file.bzl -@@ -15,6 +15,10 @@ def _pom_file_impl(ctx): - for dep in additional_deps: - for coords in dep[MavenInfo].as_maven_dep.to_list(): - all_maven_deps.append(coords) -+ expanded_maven_deps = [ -+ ctx.expand_make_variables("additional_deps", coords, ctx.var) -+ for coords in all_maven_deps -+ ] - - # Expand maven coordinates for any variables to be replaced. - coordinates = ctx.expand_make_variables("coordinates", info.coordinates, ctx.var) -@@ -22,7 +26,7 @@ def _pom_file_impl(ctx): - out = generate_pom( - ctx, - coordinates = coordinates, -- versioned_dep_coordinates = sorted(all_maven_deps), -+ versioned_dep_coordinates = sorted(expanded_maven_deps), - pom_template = ctx.file.pom_template, - out_name = "%s.xml" % ctx.label.name, - ) diff --git a/third_party/rules_kotlin-remove-java-info-transitive-deps.patch b/third_party/rules_kotlin-remove-java-info-transitive-deps.patch deleted file mode 100644 index 1f79b78d1..000000000 --- a/third_party/rules_kotlin-remove-java-info-transitive-deps.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 5633d284a6c77882487ef58885dbcbfd24c07f9c Mon Sep 17 00:00:00 2001 -From: hvadehra -Date: Fri, 11 Aug 2023 09:10:16 +0200 -Subject: [PATCH] Migrate usages deprecated `JavaInfo` fields - -transitive_deps was an alias for transitive_compile_time_jars transitive_runtime_deps was an alias for transitive_runtime_jars - -The fields were deprecated in 2021, and are dropped in Bazel@HEAD - -Fixes bazelbuild#1003 ---- - kotlin/internal/jvm/compile.bzl | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kotlin/internal/jvm/compile.bzl b/kotlin/internal/jvm/compile.bzl -index 80cbf7a8..327a0bdc 100644 ---- a/kotlin/internal/jvm/compile.bzl -+++ b/kotlin/internal/jvm/compile.bzl -@@ -261,7 +261,7 @@ def _run_merge_jdeps_action(ctx, toolchains, jdeps, outputs, deps): - ) - - # For sandboxing to work, and for this action to be deterministic, the compile jars need to be passed as inputs -- inputs = depset(jdeps, transitive = [depset([], transitive = [dep.transitive_deps for dep in deps])]) -+ inputs = depset(jdeps, transitive = [depset([], transitive = [dep.transitive_compile_time_jars for dep in deps])]) - - ctx.actions.run( - mnemonic = mnemonic, diff --git a/third_party/rules_kotlin-remove-java-runtime-dep.patch b/third_party/rules_kotlin-remove-java-runtime-dep.patch deleted file mode 100644 index a82585926..000000000 --- a/third_party/rules_kotlin-remove-java-runtime-dep.patch +++ /dev/null @@ -1,65 +0,0 @@ -From cec904da75a345d4bf021855ad506657a0a4b23d Mon Sep 17 00:00:00 2001 -From: Fabian Meumertzheim -Date: Tue, 1 Aug 2023 13:48:57 +0200 -Subject: [PATCH] Remove unnecessary Java runtime dependencies - -`kt_jvm_library` no longer depends on a Java runtime for the target -platform, which ensures that cross-platform builds targeting platforms -without standalone Java runtimes (e.g. Android) can succeed without -hacks (currently, Bazel's local_jdk is marked as compatible with any -target platform, but that will change in the future). ---- - kotlin/internal/jvm/jvm.bzl | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/kotlin/internal/jvm/jvm.bzl b/kotlin/internal/jvm/jvm.bzl -index 61fcb0ecc..822dd1597 100644 ---- a/kotlin/internal/jvm/jvm.bzl -+++ b/kotlin/internal/jvm/jvm.bzl -@@ -149,6 +149,9 @@ _implicit_deps = { - default = Label("@bazel_tools//tools/jdk:current_java_runtime"), - cfg = "exec", - ), -+} -+ -+_runnable_implicit_deps = { - "_java_runtime": attr.label( - default = Label("@bazel_tools//tools/jdk:current_java_runtime"), - ), -@@ -269,7 +272,7 @@ this is not transitive""", - ), - }) - --_runnable_common_attr = utils.add_dicts(_common_attr, { -+_runnable_common_attr = utils.add_dicts(_common_attr, _runnable_implicit_deps, { - "jvm_flags": attr.string_list( - doc = """A list of flags to embed in the wrapper script generated for running this binary. Note: does not yet - support make variable substitution.""", -@@ -287,6 +290,9 @@ _common_outputs = dict( - _common_toolchains = [ - _TOOLCHAIN_TYPE, - _JAVA_TOOLCHAIN_TYPE, -+] -+ -+_runnable_common_toolchains = [ - _JAVA_RUNTIME_TOOLCHAIN_TYPE, - ] - -@@ -318,7 +324,7 @@ It is appropriate for building workspace utilities. `java_binary` should be pref - }.items()), - executable = True, - outputs = _common_outputs, -- toolchains = _common_toolchains, -+ toolchains = _common_toolchains + _runnable_common_toolchains, - fragments = ["java"], # Required fragments of the target configuration - host_fragments = ["java"], # Required fragments of the host configuration - implementation = _kt_jvm_binary_impl, -@@ -353,7 +359,7 @@ Setup a simple kotlin_test. - executable = True, - outputs = _common_outputs, - test = True, -- toolchains = _common_toolchains, -+ toolchains = _common_toolchains + _runnable_common_toolchains, - implementation = _kt_jvm_junit_test_impl, - fragments = ["java"], # Required fragments of the target configuration - host_fragments = ["java"], # Required fragments of the host configuration