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

Consider using Multi-Release jars for Error Prone #3756

Open
cushon opened this issue Feb 4, 2023 · 3 comments
Open

Consider using Multi-Release jars for Error Prone #3756

cushon opened this issue Feb 4, 2023 · 3 comments

Comments

@cushon
Copy link
Collaborator

cushon commented Feb 4, 2023

This bug tracks trying to use Multi-Release jar files for Error Prone.

The main use-case is that some checks need to handle AST nodes that not available in all supported JDK versions. Currently we're mostly using reflection to work around that, with mrjars we could move some of that logic behind an internal API and provide implementations that used the new AST nodes for JDK versions that supported them, avoiding the reflection. (e.g. #3737, #3610 (comment))

One of the barriers to doing this is figuring out the best way to produce mrjars with maven. (If anyone reading this has relevant experience, suggestions are welcome!)

@cushon
Copy link
Collaborator Author

cushon commented Aug 5, 2024

Some WIP on this in #4521

  • maven's <multiReleaseOutput> assumes --release, which javac doesn't allow combing with --add-exports=. Maven doesn't appear to support --system. So the only option for compiling version-specific code seems to be running on the corresponding JDK's javac, which can be done with <jdkToolchain><version>...</version></jdkToolchain> and <fork>
  • this requires having a maven toolchain registered for JDK EAs. actions/setup-java registers toolchains but doesn't download EAs from https://jdk.java.net/24/, oracle-actions/setup-java does the latter but not the former. There are some breadcrumbs here that might work: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#modifying-the-toolchain-vendor-for-jdks

@cpovirk
Copy link
Member

cpovirk commented Aug 5, 2024

@cushon
Copy link
Collaborator Author

cushon commented Aug 7, 2024

copybara-service bot pushed a commit that referenced this issue Aug 14, 2024
and use it to work around a breaking change in `SignatureGenerator`.

#3756

PiperOrigin-RevId: 661672308
copybara-service bot pushed a commit that referenced this issue Aug 15, 2024
and use it to work around a breaking change in `SignatureGenerator`.

#3756

PiperOrigin-RevId: 663105454
jrguzman-ms pushed a commit to msft-mirror-aosp/platform.build.soong that referenced this issue Oct 10, 2024
The latest errorprone updates use a multi-release jar file:
google/error-prone#3756
https://openjdk.org/jeps/238

The module-info.class existing under certain version folders caused
package-check.sh to fail. Currently errorprone only has a versioned
module-info.class file, but if it later adds versioned implementation
classes, we may also need to update package-check.sh to respect
multi-release jars.

Bug: 253827323
Test: m RUN_ERROR_PRONE=true out/soong/.intermediates/packages/modules/Media/apex/framework/updatable-media/android_common/package-check.stamp with errorprone update to 3.32.0
Change-Id: Ieaee73636aa5321494c14c221d38964e1b0cebb1
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

No branches or pull requests

2 participants