Auto-port 5.0: Whitelist JMH annotation processing in microbench module#16429
Open
netty-project-bot wants to merge 1 commit into5.0from
Open
Auto-port 5.0: Whitelist JMH annotation processing in microbench module#16429netty-project-bot wants to merge 1 commit into5.0from
netty-project-bot wants to merge 1 commit into5.0from
Conversation
Motivation: Starting from JDK 23, the annotation processing was disabled by default, see: https://bugs.java.com/bugdatabase/JDK-8321314/description https://mail.openjdk.org/pipermail/jdk-dev/2024-May/009028.html This change breaks the `microbench` module because it relies on JMH annotation processors to generate benchmark code. For instance, when building with JDK 25, run the following command within the `microbench` module: > mvn clean install -Dcheckstyle.skip -Pbenchmark-jar Then run the generated JAR(`java -jar target/microbenchmarks.jar`), and it results in the following error: > Error: Unable to access jarfile microbenchmarks.jar > Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList > at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:98) > at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124) > at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:253) > at org.openjdk.jmh.runner.Runner.run(Runner.java:209) > at org.openjdk.jmh.Main.main(Main.java:71) Modification: Whitelist the `jmh-generator-annprocess` in the `microbench/pom.xml`, with `annotationProcessorPaths` configuration, see: https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths Result: Properly process the JMH annotation. (cherry picked from commit 335d294)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto-port of #16428 to 5.0
Cherry-picked commit: 335d294
Motivation:
Starting from JDK 23, the annotation processing was disabled by default, see:
https://bugs.java.com/bugdatabase/JDK-8321314/description
https://mail.openjdk.org/pipermail/jdk-dev/2024-May/009028.html
This change breaks the
microbenchmodule because it relies on JMH annotation processors to generate benchmark code. For instance, when building with JDK 25, run the following command within themicrobenchmodule:Then run the generated JAR(
java -jar target/microbenchmarks.jar), and it results in the following error:Modification:
Whitelist the
jmh-generator-annprocessin themicrobench/pom.xml, withannotationProcessorPathsconfiguration, see:https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths
Result:
Properly process the JMH annotation.