Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid accidental Java 9+ dependency with --release #10441

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

ejona86
Copy link
Member

@ejona86 ejona86 commented Aug 1, 2023

In d654707 we swapped compiling the uploaded artifacts to Java 11. This caused ABI issues with ByteBuffer, like clear() returning ByteBuffer instead of Buffer.

There are source-level approaches to avoid the accidental ABI dependency on Java 11, but we have no tool able to detect such breakages. We use Animalsniffer for similar cases, but it fails to detect these[1]. Since we have no tool, source-level approaches can't gain the necessary confidence that all incompatibility fixes have been resolved.

Java has had javac-level ways to address this, but they used to require setting bootclasspath. Since Java 9, though, they made it easier and we can use --release, which does exactly what we need.

Fixes #10432

  1. Signature failure does not halt compilation mojohaus/animal-sniffer#77

In d654707 we swapped compiling the uploaded artifacts to Java 11. This
caused ABI issues with ByteBuffer, like clear() returning ByteBuffer
instead of Buffer.

There are source-level approaches to avoid the accidental ABI dependency
on Java 11, but we have no tool able to detect such breakages.
We use Animalsniffer for similar cases, but it fails to detect these[1].
Since we have no tool, source-level approaches can't gain the necessary
confidence that all incompatibility fixes have been resolved.

Java has had javac-level ways to address this, but they used to require
setting bootclasspath. Since Java 9, though, they made it easier and we
can use --release, which does exactly what we need.

Fixes grpc#10432

1. mojohaus/animal-sniffer#77
Copy link
Contributor

@sanjaypujare sanjaypujare left a comment

Choose a reason for hiding this comment

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

LGTM

@ejona86 ejona86 merged commit 1dee7ef into grpc:master Aug 1, 2023
@ejona86 ejona86 deleted the javac-release-flag branch August 1, 2023 00:51
@ejona86 ejona86 added the TODO:backport PR needs to be backported. Removed after backport complete label Aug 1, 2023
@ejona86 ejona86 removed the TODO:backport PR needs to be backported. Removed after backport complete label Aug 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v1.57.0 fails with Java 8
2 participants