Skip to content

Windows MSVC release binaries require vcruntime140.dll #10929

@shalupov

Description

@shalupov

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions