Windows: statically link msvcrt into Bazel #8328
Labels
area-Windows
Windows-specific issues and feature requests
P4
This is either out of scope or we don't have bandwidth to review a PR. (No assignee)
team-OSS
Issues for the Bazel OSS team: installation, release processBazel packaging, website
type: feature request
Description of the problem / feature request:
Link msvcrt statically into Bazel.
Feature requests: what underlying problem are you trying to solve with this feature?
To not require the user installing the VC redistributable DLLs before running Bazel (e.g. msvcrt140.dll).
These DLLs are likely installed for most users because virtually every MSVC-built binary requires them (except the statically linked ones). However these DLLs are not part of the default Windows installation, so both Desktop and Server versions lack them.
It would improve first-time Bazel usage if the user didn't have to install these DLLs before running Bazel.
Prerequisites:
@bazel_tools//tools/cpp/runfiles
should have this feature enabledWhat operating system are you running Bazel on?
Windows 10
What's the output of
bazel info release
?0.26.0 rc8
Any other information, logs, or outputs that you want to share?
As an experimented, I took a033de4 and updated all packages with cc_library and cc_binary deps of Bazel with:
to link msvcrt statically.
The good news is, it's possible and Bazel works on a clean Windows Server image without the DLLs.
The even better news is, it only adds about 1.5MB to the Bazel binary (46,105,380 bytes vs. 47,611,573 bytes).
The text was updated successfully, but these errors were encountered: