Link the VC runtime statically into twcore.exe - #277
Merged
Merged
Conversation
twcore.exe imported VCRUNTIME140.dll, which Windows does not ship: it comes with the Visual C++ Redistributable, usually installed by some other program. The desktop installer only carries twcore.exe, so on a machine without the redistributable the gateway cannot start. CI runners and most real machines have it installed, which is why nothing showed. - .cargo/config.toml: +crt-static for windows-msvc targets, so a local Windows build matches what is released. RUSTFLAGS overrides it, so the CI test builds stay dynamic; the release workflow does not set it. - release.yml: a step reads both exes' imports with dumpbin and fails if any Visual C++ runtime DLL is still there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Why
twcore.exe(checked on the v0.58.0 release asset) importsVCRUNTIME140.dll. Windows does not ship that DLL: it comes with the Visual C++ Redistributable, usually installed by some other program. The desktop installer only carriestwcore.exeand does not install the redistributable, so on a machine without it the gateway cannot start. CI runners and most real machines have it installed, which is why this never showed up.The desktop app's own exe is not affected: the Tauri CLI links its CRT statically.
What
.cargo/config.toml:-C target-feature=+crt-staticforcfg(all(windows, target_env = "msvc")). Setting it here, not in the workflow, means a local Windows build matches what gets released.RUSTFLAGSoverrides it, so the CI test builds (-D warnings) stay dynamic. The release workflow does not setRUSTFLAGS.release.yml: a new step, "No Visual C++ runtime to install". It reads both exes' imports with the MSVCdumpbinand fails if anyvcruntime*,msvcp*,concrt*,vccorlib*orvcomp*DLL is still there. The runner has the runtime installed, so the existing "x64 one runs" check cannot see this. Only the import table can.Verification
Release rehearsal (
workflow_dispatch) on this branch: https://github.com/ThinkWatchProject/ThinkWatch-Core/actions/runs/37108119457🤖 Generated with Claude Code