Repository navigation
fix(tauri): restore the Linux renderer environment, re-enabling SharedArrayBuffer (0.1.19) - #343
Merged
Merged
Conversation
…dArrayBuffer The WebKitGTK adapter rewrite dropped `prepare_renderer_environment`, so the view no longer sets `JSC_useSharedArrayBuffer=1` before Wry launches WebKit. JavaScriptCore gates `SharedArrayBuffer` behind that switch, and a cross-origin-isolated page alone does not enable it, so `SharedArrayBuffer` became undefined in every Linux view. A guest that uses threads then fails at the first worker message: an Emscripten pthread build rejects in `loadWasmModuleToWorker` and never paints. Observed with fastled-wasm's viewer, whose render smoke passes on v0.1.11 and fails from 0.1.15 on. A probe page reports `crossOriginIsolated=true` with `SharedArrayBuffer=undefined` before this change and `=function` after, and the viewer then renders a full frame. The NVIDIA explicit-sync and DMABUF-renderer workarounds were lost with the same function and come back with it. Existing user values still win, and the decision table is unit-tested. Release 0.1.19. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
zackees
added a commit
to FastLED/cli
that referenced
this pull request
Sep 21, 2026
0.1.15 through 0.1.18 dropped the WebKitGTK renderer environment, so the Linux view never set JSC_useSharedArrayBuffer=1 and SharedArrayBuffer was undefined. The viewer's Emscripten pthread build then rejected in loadWasmModuleToWorker and never painted a canvas, which is what the render smoke caught. forge-ci/kernal-api#343 restores it in 0.1.19. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
zackees
added a commit
to FastLED/cli
that referenced
this pull request
Sep 21, 2026
* build: depend on kernal-api 0.1.18 from crates.io, as one crate The git dependency on kernal-api's repository becomes an exact crates.io pin, for both the library and the build script. kernal-api 0.1.18 amalgamated its build-script companion into the one crate, so build.rs now calls kernal_api::build_resources and the build-dependency is kernal-api itself with default-features = false and only the build-resources feature. The viewer feature no longer forwards kernal-api/tauri-webview: Cargo applies a `kernal-api/<feature>` entry in this package's feature table to every dependency of that name, including the build-dependency, which would compile Tauri, GTK and glib for the host build script. Tauri is enabled on the normal dependency declaration instead, and `viewer` gates only this crate's own code. The build script's dependency graph is 16 crates: kernal-api's native base plus the resource compiler. The boundary tests pin the exact version for both dependency kinds, assert the lockfile resolves both from the crates.io registry rather than a patch, git source or path override, and reject any `kernal-api/<feature>` entry in this package's feature table. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * build: take kernal-api 0.1.19, which restores SharedArrayBuffer on Linux 0.1.15 through 0.1.18 dropped the WebKitGTK renderer environment, so the Linux view never set JSC_useSharedArrayBuffer=1 and SharedArrayBuffer was undefined. The viewer's Emscripten pthread build then rejected in loadWasmModuleToWorker and never painted a canvas, which is what the render smoke caught. forge-ci/kernal-api#343 restores it in 0.1.19. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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 regression
The WebKitGTK adapter rewrite dropped
prepare_renderer_environment, so the Linux view no longer setsJSC_useSharedArrayBuffer=1before Wry launches WebKit. JavaScriptCore gatesSharedArrayBufferbehind that switch — a cross-origin-isolated page alone does not enable it — soSharedArrayBufferhas been undefined in every Linux view since 0.1.15.Any guest that uses threads then fails at its first worker message. An Emscripten pthread build rejects inside
loadWasmModuleToWorkerand never paints.Evidence
Found from fastled-wasm's viewer, whose CI render smoke passes on
v0.1.11and fails on 0.1.15+ (it fails identically on a re-run, and reproduces locally). Bisected with a probe page injected into the served sketch:crossOriginIsolatedSharedArrayBufferfunctionundefinedloadWasmModuleToWorker, no canvasfunctionWith this fix, fastled-wasm's render smoke passes locally end to end: exit 0, no unhandled rejection,
ci/check_render.pyreports 28160/28160 pixels lit, and the late-screenmap recovery marker is present.The fix
Restores
HostFacts/environment_overrides/detect_host/prepare_renderer_environmentand calls it fromNativeWebviewLoop::newbeforeWry::new, where it ran before. The NVIDIA explicit-sync and DMABUF-renderer workarounds were lost with the same function and come back with it. Existing user values still win, and the decision table keeps its unit test.Also bumps to 0.1.19, so this ships.
Local validation: fmt,
clippy --no-default-features --features tauri-webview --lib -D warnings, thelinux_webkitgtkunit tests (4 passed),--test source_policy(21 passed).🤖 Generated with Claude Code