-
Notifications
You must be signed in to change notification settings - Fork 289
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
JDK 21 toolchain #876
JDK 21 toolchain #876
Conversation
8c2a05f
to
dc45756
Compare
pkl-core/src/test/files/LanguageSnippetTests/input/errors/analyzeInvalidHttpModule.inert
Outdated
Show resolved
Hide resolved
This is great, thanks, Sam! I will do a review of this by next week. FYI: Pkl today supports Java 21. The range enabled here is Java 22+ (updated your PR title). |
This comment was marked as outdated.
This comment was marked as outdated.
@sgammon feel free to extract the toolchain support into another PR. Indeed, my PR is quited dated. I will close it... |
@StefMa roger, no worries :) I am a well known offender in that regard |
dc45756
to
1982880
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
Also, general note: we'll need to set up our CI to use Java 21 to compile (for various compileJava
tasks), and ideally to test with all of JDK 17/21/22+. I actually think toolchains probably makes sense for this, so, I'd be okay with the toolchain changes coming back into this PR.
With toolchains, maybe the version of Java used for tasks.test
can come from a build flag.
pkl-core/src/main/resources/META-INF/native-image/org.pkl-lang/native-image.properties
Outdated
Show resolved
Hide resolved
1982880
to
a314e92
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
f9daed3
to
263588b
Compare
8ad9dd5
to
465337a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
465337a
to
5f98585
Compare
This comment was marked as outdated.
This comment was marked as outdated.
69750d3
to
d6a8801
Compare
pkl-core/src/test/kotlin/org/pkl/core/LanguageSnippetTestsEngine.kt
Outdated
Show resolved
Hide resolved
d6a8801
to
e85b259
Compare
This comment was marked as resolved.
This comment was marked as resolved.
e85b259
to
8d9c22c
Compare
8d9c22c
to
a14ef41
Compare
@bioball This is ready for final review again :) I've left a self-review detailing the cleanups I've applied. Thank you for your patience while I figured out that GVM 17 bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Sam! This looks really good. Thanks for your help here!
Can you also do the following:
- Update the
.java-version
file to 21 - Update DEVELOPMENT.adoc instructions (change mentions of Java 17 to 21)
- Add
-DpklMultiJdkTesting=true
to our CircleCI definition. Should be okay to just add"-DpklMultiJdkTesting=true"
tofixed gradleArgs
inGradleJob.pkl
.
a14ef41
to
596aa0a
Compare
@bioball No worries :) changes applied! |
- feat: support for jvm21+ toolchain - feat: support for gradle toolchains - feat: pass `-PnativeArch=native` to build with `-march=native` - test: multi-jdk testing support - test: support for `jvm-test-suite` plugin - test: add tasks to run `jpkl eval` on multiple jdks - test: make jdk exec tests respect multi-jdk flags and ranges - fix: remove mrjar classes at >jvm17 from fatjars - fix: use jdk21 to run the tests (needed for `Unsafe.ensureInitialized`) - fix: truffle svm dependency is required after graalvm `24.0.0` - fix: warnings for gvm flag usage, renamed truffle svm macro - fix: build with `--add-modules=jdk.unsupported` where needed - fix: don't use `gu` tool for modern graalvm versions - fix: catch `Throwable` instead of deprecated-for-removal `ThreadDeath` - chore: buildinfo changes for JVM targets, toolchains - chore: enforce testing at exactly jdk21 - chore: enforce build tooling at jdk21+ - chore: bump graalvm/truffle libs → `24.1.2` - chore: toolchains for `buildSrc` Signed-off-by: Sam Gammon <[email protected]>
- chore: update to jdk21 in circle jobs - chore: re-gen circle jobs Signed-off-by: Sam Gammon <[email protected]>
596aa0a
to
87a03af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, solid work, thank you!
Checksums taken during apple#876 ended up out of date due to the release of GraalVM `21.1.2` (the PR was built against `21.1.1`). These checksums are calculated from the GraalVM download page directly: https://www.graalvm.org/downloads/ On Linux: ``` sha256sum graalvm-... ``` Signed-off-by: Sam Gammon <[email protected]>
Checksums taken during apple#876 ended up out of date due to the release of GraalVM `21.1.2` (the PR was built against `21.1.1`). These checksums are calculated from the GraalVM download page directly: https://www.graalvm.org/downloads/ On Linux: ``` sha256sum graalvm-... ``` Signed-off-by: Sam Gammon <[email protected]>
Summary
This PR updates dependencies and build process for Pkl to bring GraalVM and Truffle support up to their latest versions. Today, Pkl builds against Java 17+, and requires Java 17+ to run.
After merging this PR, Pkl would build against Java 21, test against Java 21, and impose no change to lib consumers (i.e. still only requiring Java 17+ to run or transitively compile against Pkl).
Test downstream here (updated), via Github Actions. On that fork PR, the change set is expressed in full, with fixups.
PR Tree
native-image
builds #914 (split out into independent PR)kotlinc
#920 (split out into independent PR)Rationale
Gradle Toolchains: Uses Gradle's toolchains feature to provision and use different versions of the JDK.
JDK 21 Toolchain: Builds (and tests) occur under JDK 21, with bytecode targeting JVM 17. Build bytecode adopts JVM 21 to accelerate build tooling with no change to lib consumers.
Truffle SVM Dependency: Certain superclasses used by Pkl (notably,
AbstractTruffleException
andTruffleFeature
) have moved to the neworg.graalvm.nativeimage:truffle-runtime-svm
coordinate.Multi-JDK testing: Adds stronger guarantees for backward compatibility with regard to Pkl and JVM execution (i.e.
java -jar ...
with a fat JAR). Tests against versions 18-23 with test suites andjava -jar ...
executions.Known Issues
pkl-gradle
)--add-exports=...
Pre-merge Checklist
Changelog
-PnativeArch=native
to build with-march=native
jvm-test-suite
pluginjpkl eval
on multiple jdksUnsafe.ensureInitialized
)24.0.0
--add-modules=jdk.unsupported
where neededgu
tool for modern graalvm versionsThrowable
instead of deprecated-for-removalThreadDeath
24.1.2
buildSrc