Commit f93254b
authored
fix: add +crt-static to Windows rustflags to eliminate vcruntime140.dll dependency (#407)
The Windows-specific `[target.'cfg(target_os = "windows")']` rustflags
sections in `.cargo/config.toml.disabled` were **overriding** the global
`[build].rustflags`, silently dropping `-Ctarget-feature=+crt-static`.
This caused the shipped `pet.exe` to dynamically link `VCRUNTIME140.dll`
and several UCRT DLLs, breaking Python environment detection on
enterprise machines without the VC++ Redistributable installed.
**Changes:**
- Add `-Ctarget-feature=+crt-static` to both Windows target-specific
`rustflags` sections
- Narrow the global `[build]` section to `cfg(target_os = \"linux\")` to
avoid ambiguity
**Verified locally:** rebuilt `pet.exe` with the fix —
`VCRUNTIME140.dll` and all `api-ms-win-crt-*` imports are eliminated.
Fixes #4061 parent 130b29f commit f93254b
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
| 8 | + | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
| 19 | + | |
0 commit comments