From 0f594f44bc50897ffdd1dbdb31b2b020bc692c20 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 19 Jun 2023 23:51:54 +0200 Subject: [PATCH] ci: install musl target via `rust-toolchain.toml` file (#1664) Targets specified in the `rust-toolchain.toml` file are automatically installed by `rustup`. This avoid setup steps for other devs and also simplifies the CI setup. To be able to compile native code to musl, we do need `musl-gcc` which comes with the `musl-tools` package on ubuntu. --- .github/workflows/rust.yml | 2 +- rust/rust-toolchain.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 07e915b1d..43c68d624 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -51,7 +51,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: workspaces: ./rust - - run: rustup target add x86_64-unknown-linux-musl + - run: sudo apt-get install -y musl-tools - run: cargo build --bin relay --target x86_64-unknown-linux-musl relay_smoke: diff --git a/rust/rust-toolchain.toml b/rust/rust-toolchain.toml index f15cd1c92..2989cbb2e 100644 --- a/rust/rust-toolchain.toml +++ b/rust/rust-toolchain.toml @@ -1,3 +1,4 @@ [toolchain] channel = "1.70.0" components = ["rustfmt", "clippy"] +targets = ["x86_64-unknown-linux-musl"]