Skip to content

Commit 22eec97

Browse files
Evgenii Slutckiijenkins
authored andcommittedOct 3, 2024·
compiling java 8 using java 11
In a preparation for arm builds that require java 11 toolchains (as it is arm unlike java 8), migrating java/scala and code generation to java 11. (arm follow up diff https://phabricator.twitter.biz/D1171895) Main idea of the diff is to propagate -release 8 flag into `javac` and `scalac` that would compile classes into java 8 bytecode level as well as will use only java 8 API and won't leak java 11 APIs. One limitation of it is one cannot open up private packages like `sun.annotation.processor`. This makes targets that are using those private jdk packages uncompilable so I am just using java 8 for compilation of those (should not be a big deal and long term we should just get rid of java 8). Code generation tools are using java 11 as the runtime platform. In this diff: - adding java 11 toolchain with release 8 and propagating it through target_field_transforms.bzl that takes care of jdk transformations - using java8-do-not-use for targets that have private jdk packages. Have to override java8-do-not-use to java8 for scala_library as it has some REPL modules where one cannot override runtime_platform - making scrooge code generation use java 11 at runtime cls is failing because of unrelated diff: https://phabricator.twitter.biz/D1173582 Differential Revision: https://phabricator.twitter.biz/D1173098
1 parent b5bc478 commit 22eec97

File tree

2 files changed

+2
-2
lines changed
  • util-validator/src/main/scala/com/twitter/util/validation

2 files changed

+2
-2
lines changed
 

‎util-validator/src/main/scala/com/twitter/util/validation/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
scala_library(
22
sources = ["*.scala"],
33
compiler_option_sets = ["fatal_warnings"],
4-
platform = "java8",
4+
platform = "java8-do-not-use",
55
provides = scala_artifact(
66
org = "com.twitter",
77
name = "util-validation-core",

‎util-validator/src/main/scala/com/twitter/util/validation/internal/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
scala_library(
22
sources = ["*.scala"],
33
compiler_option_sets = ["fatal_warnings"],
4-
platform = "java8",
4+
platform = "java8-do-not-use",
55
provides = scala_artifact(
66
org = "com.twitter",
77
name = "util-validation-internal",

0 commit comments

Comments
 (0)
Please sign in to comment.