diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f7008c3c4..cd2d085b72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,10 @@ jobs: - name: Check run: cargo check --workspace --all-targets --all-features + # Check with musl libc target which is used for `deltachat-rpc-server` releases. + - name: Check musl + run: scripts/zig-musl-check.sh + cargo_deny: name: cargo deny runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index 15900472ae..634d081f51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2661,9 +2661,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.145" +version = "0.2.146" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc86cde3ff845662b8f4ef6cb50ea0e20c524eb3d29ae048287e06a1b3fa6a81" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" [[package]] name = "libm" diff --git a/scripts/zig-musl-check.sh b/scripts/zig-musl-check.sh new file mode 100755 index 0000000000..1e4afd6db1 --- /dev/null +++ b/scripts/zig-musl-check.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Run `cargo check` with musl libc. +# This requires `zig` to compile vendored openssl. + +set -x +set -e + +unset RUSTFLAGS + +# Pin Rust version to avoid uncontrolled changes in the compiler and linker flags. +export RUSTUP_TOOLCHAIN=1.70.0 + +ZIG_VERSION=0.11.0-dev.2213+515e1c93e + +# Download Zig +rm -fr "$ZIG_VERSION" "zig-linux-x86_64-$ZIG_VERSION.tar.xz" +wget "https://ziglang.org/builds/zig-linux-x86_64-$ZIG_VERSION.tar.xz" +tar xf "zig-linux-x86_64-$ZIG_VERSION.tar.xz" +export PATH="$PWD/zig-linux-x86_64-$ZIG_VERSION:$PATH" + +rustup target add x86_64-unknown-linux-musl +CC="$PWD/scripts/zig-cc" \ +TARGET_CC="$PWD/scripts/zig-cc" \ +CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER="$PWD/scripts/zig-cc" \ +LD="$PWD/scripts/zig-cc" \ +ZIG_TARGET="x86_64-linux-musl" \ +cargo check --release --target x86_64-unknown-linux-musl -p deltachat_ffi --features jsonrpc diff --git a/scripts/zig-rpc-server.sh b/scripts/zig-rpc-server.sh index e411b20bb8..ee96905bb7 100755 --- a/scripts/zig-rpc-server.sh +++ b/scripts/zig-rpc-server.sh @@ -8,7 +8,7 @@ set -e unset RUSTFLAGS # Pin Rust version to avoid uncontrolled changes in the compiler and linker flags. -export RUSTUP_TOOLCHAIN=1.68.1 +export RUSTUP_TOOLCHAIN=1.70.0 ZIG_VERSION=0.11.0-dev.2213+515e1c93e