Skip to content
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

Upgrade enso to GraalVM for jdk 21 #7991

Merged
merged 177 commits into from Nov 17, 2023

Conversation

Akirathan
Copy link
Member

@Akirathan Akirathan commented Oct 6, 2023

Fixes #7851

Pull Request Description

Upgrade to GraalVM JDK 21.

> java -version
openjdk version "21" 2023-09-19
OpenJDK Runtime Environment GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15)
OpenJDK 64-Bit Server VM GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15, mixed mode, sharing)

With SDKMan, download with sdk install java 21-graalce.

Important Notes

  • After this PR, one can theoretically run enso with any JRE with version at least 21.
  • Removed sbt bootstrap hack and all the other build time related hacks related to the handling of GraalVM distribution.
  • project-manager remains backward compatible - it can open older engines with runtimes. New engines now do no longer require a separate runtime to be downloaded.
  • sbt does not support compilation of module-info.java files in mixed projects - JDK9: Support module-info.java sbt/sbt#3368
    • Which means that we can have module-info.java files only for Java-only projects.
    • Anyway, we need just a single module-info.class in the resulting runtime.jar fat jar.
  • runtime.jar is assembled in runtime-with-instruments with a custom merge strategy (sbt-assembly plugin). Caching is disabled for custom merge strategies, which means that re-assembly of runtime.jar will be more frequent.
  • Engine distribution contains multiple JAR archives (modules) in component directory, along with runner/runner.jar that is hidden inside a nested directory.
  • The new entry point to the engine runner is EngineRunnerBootLoader that contains a custom ClassLoader - to make sure that everything that does not have to be loaded from a module is loaded from runner.jar, which is not a module.
  • Newest version of Frgaal (20.0.1) does not recognize --source 21 option, only --source 20.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@Akirathan Akirathan self-assigned this Oct 6, 2023
@Akirathan Akirathan mentioned this pull request Oct 6, 2023
3 tasks
"-Dorg.graalvm.launcher.home=" + System.getProperty(
"java.home"
),
"--language:java"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably removes a way to build engine with Espresso - the documentation needs an update (at least) or the build script needs a fix.

lib/scala/interpreter-dsl/src/main/java/module-info.java Outdated Show resolved Hide resolved
project/FrgaalJavaCompiler.scala Outdated Show resolved Hide resolved
@Akirathan Akirathan force-pushed the wip/akirathan/7851-Upgrade-Enso-to-GraalVM-for-JDK-21 branch from bcd5fef to 71bcd1c Compare November 17, 2023 11:35
They are failing on StackOverflow, let's postpone the investigation
@Akirathan Akirathan added the CI: Ready to merge This PR is eligible for automatic merge label Nov 17, 2023
@mergify mergify bot merged commit 5a7ad6b into develop Nov 17, 2023
33 of 35 checks passed
@mergify mergify bot deleted the wip/akirathan/7851-Upgrade-Enso-to-GraalVM-for-JDK-21 branch November 17, 2023 18:02
mwu-tow pushed a commit that referenced this pull request Nov 29, 2023
This is a follow-up of #7991. #7991 broken `runtime-version-manager`. This is mostly reverts.


### Important Notes

Launcher now correctly recognizes that the newest engine needs some runtime:
```sh
> java -jar launcher.jar list
Enso 2023.2.1-nightly.2023.10.31 -> GraalVM 23.0.0-java17.0.7
Enso 0.0.0-dev -> GraalVM 23.1.0-java21.0.1
```
(this has not worked before)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Clean build required CI runners will be cleaned before and after this PR is built. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade Enso to GraalVM for JDK 21
7 participants