Skip to content

Commit 79f41e5

Browse files
tondrejAgentEnder
andauthored
feat(core): use static_vcruntime to avoid msvcrt dependency (#19781)
Closes #19779 <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior When targeting Windows the resulting binary (nx.dll) dynamically links against Microsoft Visual C++ runtime (msvcrt140.dll). This means nx won't be able to run on Windows systems without this runtime installed. ## Expected Behavior I'd like to avoid this dependency by linking the runtime statically into the nx binary. (This is also how e.g. cargo.exe for Windows is built.) ## Related Issue(s) Fixes #19779 --------- Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
1 parent 4f9be49 commit 79f41e5

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/nx/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ crate-type = ['cdylib']
107107

108108
[build-dependencies]
109109
napi-build = '2.1.3'
110+
static_vcruntime = '3.0'
110111

111112
[dev-dependencies]
112113
assert_fs = "1.0.10"

packages/nx/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
extern crate napi_build;
22

33
fn main() {
4+
static_vcruntime::metabuild();
45
napi_build::setup();
56

67
// Embed Windows resource metadata to establish binary legitimacy

0 commit comments

Comments
 (0)