-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Windows MSVC builds of coreutils depend on vcruntime140.dll at runtime because Rust defaults to dynamic CRT linking for target_env = "msvc". This means the release .exe files are not self-contained — users without the Visual C++ Redistributable installed will get a missing-DLL error.
I see this when running some Bazel targets on a clean Windows 11 ARM machine (on Parallels Desktop).
(bazel-lib downloads uutils/coreutils now at https://github.com/bazel-contrib/bazel-lib/blob/main/lib/private/coreutils_toolchain.bzl)
The fix is to link CRT statically, which is quite easy to do.
For standalone utilities there are no downsides besides several hundred KBs bigger binaries.
How to test:
run https://github.com/lucasg/Dependencies or just dumpbin on coreutils.exe binary,
see VCRUNTIME140.dll dependency
I will provide a pull request