From e95c40765f591c3e8144773fdb2a1bde2f6da9b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Cabrera?= Date: Mon, 17 Jun 2024 13:30:05 -0400 Subject: [PATCH] Statically link to the C runtime in MSVC Javy version 1.4.0 statically linked to the C runtime. Such version was built with Rust 1.75. Javy version 2.0.0, built with Rust 1.79.0, which doesn't perform static linking by default. This commit adds a directive to preserve the same behavior as in v 1.4.0. --- .cargo/config.toml | 6 ++++++ .github/workflows/ci.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 2bcccfe9a..949ef543f 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -4,3 +4,9 @@ # https://doc.rust-lang.org/cargo/reference/config.html [target.wasm32-wasi] rustflags = ["-C", "target-feature=+simd128"] + +# We want to ensure that all the MSVC dependencies are statically resolved and +# included in the final CLI binary. +# Ref: https://github.com/rust-lang/rust/pull/122268 +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 179c28d17..47e5d5bfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: cli: name: test_cli - runs-on: ubuntu-latest + runs-on: [ubuntu-latest] needs: core steps: - uses: actions/checkout@v4