wala / WALA

T.J. Watson Libraries for Analysis, with frontends for Java, Android, and JavaScript, and may common static program analyses
http://github.com/wala/WALA
Eclipse Public License 2.0
750 stars 221 forks source link

Always use recent JDK to build WALA? #1420

Closed msridhar closed 1 month ago

msridhar commented 1 month ago

Follow up to #1357. It'd be nice to always use JDK 22 to build WALA code, while still using --release 11 to generate JDK 11 bytecodes. This blog post gets into why using more recent javac versions is a good idea. I've been running into this as there is a javac bug that was fixed in JDK 22 but hasn't been backported that bites me sometimes when building the util project with NullAway. We'd still want the com.ibm.wala.jdk-version to control which JDK version is used to run tests, with similar logic to #1357. But it'd be nice to "pin" the JDK version used to build WALA at 22 for now, and maybe bump as new JDKs are released. Right now, I can use com.ibm.wala.jdk-version to build with 22 but that also forces tests to run on 22. Also, others may run into the aformentioned javac bug if they don't build with com.ibm.wala.jdk-version set to 22.

liblit commented 1 month ago

Interesting idea. Gradle supports --release, which should make things easier.

msridhar commented 1 month ago

Yes I think we already use it?

https://github.com/wala/WALA/blob/master/build-logic/src/main/kotlin/com/ibm/wala/gradle/java.gradle.kts#L52

liblit commented 1 month ago

Ah, so we do. How clever of us.