jspecify / jspecify-reference-checker

The reference implementation for the JSpecify nullness specification (and later, its other specifications as well)
https://jspecify.org
Apache License 2.0
26 stars 7 forks source link

Recommend JDK 17, not 18. #190

Closed cpovirk closed 4 months ago

cpovirk commented 4 months ago

Maybe this was a typo?

My build with 18 failed mysteriously:

$ JAVA_HOME=$HOME/jdk-18.0.1.1 ./gradlew clean assemble
...
> Task :checker-framework:framework:compileJava
/tmp/tmp.PDgUgNUXFY/checker-framework/framework/src/main/java/org/checkerframework/framework/util/TreePathCacher.java:82: warning: [serial] non-transient instance field of a serializable class declared with a non-serializable type
    TreePath path;
             ^
error: warnings found and -Werror specified
/tmp/tmp.PDgUgNUXFY/checker-framework/framework/src/main/java/org/checkerframework/framework/util/JavaExpressionParseUtil.java:1108: warning: [serial] non-transient instance field of a serializable class declared with an array having a non-serializable base component type Object
    public final Object[] args;
                          ^
1 error
2 warnings

A similar build with 21 fails faster and with more actionable information:

$ JAVA_HOME=$HOME/jdk-21.0.2 ./gradlew assemble
...
A problem occurred evaluating project ':checker-framework'.
> Build the Checker Framework with JDK 8, 11, or 17. Found version 21

As hoped, JAVA_HOME=$HOME/jdk-17.0.2 ./gradlew assemble seems to be going fine.

cpovirk commented 4 months ago

Thanks.

And err, I guess not that "mysteriously": I'd missed the "error: warnings found and -Werror specified" line, and I guess that that line counts as an "error" in addition to the two "warnings?"

Presumably we could make 18 work by adding a couple suppressions, but we might as well stick with the versions that the build recommends.