Skip to content

Commit

Permalink
compiling java 8 using java 11
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Evgenii Slutckii authored and jenkins committed Oct 3, 2024
1 parent b5bc478 commit 22eec97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
scala_library(
sources = ["*.scala"],
compiler_option_sets = ["fatal_warnings"],
platform = "java8",
platform = "java8-do-not-use",
provides = scala_artifact(
org = "com.twitter",
name = "util-validation-core",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
scala_library(
sources = ["*.scala"],
compiler_option_sets = ["fatal_warnings"],
platform = "java8",
platform = "java8-do-not-use",
provides = scala_artifact(
org = "com.twitter",
name = "util-validation-internal",
Expand Down

0 comments on commit 22eec97

Please sign in to comment.