Skip to content

fix: statically link CRT on Windows - #86

Merged
tamirelazar merged 5 commits into
devfrom
fix/windows-static-crt
Jun 27, 2026
Merged

fix: statically link CRT on Windows#86
tamirelazar merged 5 commits into
devfrom
fix/windows-static-crt

Conversation

@tamirelazar

Copy link
Copy Markdown
Owner

Problem

Windows install instructions silently fail: typing tslime in a new PowerShell produces no error and no output.

Root cause

The prebuilt Windows binary targets x86_64-pc-windows-msvc and dynamically linked the MSVC C runtime (vcruntime140.dll, api-ms-win-crt-*). On a clean Windows without the VC++ 2015–2022 redistributable, tslime.exe fails to launch with STATUS_DLL_NOT_FOUND (0xc0000135). PowerShell shows nothing for a failed image load, so the command appears to do nothing. (A PATH problem would instead print not recognized.)

Also contradicted the README's "zero runtime dependencies, single static binary" claim — true on Linux (musl) but not Windows.

Fix

  • Add .cargo/config.toml forcing +crt-static for the windows-msvc target. Bakes the runtime into the binary; covers both the release pipeline and cargo install from source.
  • Harden the README PowerShell snippet to handle an unset User Path (avoids a leading ;).

Test plan

  • cargo metadata parses the new config; macOS/Linux builds unaffected (config scoped to the windows-msvc target only).
  • Needs a fresh release built from this config, then verify tslime.exe launches the TUI on a clean Windows VM (no VC++ redist).

Release v0.1.0: promote dev to master
…edist

The prebuilt Windows binary targets x86_64-pc-windows-msvc and dynamically
linked the MSVC C runtime (vcruntime140.dll, api-ms-win-crt-*). On a clean
Windows lacking the VC++ 2015-2022 redistributable, tslime.exe failed to
launch with STATUS_DLL_NOT_FOUND (0xc0000135) — silently, producing no
PowerShell error and no output, so 'tslime' appeared to do nothing.

Add .cargo/config.toml forcing +crt-static for the windows-msvc target so
the runtime is baked into the binary. This restores the 'zero runtime
dependencies, single static binary' guarantee on Windows (the Linux musl
build is already static) and covers both the release pipeline and
'cargo install' from source.

Also harden the README PowerShell install snippet to handle an unset User
Path (avoids writing a leading ';' into PATH).
Windows static-CRT fix (see CHANGELOG).
@tamirelazar
tamirelazar merged commit 6bdeac6 into dev Jun 27, 2026
3 checks passed
@tamirelazar
tamirelazar deleted the fix/windows-static-crt branch June 28, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant