Skip to content

bazel: Use hermetic JDK 11#1863

Merged
buildbreaker merged 1 commit intoenvoyproxy:mainfrom
brentleyjones:bj/bazel-use-hermetic-jdk-11
Oct 20, 2021
Merged

bazel: Use hermetic JDK 11#1863
buildbreaker merged 1 commit intoenvoyproxy:mainfrom
brentleyjones:bj/bazel-use-hermetic-jdk-11

Conversation

@brentleyjones
Copy link
Copy Markdown
Contributor

Description: Using hermetic JDK 11 with Bazel. This improves caching, while also removing the need to manage a local JDK.
Risk Level: Low.
Testing: Built locally.
Docs Changes: N/A
Release Notes: N/A

I feel the risk is low, as this only changes the Java Runtime used, but not the toolchain used for compiling (which would still be target version of 8).

unzip $sources_jar -d $sources_dir > /dev/null

$java \
--add-opens java.base/java.util=ALL-UNNAMED \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brentleyjones
Copy link
Copy Markdown
Contributor Author

Failures seem to be related to the Java 8 ClassLoader change. Looking into a fix.

@brentleyjones brentleyjones force-pushed the bj/bazel-use-hermetic-jdk-11 branch from 6c92374 to 75d8ad3 Compare October 6, 2021 12:47
@brentleyjones
Copy link
Copy Markdown
Contributor Author

@brentleyjones brentleyjones force-pushed the bj/bazel-use-hermetic-jdk-11 branch 2 times, most recently from 53fc12f to 0eb5dbf Compare October 6, 2021 15:24
@brentleyjones brentleyjones force-pushed the bj/bazel-use-hermetic-jdk-11 branch 2 times, most recently from fb18b2b to 43fa8d7 Compare October 20, 2021 20:23
This improves caching, while also removing the need to manage a local JDK.

Signed-off-by: Brentley Jones <[email protected]>
@brentleyjones brentleyjones force-pushed the bj/bazel-use-hermetic-jdk-11 branch from 43fa8d7 to a54044a Compare October 20, 2021 20:50
@brentleyjones brentleyjones marked this pull request as ready for review October 20, 2021 21:00
@brentleyjones
Copy link
Copy Markdown
Contributor Author

Fixed the crash above by using the jni header that comes with the selected JDK.

Copy link
Copy Markdown

@buildbreaker buildbreaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @brentleyjones !

@buildbreaker buildbreaker merged commit a3296b8 into envoyproxy:main Oct 20, 2021
@brentleyjones brentleyjones deleted the bj/bazel-use-hermetic-jdk-11 branch October 20, 2021 21:20
@mattklein123
Copy link
Copy Markdown
Member

👏 @brentleyjones next up hermetic NDK??? :)

@brentleyjones
Copy link
Copy Markdown
Contributor Author

I do have an idea for that, it's just less out of the box.

@mattklein123
Copy link
Copy Markdown
Member

I do have an idea for that, it's just less out of the box.

I will buy you a bottle of your beverage of choice if you can get us to a fully hermetic build. :)

jpsim added a commit to jpsim/envoy-mobile that referenced this pull request Oct 21, 2021
* origin/main:
  [Apple] Guess string encoding when creating an NSString with UTF8 fails (envoyproxy#1891)
  Link android dev document in a doctree (envoyproxy#1892)
  bazel: Remove rules_jvm_external dep on JAVA_HOME (envoyproxy#1890)
  release: 0.4.3.20211020 (envoyproxy#1887)
  Add debug instructions and sample bazelproject (envoyproxy#1888)
  bazel: Use hermetic JDK 11 (envoyproxy#1863)
  envoy: bump upstream to c687308 (envoyproxy#1886)
  docs: how to test with local envoy (envoyproxy#1876)
  network: implement initial heuristic for binding alternate interface (envoyproxy#1858)
  Assign an int to each log level (envoyproxy#1885)
  envoy: bump upstream to a5b3af2 (envoyproxy#1884)
  android: stub out jni logging by default (envoyproxy#1879)
  CI: Add local JDK to asan/tsan builds (envoyproxy#1878)
  Make JniBridgeUtility public (envoyproxy#1880)
  swift: Fix Swift version in podspec (envoyproxy#1875)

Signed-off-by: JP Simard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants