From 774d80685e0cdf8ac984f628c750e97f076d7361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Walski?= Date: Fri, 5 Apr 2024 13:16:34 +0200 Subject: [PATCH 1/2] Statically linked VCRuntime --- Cargo.lock | 7 +++++++ Cargo.toml | 3 +++ build.rs | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 build.rs diff --git a/Cargo.lock b/Cargo.lock index 248756e..6993c33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4515,6 +4515,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "static_vcruntime" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "954e3e877803def9dc46075bf4060147c55cd70db97873077232eae0269dc89b" + [[package]] name = "stringprep" version = "0.1.4" @@ -5890,6 +5896,7 @@ dependencies = [ "reqwest", "serde", "serde_json", + "static_vcruntime", "thiserror", "tokio", "tokio-stream", diff --git a/Cargo.toml b/Cargo.toml index c632c86..b2e593a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,3 +57,6 @@ predicates = "3.1" [patch.crates-io] ya-core-model = { git = "https://github.com/golemfactory/yagna.git", rev = "9c5f97945d5b4ab3d36c23d0645e468b255974dc" } + +[build-dependencies] +static_vcruntime = "2.0" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..20e1c8e --- /dev/null +++ b/build.rs @@ -0,0 +1,3 @@ +fn main() { + static_vcruntime::metabuild(); +} From f2ccda6878c130ec8d93a627a98cc704fe5cfc7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Walski?= Date: Fri, 5 Apr 2024 13:58:43 +0200 Subject: [PATCH 2/2] Comment about why static_vcruntime is used. --- build.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/build.rs b/build.rs index 20e1c8e..bb7c32a 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,4 @@ fn main() { + // Without statically linked VCRuntime the app will require Visual C++ Redistributable installed on host OS. static_vcruntime::metabuild(); }