Skip to content

Use -p mode only when building ydoc-server native image#14878

Open
JaroslavTulach wants to merge 7 commits intodevelopfrom
wip/jtulach/YdocServerInModuleMode
Open

Use -p mode only when building ydoc-server native image#14878
JaroslavTulach wants to merge 7 commits intodevelopfrom
wip/jtulach/YdocServerInModuleMode

Conversation

@JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Mar 16, 2026

Pull Request Description

Checklist

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

  • All code follows the
    Scala,
    Java,
  • CI stays green

@JaroslavTulach JaroslavTulach self-assigned this Mar 16, 2026
@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label Mar 16, 2026
@JaroslavTulach JaroslavTulach changed the title Provide --module-path when building ydoc-server NI Use -mp when building ydoc-server NI to improve log configuration Mar 17, 2026
@JaroslavTulach JaroslavTulach changed the title Use -mp when building ydoc-server NI to improve log configuration Use -p when building ydoc-server NI Mar 17, 2026
@JaroslavTulach JaroslavTulach changed the title Use -p when building ydoc-server NI Use -p mode only when building ydoc-server native image Mar 17, 2026
@JaroslavTulach
Copy link
Member Author

JaroslavTulach commented Mar 18, 2026

Windows Failure

  • windows .dll build failed
  • with Could not find JNI configuration resource "META-INF\native-image\org\enso\jvm\channel\jni-config.json".
  • I would hope that's a temporary failure due to some garbage
  • but it is the second commit CI run I see it

Ydoc doesn't Respond!?

enso$ corepack pnpm dev:gui

Opening project 2b27d943-7c6b-4481-8e69-67d0c57a02ed
Spawn built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/bin/enso args: --server --root-id c32b62c1-a57e-4753-9716-afcd5bfa655d --project-id 2b27d943-7c6b-4481-8e69-67d0c57a02ed --path /enso-projects/NewProject1 --interface 127.0.0.1 --rpc-port 30616 --data-port 30617
05:05:38.294 [main] DEBUG org.enso.runner.Utils -- Checking file /enso-projects/NewProject1 - e.g. /enso-projects/NewProject1 if it exists true
05:05:38.294 [main] DEBUG org.enso.runner.Utils -- findFileAndProject cwd null, path /enso-projects/NewProject1, projectPath null yields (true,/enso-projects/NewProject1)
05:05:38.294 [main] DEBUG org.enso.runner.Utils -- Found file /enso-projects/NewProject1, project mode true
05:05:38.295 [main] DEBUG org.enso.distribution.PortableDistributionManager -- Launcher portable [mode=false].
05:05:38.295 [main] DEBUG org.enso.runtimeversionmanager.components.GraalVersionManager -- GraalVM runtime [GraalVM 25.0.1 Java 25.0.1] not found
05:05:38.295 [main] WARN org.enso.runner.JavaFinder -- No appropriate JDK found in the distribution runtimes. Trying system-wide JDK.
05:05:38.295 [main] WARN org.enso.runner.JavaFinder -- JAVA_HOME is not set. Trying java on PATH.
05:05:38.298 [main] DEBUG java.lang.ProcessBuilder -- ProcessBuilder.start(): pid: 1304861, dir: null, cmd: "java"
java.lang.RuntimeException: ProcessBuilder.start() debug
      at java.base@25.0.1/java.lang.ProcessBuilder.start(ProcessBuilder.java:1099)
      at java.base@25.0.1/java.lang.ProcessBuilder.start(ProcessBuilder.java:1046)
      at org.enso.runner/org.enso.runner.JavaFinder.findJavaOnPath(JavaFinder.java:117)
      at org.enso.runner/org.enso.runner.JavaFinder.findJavaExecutable(JavaFinder.java:59)
      at org.enso.runner/org.enso.runner.Main.launch(Main.java:1649)
      at org.enso.runner/org.enso.runner.Main.main(Main.java:1145)
      at java.base@25.0.1/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
05:05:38.351 [main] WARN org.enso.runner.JavaFinder -- Falling back to java on PATH: /bin/graalvm-community-openjdk-25.0.1+8.1/bin/java
05:05:38.351 [main] DEBUG org.enso.runner.Main -- Setting java.home property for AOT mode to /bin/graalvm-community-openjdk-25.0.1+8.1
WARNING: A restricted method in java.lang.foreign.MemorySegment has been called
WARNING: java.lang.foreign.MemorySegment::reinterpret has been called by org.enso.jvm.channel.Channel in module org.enso.jvm.channel (file:/NetBeansProjects/enso/enso.master/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/bin/enso)
WARNING: Use --enable-native-access=org.enso.jvm.channel to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
Ydoc main is being run with [localhost, 30618]
ydoc ready to start: org.enso.ydoc.server.Ydoc@2b7cd796
Mar 18, 2026 5:05:38 AM io.helidon.common.features.HelidonFeatures features
INFO: Helidon SE 4.2.2 has no registered features
Mar 18, 2026 5:05:38 AM io.helidon.webserver.ServerListener startIt
INFO: [0x16918c95] http://127.0.0.1:30618 bound for socket '@default'
Mar 18, 2026 5:05:38 AM io.helidon.webserver.LoomServer startIt
INFO: Started all channels in 1 milliseconds. 372 milliseconds since JVM startup. Java 25.0.1+8-jvmci-b01
ydoc started: org.enso.ydoc.server.Ydoc@2b7cd796
setupGatewayClient ws://127.0.0.1:30616 index
setupGatewayClient(lsUrl: ws://127.0.0.1:30616, docName: index)
Language Server transport error: undefined 
 {"error":"error","target":{"_retryCount":0,"_shouldReconnect":true,"_connectLock":false,"_binaryType":"blob","_closeCalled":false,"_messageQueue":[],"_url":"ws://127.0.0.1:30616","_options":{"startClosed":true},"onclose":null,"onerror":null,"onmessage":null,"onopen":null}}
Language Server transport error: undefined 
 {"error":"error","target":{"_retryCount":1,"_shouldReconnect":true,"_connectLock":false,"_binaryType":"blob","_closeCalled":false,"_messageQueue":[],"_url":"ws://127.0.0.1:30616","_options":{"startClosed":true},"onclose":null,"onerror":null,"onmessage":null,"onopen":null}}
Language Server transport error: undefined 
 {"error":"error","target":{"_retryCount":2,"_shouldReconnect":true,"_connectLock":false,"_binaryType":"blob","_closeCalled":false,"_messageQueue":[],"_url":"ws://127.0.0.1:30616","_options":{"startClosed":true},"onclose":null,"onerror":null,"onmessage":null,"onopen":null}}
Language Server transport error: undefined 
 {"error":"error","target":{"_retryCount":3,"_shouldReconnect":true,"_connectLock":false,"_binaryType":"blob","_closeCalled":false,"_messageQueue":[],"_url":"ws://127.0.0.1:30616","_options":{"startClosed":true},"onclose":null,"onerror":null,"onmessage":null,"onopen":null}}
Language Server transport error: undefined 
 {"error":"error","target":{"_retryCount":4,"_shouldReconnect":true,"_connectLock":false,"_binaryType":"blob","_closeCalled":false,"_messageQueue":[],"_url":"ws://127.0.0.1:30616","_options":{"startClosed":true},"onclose":null,"onerror":null,"onmessage":null,"onopen":null}}
Language Server transport error: undefined 
 {"error":"error","target":{"_retryCount":5,"_shouldReconnect":true,"_connectLock":false,"_binaryType":"blob","_closeCalled":false,"_messageQueue":[],"_url":"ws://127.0.0.1:30616","_options":{"startClosed":true},"onclose":null,"onerror":null,"onmessage":null,"onopen":null}}
Language Server transport error: undefined 
 {"error":"error","target":{"_retryCount":6,"_shouldReconnect":true,"_connectLock":false,"_binaryType":"blob","_closeCalled":false,"_messageQueue":[],"_url":"ws://127.0.0.1:30616","_options":{"startClosed":true},"onclose":null,"onerror":null,"onmessage":null,"onopen":null}}

right now I have no idea where the problem is originating from. The only hypothesis is that something is missing in the module configuration when building .so of the ydoc-server. However no idea what that could be...

@JaroslavTulach
Copy link
Member Author

JaroslavTulach commented Mar 18, 2026

Chrome Dev Tools to the Rescue!

Ydoc doesn't Respond!?

obrazek
  • I managed to connect Chrome Dev Tools and stop on the core error:
WebClient requires at least one protocol provider to be present on classpath, or configured through protocolPreference (such as http1)    
at WebSocket (websocket.js:132-143:2765-3237)
at <anonymous> (websocket.js:81-290:1485-7157)
at <anonymous> (websocket.js:81-290:1485-7157)
at :=> (ydoc.cjs:27619:873730-873740)
at <anonymous> (<builtin>:1:0)

Modular ServiceLoader in build time of NI Broken

@JaroslavTulach
Copy link
Member Author

JaroslavTulach commented Mar 18, 2026

Windows Failure

  • windows .dll build failed
  • with Could not find JNI configuration resource "META-INF\native-image\org\enso\jvm\channel\jni-config.json".
  • The failure on Windows is caused by some \ vs. / problem in the native image builder 25.0.1
  • it tries to find some resource with \\ and that fails ...
  • while the resource is clearly available when requested with /:
backslash problem
  • failure comes from legacyParser - as we were using old JSON format
  • let's hope 567cd82 fixes the problem by using the new parser
    • no! - the problem remains the same even with new reachability-metadata.json
    • some other workaround is needed
    • hopefully workarounded by 58db7e2
      • I had to use Args: -option fullresourcepath - using ${.} didn't work either
  • CCing @vjovanov - Vojin, you may want to be aware of this "backslash misbehavior"

@JaroslavTulach JaroslavTulach force-pushed the wip/jtulach/YdocServerInModuleMode branch from 33d854c to 58db7e2 Compare March 18, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: No changelog needed Do not require a changelog entry for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant