Repository navigation
fix: copy WebView2Loader.dll beside the kept GNU Windows binary - #1403
Merged
tw93 merged 1 commit intoOct 4, 2026
Merged
Conversation
With --windows-toolchain gnu, webview2-com-sys links the WebView2Loader.dll import library instead of WebView2LoaderStatic, so the exe needs the DLL at runtime. tauri-build places it beside the binary and the MSI bundles it, but --keep-binary copied only the exe, which then failed to start. WinBuilder now copies the DLL next to the kept exe on gnu, records it as a dll artifact for --json, and logs it. MSVC builds are unchanged. tw93#1402
2 tasks done
Owner
|
@BenzidaneMo Thanks for the focused fix. It is merged and shipped in pake-cli 3.17.3: Run |
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.
Related: #1402
Cause
With
--windows-toolchain gnu,webview2-com-sys(0.38.2) can't linkWebView2LoaderStaticthe way it does on MSVC. It links theWebView2Loader.dllimport library instead, so a GNU-built exe needs that DLL at runtime.tauri-build(2.5.5,target_env == "gnu"branch) copies the DLL intotarget/x86_64-pc-windows-gnu/<profile>/, and Tauri's MSI bundler includes it, so the MSI works.copyRawBinary()only copiespake-<name>.exe→<name>.exe, though, so the--keep-binaryoutput doesn't start. Git Bash namesapi-ms-win-core-winrt-l1-1-0.dllas the missing library, which is misleading.objdump -pshows thatWebView2Loader.dllis the only non-system import.Change
WinBuilderoverridescopyRawBinary. With thegnutoolchain, it also copiesWebView2Loader.dllfrom the raw binary's build directory next to the output.exe. If the DLL is missing, it warns and doesn't fail the build.WinBuilderoverridescopyBuildArtifactsto record the DLL as adllartifact (listed after the binary in--jsonoutputs) and to log✔ WebView2Loader.dll copied beside it — keep them togetherafter "Raw binary located in".BaseBuilderis not touched.--windows-toolchainand--keep-binarynotes incli-usage.md/cli-usage_CN.md.dist/cli.jsrebuilt.Testing
Unit tests (
tests/unit/windows-toolchain.test.ts, using temp dirs):copyBuildArtifactswithkeepBinaryrecordsmsi→binary→dll.The three GNU cases fail without the fix.
npx vitest run: 498 passed, 3 skipped.pnpm run cli:buildis clean.Real build: Windows 11, rustc
stable-x86_64-pc-windows-gnu, MSYS2 UCRT64 gcc on PATH.node dist/cli.js https://example.com --name GnuTest --windows-toolchain gnu --keep-binaryproducesGnuTest.msi,GnuTest.exeandWebView2Loader.dll, with the new log line.GnuTest.exestarts and opens its window.api-ms-win-core-winrt-l1-1-0.dllerror (exit 127).objdump -p GnuTest.exe:WebView2Loader.dllis the only non-system import.--json:outputslistsmsi,binaryanddllwith sizes.MSVC: not built locally (no Build Tools on this machine). The msvc path is covered by the unit test, and it takes no new branch in the code.