[Bug] --windows-toolchain gnu --keep-binary: raw .exe won't start, WebView2Loader.dll is not copied next to it
Search before asking
- I searched in the issues and found nothing similar.
Pake version
pake-cli 3.17.2 (installed project-locally)
Rust version
rustc 1.98.1 (48a229cea 2026-09-01) rustup 1.29.1 (d95a37b6a 2026-08-13)
Package Manager
npm
System version
Windows 11 Pro 10.0.26200 x64, WebView2 Runtime 153
Node.js version
v22.13.1
Build Command
pake ./dist --use-local-file --name Demo --windows-toolchain gnu --keep-binary--use-local-file isn't required: pake https://example.com --name Demo --windows-toolchain gnu --keep-binary behaves the same way, because the DLL dependency comes from the GNU link, not from the app contents.
Minimal reproduce step
- On Windows, with a GNU Rust toolchain and MinGW gcc on
PATH, run the build command above. - The MSI installs and runs fine.
- Run the kept raw binary next to it:
./Demo.exe
What did you expect to see?
Demo.exe starts, like the app installed from Demo.msi.
What did you see instead?
The process exits immediately. From Git Bash:
Demo.exe: error while loading shared libraries: api-ms-win-core-winrt-l1-1-0.dll: cannot open shared object file: No such file or directoryThe DLL named there is misleading, since that API set exists on every Windows 10/11 system. The exe's import table shows the real missing dependency:
$ objdump -p Demo.exe | grep "DLL Name" | sort -u
DLL Name: WebView2Loader.dll <- the only non-system DLL
DLL Name: KERNEL32.dll
DLL Name: api-ms-win-core-winrt-l1-1-0.dll
...Copying WebView2Loader.dll from src-tauri/target/x86_64-pc-windows-gnu/release/ next to the exe fixes it.
Anything else?
Cause
webview2-com-sys(0.38.2,src/lib.rs) linksWebView2LoaderStaticstatically on MSVC. On GNU it can't, so it links theWebView2Loader.dllimport library instead. A GNU-built exe therefore needs the DLL at runtime.tauri-build(2.5.5,src/lib.rs,target_env == "gnu"branch) copiesWebView2Loader.dllintotarget/<triple>/release/.- Tauri's MSI bundler includes it (it appears in the generated
wix/x64/main.wxs), so the MSI is fine. - Pake's
copyRawBinary()copies onlypake-<name>.exeinto the output directory, so the--keep-binaryoutput isn't runnable on its own.
MSVC builds are unaffected, because the loader is linked statically there.
Proposed fix
With the gnu toolchain, have WinBuilder copy WebView2Loader.dll from the same build directory as the raw binary into the output directory, record it as an artifact in --json output, and mention it in the success log. Also add a line to the --windows-toolchain / --keep-binary docs. I have the fix ready and will open the PR.
Are you willing to submit a PR?
- I'm willing to submit a PR!
Source: tw93/Pake