Repository navigation
fix(desktop): keep JVM warnings off the native messaging host's stdout - #435
Merged
Merged
Conversation
The browser extension could no longer reach the desktop app. Chrome reads the native messaging host's stdout as length-prefixed messages, and since the class data sharing archive (#421) the JVM writes a CDS warning there before main runs: [0.005s][warning][cds] Required classpath entry does not exist: ... Chrome takes "[0.0" as an 800 MB length and drops the connection, so the extension reports the app as unreachable. The launcher now passes -Xlog:all=off:stdout -Xlog:all=warning:stderr, keeping the JVM's own warnings on stderr. Diagnostic -Xlog given in JAVA_TOOL_OPTIONS still works when it writes to a file; the CDS check in the testing docs now does. The warning itself means the archive is rejected in installed apps: JDK 21 checks each jar at its dump-time path, which exists only on the machine that built the image. That is left for a separate change.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The browser extension can no longer reach the desktop app (0.3.0). Chrome reads the native messaging host's stdout as length-prefixed messages, and since the class data sharing archive (#421) the JVM writes a CDS warning there before
mainruns:Chrome takes the first four bytes,
[0.0, as an ~800 MB length and drops the connection, so the extension reports the app as unreachable. The host's own reply follows the warning and is correct.Change
-Xlog:all=off:stdout -Xlog:all=warning:stderr, so the JVM's warnings go to stderr and stdout carries only the reply.JAVA_TOOL_OPTIONS, so diagnostic-Xloggiven there now only shows when it writes to a file. The CDS check indocs/development/testing.mdnow uses-Xlog:class+load,cds:file=….Testing
On macOS arm64, I built the image with
createDistributable, copied it elsewhere and renamed the build output away, as on a user's machine, then sent the copy's--native-messaging-hosta Chrome-styleconnectmessage:Diagnostic
-Xlogset inJAVA_TOOL_OPTIONSstill writes to a file; stdout and stderr outputs from there no longer show.Not fixed here
The warning means installed apps reject
ketch.jsaentirely: 0 classes come from the archive in the 0.3.0 release in /Applications. JDK 21 checks each jar at its dump-time path, which only exists on the machine that built the image, and also compares each jar's mtime. That is left for a separate change.