From 6a4544f0c67ee19c6fb21d14a5d037c39809e029 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Wed, 2 Oct 2024 09:50:01 -0700 Subject: [PATCH] Add extra JVM args needed for JMH on recent JDK versions --- jmh/build.gradle | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/jmh/build.gradle b/jmh/build.gradle index 25e8a6ecb2..e1980c6155 100644 --- a/jmh/build.gradle +++ b/jmh/build.gradle @@ -104,8 +104,19 @@ def nullawayReleaseClasspath = configurations.nullawayReleaseDeps.filter({f -> ! def nullawayReleaseProcessorpath = configurations.nullawayReleaseProcessors.asPath -// Extra JVM arguments to expose relevant paths for compiling benchmarks def extraJVMArgs = [ + // needed exports for Error Prone to run + "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED", + "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", + "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED", + "--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED", + "--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED", + "--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED", + "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", + "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED", + // expose relevant paths for compiling benchmarks "-Dnullaway.caffeine.sources=${caffeineSourceDir.get()}", "-Dnullaway.caffeine.classpath=$caffeineClasspath", "-Dnullaway.autodispose.sources=${autodisposeSourceDir.get()}",