Repository navigation
Fix windows-arm64 launcher: unsupported platform, classpath crash, WebView crash - #727
Conversation
Platform.fromOsAndArch() had no case for OS.WINDOWS + Arch.ARM64, even
though Arch.ARM64 already existed and jre.gradle.kts already builds a
dedicated "WindowsArm64" JRE distribution. Every launch on that
distribution hit:
Unsupported platform: OS 'WINDOWS', arch 'ARM64'
and failed before the launcher configuration was even created.
Also adds Platform#supportsWebView(), used by a follow-up commit: it
identifies the one platform where OpenJFX's javafx.web module is
present but not functional.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CreateStartScripts's default Windows template lists every dependency
jar individually with its full absolute path substituted in for
APP_HOME. With ~150 jars this comfortably exceeds cmd.exe's
8191-character line length limit once installed, and the script fails
immediately with:
The input line is too long.
The syntax of the command is incorrect.
This mainly affects the "windows-arm64" distribution: unlike
Windows64, it has no launch4j .exe wrapper (jre.gradle.kts only wires
createExe/createTerasologyExe in for os == "Windows64"), so it's the
only Windows target that actually ships and depends on this generated
.bat. The .exe wrapper already sidesteps this with a plain
`classpath.set(listOf("lib/*"))` in build.gradle.kts - apply the same
wildcard here instead of Gradle's per-jar $classpath.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Both the Changelog and About tabs eagerly construct a WebView on launcher startup. OpenJFX has never shipped a WebKit native library for Windows/aarch64 (see https://bugs.openjdk.org/browse/JDK-8314064, whose PR explicitly excludes javafx.web and javafx.media - the follow-up media port was attempted separately and abandoned after crashing, and no equivalent webkit port exists at all), so on that platform merely instantiating a WebView throws UnsatisfiedLinkError from WebEngine's static initializer, and the whole launcher fails to start. javafx.application.Platform.isSupported(ConditionalFeature.WEB) is *not* a reliable guard for this: it only reports whether the javafx.web module was compiled in, not whether its native library actually works on the current OS/arch. Verified empirically - on a real Windows/aarch64 machine with BellSoft's JRE it returns true and then crashes anyway, because that vendor JRE still bundles a javafx.web module (for API compatibility, presumably reusing the Linux-classified artifact) with no working backend behind it. Use the new Platform#supportsWebView() instead, which is exact about the one platform this currently affects. Where WebView isn't supported: the Changelog tab shows raw Markdown text, and the About tab strips HTML tags via Jsoup before displaying plain text - both readable, neither a rendering match for the WebView-based HTML view, but the launcher starts instead of crashing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe launcher adds Windows ARM64 detection and avoids the Windows command-line classpath limit. About and changelog views now detect WebView support and use read-only text fallbacks when WebKit is unavailable. ChangesWindows ARM64 and launcher support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR changes Windows ARM64 platform detection, launcher classpath handling, and WebView fallback behavior; no actionable merge-blocking risk remains in the supplied evidence. Sequence Diagram(s)sequenceDiagram
participant Launcher
participant Platform
participant AboutViewController
participant ChangelogViewController
participant WebView
participant TextArea
Launcher->>Platform: resolve operating system and architecture
Platform-->>AboutViewController: report WebView capability
Platform-->>ChangelogViewController: report WebView capability
alt WebView supported
AboutViewController->>WebView: render About content
ChangelogViewController->>WebView: render changelog HTML
else WebView unsupported
AboutViewController->>TextArea: display text fallback
ChangelogViewController->>TextArea: display raw changes
end
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Two follow-ups from review of the windows-arm64 fixes; no behaviour change intended on any platform. `AboutViewController` now uses jsoup directly, but jsoup was only on the classpath transitively, via `flexmark-all`'s html2md converter. That compiles today and would keep compiling right up until flexmark is bumped or narrowed to the modules actually used — at which point the break surfaces as an error in the About tab rather than as a missing dependency. Declared at 1.15.4, the version flexmark already resolves, so the dependency graph is unchanged. The WebView-support check was copied into both view controllers, each with its own comment and its own evaluation timing (`static final` in one, per-`initialize()` in the other). Since it answers a question about the platform, not about either view, it moves to `Platform.currentSupportsWebView()` — one home for the fallback policy, and one place to extend when the next platform needs it. Left alone deliberately: `javafx.scene.Node` stays fully qualified in both controllers, because both already import flexmark's `Node`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Nice work — went through this and all three fixes hold up. A few things I verified against the codebase, in case it's useful for the record:
I'm pushing a small follow-up commit for two things:
Two I left alone rather than changing:
Also worth noting the fully-qualified One caveat: I don't have a Windows ARM64 machine, so the runtime symptoms (the 8191-character command-line overflow and the WebView |
Cervator
left a comment
There was a problem hiding this comment.
Had agent check locally and looked over a few things. Ran the launcher from source on my M1 Mac and it ran fine, then downloaded a game release which promptly failed due to natives - but that's the old stable release and as such probably not unexpected 👍
…bView crash (#727) * platform: recognize Windows on ARM64 Platform.fromOsAndArch() had no case for OS.WINDOWS + Arch.ARM64, even though Arch.ARM64 already existed and jre.gradle.kts already builds a dedicated "WindowsArm64" JRE distribution. Every launch on that distribution hit: Unsupported platform: OS 'WINDOWS', arch 'ARM64' and failed before the launcher configuration was even created. Also adds Platform#supportsWebView(), used by a follow-up commit: it identifies the one platform where OpenJFX's javafx.web module is present but not functional. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * build: use a wildcard classpath in the Windows start script CreateStartScripts's default Windows template lists every dependency jar individually with its full absolute path substituted in for APP_HOME. With ~150 jars this comfortably exceeds cmd.exe's 8191-character line length limit once installed, and the script fails immediately with: The input line is too long. The syntax of the command is incorrect. This mainly affects the "windows-arm64" distribution: unlike Windows64, it has no launch4j .exe wrapper (jre.gradle.kts only wires createExe/createTerasologyExe in for os == "Windows64"), so it's the only Windows target that actually ships and depends on this generated .bat. The .exe wrapper already sidesteps this with a plain `classpath.set(listOf("lib/*"))` in build.gradle.kts - apply the same wildcard here instead of Gradle's per-jar $classpath. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * ui: fall back to plain text where WebView isn't available Both the Changelog and About tabs eagerly construct a WebView on launcher startup. OpenJFX has never shipped a WebKit native library for Windows/aarch64 (see https://bugs.openjdk.org/browse/JDK-8314064, whose PR explicitly excludes javafx.web and javafx.media - the follow-up media port was attempted separately and abandoned after crashing, and no equivalent webkit port exists at all), so on that platform merely instantiating a WebView throws UnsatisfiedLinkError from WebEngine's static initializer, and the whole launcher fails to start. javafx.application.Platform.isSupported(ConditionalFeature.WEB) is *not* a reliable guard for this: it only reports whether the javafx.web module was compiled in, not whether its native library actually works on the current OS/arch. Verified empirically - on a real Windows/aarch64 machine with BellSoft's JRE it returns true and then crashes anyway, because that vendor JRE still bundles a javafx.web module (for API compatibility, presumably reusing the Linux-classified artifact) with no working backend behind it. Use the new Platform#supportsWebView() instead, which is exact about the one platform this currently affects. Where WebView isn't supported: the Changelog tab shows raw Markdown text, and the About tab strips HTML tags via Jsoup before displaying plain text - both readable, neither a rendering match for the WebView-based HTML view, but the launcher starts instead of crashing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor: declare jsoup explicitly and share the WebView-support check Two follow-ups from review of the windows-arm64 fixes; no behaviour change intended on any platform. `AboutViewController` now uses jsoup directly, but jsoup was only on the classpath transitively, via `flexmark-all`'s html2md converter. That compiles today and would keep compiling right up until flexmark is bumped or narrowed to the modules actually used — at which point the break surfaces as an error in the About tab rather than as a missing dependency. Declared at 1.15.4, the version flexmark already resolves, so the dependency graph is unchanged. The WebView-support check was copied into both view controllers, each with its own comment and its own evaluation timing (`static final` in one, per-`initialize()` in the other). Since it answers a question about the platform, not about either view, it moves to `Platform.currentSupportsWebView()` — one home for the fallback policy, and one place to extend when the next platform needs it. Left alone deliberately: `javafx.scene.Node` stays fully qualified in both controllers, because both already import flexmark's `Node`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Rasmus Praestholm <cervator@gmail.com>
What's broken
The nightly
windows-arm64distribution currently can't start at all, for three independent reasons hit one after another:Platform.fromOsAndArch()has no case for Windows+ARM64.Arch.ARM64already exists andjre.gradle.ktsalready builds a dedicatedWindowsArm64JRE distribution, but the platform check throwsUnsupported platform: OS 'WINDOWS', arch 'ARM64'before the launcher configuration is even created.The generated
bin\TerasologyLauncher.batcrashes withThe input line is too long.Gradle's default Windows start-script template lists every dependency jar individually with its full absolute path substituted in. With ~150 jars that easily exceeds cmd.exe's 8191-character line limit once installed. This mainly biteswindows-arm64specifically: unlikeWindows64, it has no launch4j.exewrapper (jre.gradle.ktsonly wirescreateExe/createTerasologyExein foros == "Windows64"), so it's the only Windows target that ships and depends on this generated.bat. The.exewrapper already avoids this withclasspath.set(listOf("lib/*"))inbuild.gradle.kts.Constructing a
WebView(Changelog and About tabs) throwsUnsatisfiedLinkError. OpenJFX has never shipped a working WebKit native library for Windows/aarch64 - see JDK-8314064 / openjdk/jfx#439, whose own description says it's "cross compiling JavaFX base modules (excluding media and webkit) for Windows AArch64." The media follow-up was attempted separately and abandoned after runtime crashes; no webkit port exists at all. Note thatjavafx.application.Platform.isSupported(ConditionalFeature.WEB)is not a reliable guard here - verified empirically, it returnstrueon a real Windows/aarch64 machine (BellSoft's vendor JRE still bundles ajavafx.webmodule for API compatibility) and then crashes anyway.What this PR does
platform: recognize Windows on ARM64- addsWINDOWS_ARM64to thePlatformenum, plusPlatform#supportsWebView()used by the third commit.build: use a wildcard classpath in the Windows start script- switchesbuildres/scripts/windowsStartScript.txtfrom Gradle's per-jar$classpathto%APP_HOME%/lib/*, matching what the launch4j.exealready does.ui: fall back to plain text where WebView isn't available-ChangelogViewControllerandAboutViewControllernow checkPlatform#supportsWebView()before constructing aWebView, falling back to a plainTextArea(HTML docs have their tags stripped via Jsoup) instead of crashing the whole launcher.Testing
Verified end-to-end on a real Windows 11 ARM64 machine using the official nightly
windows-arm64distribution (4.9.0-dev.19+2da4e3f): patchedTerasologyLauncher.jarin place with these changes (compiled against Java 17 target, i.e. bytecode-compatible with the bundled BellSoft JRE) and confirmed the launcher starts and its main window comes up, where it previously failed at three successive points as described above.🤖 Generated with Claude Code