fix(natives): static-link win32 MSVC CRT so addon needs no VC++ redist
The shipped win32-x64 pi_natives addon linked the dynamic MSVC CRT (/MD)
and imported VCRUNTIME140.dll from the Visual C++ Redistributable, which
is absent on a clean Windows install. LoadLibrary of the extracted .node
then failed with error 126 ("The specified module could not be found"),
so omp could not start after a fresh `irm install.ps1 | iex`.
Static-link the CRT for the win32 addon: +crt-static for rustc (crate
BUILD select) plus the static_link_msvcrt cc feature enabled for win32 in
the native_addon transition, so its C deps (opus/cmake, tree-sitter,
blake3, ring) compile /MT in lock-step. The rebuilt .node imports only
core Windows system DLLs -- no VCRUNTIME140.dll, no api-ms-win-crt-*.
Fixes #8439
This commit is contained in:
@@ -40,6 +40,13 @@ rust_shared_library(
|
||||
# cdylib at all; napi musl addons have always linked the dynamic CRT.
|
||||
"//bazel/triples:x86_64-unknown-linux-musl": ["-Ctarget-feature=-crt-static"],
|
||||
"//bazel/triples:aarch64-unknown-linux-musl": ["-Ctarget-feature=-crt-static"],
|
||||
# Statically link the MSVC CRT so the shipped .node does not import
|
||||
# VCRUNTIME140.dll from the Visual C++ Redistributable, which is absent
|
||||
# on a clean Windows install and makes the loader's dlopen fail with
|
||||
# "The specified module could not be found" (error 126). The C deps are
|
||||
# switched to /MT in lock-step via the static_link_msvcrt cc feature in
|
||||
# the native_addon transition (bazel/defs.bzl).
|
||||
"//bazel/triples:x86_64-pc-windows-msvc": ["-Ctarget-feature=+crt-static"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
version = "17.1.5",
|
||||
|
||||
Reference in New Issue
Block a user