Repository navigation
fix(desktop): repair webview and raw backends on Windows (laufey v0.4.1) - #35566
Conversation
locate_dev_backend_binary only ever looked for extensionless binaries (target/release/laufey_winit, webview/build/laufey_webview, ...), so LAUFEY_DEV_DIR could never resolve a backend on Windows, where cargo / cmake emit laufey_winit.exe etc. Append the host EXE_SUFFIX to the bare build-tree paths. Co-Authored-By: Divy Srivastava <me@littledivy.com>
Windows 11 verification β all three backendsReproduced and fixed on a real Windows 11 box (x86_64),
|
laufey v0.4.1 fixes the `webview` and `raw` (winit) desktop backends on
Windows (littledivy/laufey#... , released from littledivy/laufey main):
- raw/winit declared API v25 with a struct missing the v26 scheme vtable
fields, so the capi rejected it ("API version mismatch: expected 26, got
25" / "Runtime init failed -2").
- webview created the WebView2 environment off the UI thread, failing with
CO_E_NOTINITIALIZED (blank window) or crashing (0xc0000409); WebView2 work
is now marshaled to the UI thread.
Bump the dependency and regenerate cli/laufey_sums.lock from the v0.4.1
SHA256SUMS (digests verified against the published archives out-of-band).
Co-Authored-By: Divy Srivastava <me@littledivy.com>
|
Upstream: the backend fixes are in littledivy/laufey The screenshots above were captured running the published v0.4.1 |
Regression test for locate_dev_backend_binary finding the host-suffixed dev backend (laufey_winit.exe on Windows). Co-Authored-By: Divy Srivastava <me@littledivy.com>
locate_dev_backend_winit_target_paths created the extensionless
'laufey_winit' and asserted it resolves, but locate_dev_backend_binary
now looks for the host EXE_SUFFIX ('laufey_winit.exe' on Windows). Build
the fixture path with the same suffix so the test holds on all hosts.
(This is the test that 'test libs debug windows-x86_64' caught β it is
skipped on draft runs, so it only surfaced after marking the PR ready.)
Co-Authored-By: Divy Srivastava <me@littledivy.com>



Fixes
deno desktopon Windows, where thewebviewandrawbackends were broken (cefworked). The root cause was in thelaufeynative backend runtime (littledivy/laufey); this PR consumes the fixed laufey v0.4.1 and adds a Windows dev-workflow fix.The two laufey bugs (fixed upstream in laufey v0.4.1)
raw(winit) β the backend still declaredLAUFEY_API_VERSION = 25and itslaufey_backend_apistruct was missing the five custom-scheme vtable pointers added to the C ABI in v26. The deno-side capi (v26) rejects any backend whose version != 26, so it failed to load:Fixed by adding the five trailing fields (null) so the struct matches the v26 layout, and bumping the constant to 26.
webviewβFailed to create WebView2 environment(CO_E_NOTINITIALIZED, blank window), or an immediate0xc0000409crash for some users. WebView2 is single-threaded-apartment; the message loop runs on WinMain's thread, butcreate_windowran WebView2 creation directly on the runtime's worker thread (no COM init, no message pump) β environment creation fails and the controller callback never fires. Fixed by marshaling all WebView2/COM work to the UI thread (message-only dispatcher window +RunOnUiThread). Also hardens theapp://path that was suspected upstream (retry env creation without the custom scheme;try/catcharound the resource handler).deno-side changes here
laufey0.4.0β0.4.1and regeneratecli/laufey_sums.lockfrom the v0.4.1SHA256SUMS(digests verified against the published archives out-of-band).locate_dev_backend_binaryonly ever looked for extensionless binaries, soLAUFEY_DEV_DIRcould never resolve a backend on Windows (laufey_winit.exeetc.). Append the hostEXE_SUFFIX.Verification (Windows 11, x86_64)
Reproduced both failures and verified the fix end-to-end through deno's real download/launch path with the published v0.4.1 backend archives. All three backends now open a working native window β before/after screenshots in the comment below.
Refs #35562
Closes denoland/divybot#610