Skip to content

Commit

Permalink
Patched rules_java to use remote_jdk11 as default toolchain.
Browse files Browse the repository at this point in the history
Summary: Patched rules_java to use remote_jdk11 as default toolchain.

Test Plan:
Tested with java-monorepo.
Diff: https://code.uberinternal.com/D13219185
CI-Job: https://buildkite.com/uber/java-code-differential/builds/3217038

Reviewers: cjk, ravi

JIRA Issues: JAVADEVX-8295

Differential Revision: https://code.uberinternal.com/D13309949
  • Loading branch information
adityapub authored and raviagarwal7 committed Apr 23, 2024
1 parent 5fb7831 commit f334115
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 30 deletions.
6 changes: 6 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ bazel_dep(name = "googletest", version = "1.14.0", repo_name = "com_google_googl
bazel_dep(name = "remoteapis", version = "")
bazel_dep(name = "googleapis", version = "")

single_version_override(
module_name = "rules_java",
patch_strip = 1,
patches = ["//third_party/java:rules_java.patch"],
)

single_version_override(
module_name = "rules_jvm_external",
patch_strip = 1,
Expand Down
67 changes: 37 additions & 30 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions third_party/java/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
licenses(["notice"])

exports_files(glob(["*.patch"]))
21 changes: 21 additions & 0 deletions third_party/java/rules_java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/toolchains/default_java_toolchain.bzl b/toolchains/default_java_toolchain.bzl
index 47cb877..a713aec 100644
--- a/toolchains/default_java_toolchain.bzl
+++ b/toolchains/default_java_toolchain.bzl
@@ -48,6 +48,7 @@ BASE_JDK9_JVM_OPTS = [
# makes it go to stderr instead.
"-Xlog:disable",
"-Xlog:all=warning:stderr:uptime,level,tags",
+ "-Xss4m",
]

JDK9_JVM_OPTS = BASE_JDK9_JVM_OPTS
@@ -92,7 +93,7 @@ _BASE_TOOLCHAIN_CONFIGURATION = dict(
reduced_classpath_incompatible_processors = [
"dagger.hilt.processor.internal.root.RootProcessor", # see b/21307381
],
- java_runtime = Label("//toolchains:remotejdk_21"),
+ java_runtime = Label("//toolchains:remote_jdk11"),
)

DEFAULT_TOOLCHAIN_CONFIGURATION = _BASE_TOOLCHAIN_CONFIGURATION

0 comments on commit f334115

Please sign in to comment.