-
Notifications
You must be signed in to change notification settings - Fork 323
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
Ydoc native image #10783
Ydoc native image #10783
Conversation
I tried the latest version and I am getting:
I am not yet sure what's the cause of the error. The message probably comes from here and it is created with following back trace:
|
The
|
There is a related discussion at GraalVM Slack. But anyway we might try latest Community GraalVM builds to be sure that the problem will get fixed in the next release of GraalVM. With following changes: diff --git build.sbt build.sbt
index 5d5fa8d769..bd080321d8 100644
--- build.sbt
build.sbt
@@ -1418,6 1418,15 @@ lazy val `ydoc-server` = project
includeRuntime = false,
mainClass = Some("org.enso.ydoc.Main"),
additionalOptions = Seq(
// "fixes" the problem with:
// Error: Polyglot version compatibility check failed.
// Your Java runtime '24 10-jvmci-b01' with native-image feature version '24.2.0' is incompatible with polyglot version '24.0.0'.
// Update the org.graalvm.polyglot versions to at least '24.2.0' to resolve this.
// To disable this version check the '-Dpolyglotimpl.DisableVersionChecks=true' system property can be used.
// It is not recommended to disable version checks.
// switching to 24.2.0 Truffle APIs isn't really possible, as they are not available on Maven central yet
// and I don't know where they are...
"-Dpolyglotimpl.DisableVersionChecks=true",
:...skipping...
diff --git build.sbt build.sbt
index 5d5fa8d769..bd080321d8 100644
--- build.sbt
build.sbt
@@ -1418,6 1418,15 @@ lazy val `ydoc-server` = project
includeRuntime = false,
mainClass = Some("org.enso.ydoc.Main"),
additionalOptions = Seq(
// "fixes" the problem with:
// Error: Polyglot version compatibility check failed.
// Your Java runtime '24 10-jvmci-b01' with native-image feature version '24.2.0' is incompatible with polyglot version '24.0.0'.
// Update the org.graalvm.polyglot versions to at least '24.2.0' to resolve this.
// To disable this version check the '-Dpolyglotimpl.DisableVersionChecks=true' system property can be used.
// It is not recommended to disable version checks.
// switching to 24.2.0 Truffle APIs isn't really possible, as they are not available on Maven central yet
// and I don't know where they are...
"-Dpolyglotimpl.DisableVersionChecks=true",
// useful perf & debug switches:
// "-g",
// "-H: SourceLevelDebug",
diff --git project/FrgaalJavaCompiler.scala project/FrgaalJavaCompiler.scala
index 1e10363d2f..f73c31e2c8 100644
--- project/FrgaalJavaCompiler.scala
project/FrgaalJavaCompiler.scala
@@ -224,7 224,7 @@ object FrgaalJavaCompiler {
val limitModules = Seq(
"java.base",
"jdk.zipfs",
- "jdk.internal.vm.compiler.management",
"jdk.graal.compiler.management",
"java.desktop",
"java.net.http",
"java.sql",
diff --git project/GraalVM.scala project/GraalVM.scala
index b6e1957f48..93604522ff 100644
--- project/GraalVM.scala
project/GraalVM.scala
@@ -155,7 155,7 @@ object GraalVM {
s"Running on Java version $javaSpecVersion. "
s"Expected Java version $javaVersion."
)
- return oldState.fail
return oldState
} and build that identifies itself as
I managed to successfully finish
Starts in 235ms. |
At https://github.com/graalvm/graalvm-ce-dev-builds/releases look for maven-resource-bundle-community-dev.tar.gz |
According to @eregon this is the fix that should be backported into GraalVM based on JDK21 to make use of Helidon Graal.js possible. as oracle/graal#9516 demonstrates - Benoit was correct.
e.g. we can stay on JDK21 if the PR gets backported or if we build our own patched JDK. |
As an alternative immediate workaround @chumer proposes to use older version of Helidon that doesn't require virtual threads. Probably Helidon 3 would do and the APIs might be similar... Meanwhile an official request in My Oracle Support has been created: |
…ions on using ofVirtual()
lib/java/ydoc-server/src/main/java/org/enso/ydoc/polyfill/web/Target_Executors.java
Outdated
Show resolved
Hide resolved
lib/java/ydoc-server/src/main/java/org/enso/ydoc/polyfill/web/Target_ExecutorsFactory.java
Show resolved
Hide resolved
With ee82801 we start in 197ms:
|
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.
Changes look OK, but how are we doing to test that it all works?
How long it takes to initialize the Y.doc server with native image build? What are the steps to reproduce such measurement? E.g. how do we measure the initliazation of the Y.doc server? |
It starts in ~250ms on my machine
I will create a followup PR that will replace nodejs version in the Docker container. Or maybe we can start with bundling it in the GUI package. Again instead of the nodejs version. |
close #10757 Changelog: - add: native-image configuration to the `ydoc-server` project - add: native-image overrides for loom executors replacing them with platform threads - update: Helidon `4.1.2` - fix: issues related to the native-image build
#10783 introduced another definition of a buildnativeimage task. Since that time, our CI is transiently failing on out of memory error. This PR ensures that there can be just a single `buildNativeImage` task running at a time. # Important Notes Manually tested by running ``` sbt:enso> all engine-runner/buildNativeImage project-manager/buildNativeImage ``` And looking at spawn subprocesses. On develop, I have two `native-image` processes, on this PR, there is just a single one.
Pull Request Description
close #10757
Changelog:
ydoc-server
project4.1.2
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.