Skip to content

Commit a2599ef

Browse files
committed
ci: run cargo check with musl libc
1 parent 22d0a4b commit a2599ef

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.github/workflows/ci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ jobs:
3838
- name: Check
3939
run: cargo check --workspace --all-targets --all-features
4040

41+
# Check with musl libc target which is used for `deltachat-rpc-server` releases.
42+
- name: Check musl
43+
run: scripts/zig-musl-check.sh
44+
4145
cargo_deny:
4246
name: cargo deny
4347
runs-on: ubuntu-latest

scripts/zig-musl-check.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
#
3+
# Run `cargo check` with musl libc.
4+
# This requires `zig` to compile vendored openssl.
5+
6+
set -x
7+
set -e
8+
9+
unset RUSTFLAGS
10+
11+
# Pin Rust version to avoid uncontrolled changes in the compiler and linker flags.
12+
export RUSTUP_TOOLCHAIN=1.70.0
13+
14+
ZIG_VERSION=0.11.0-dev.2213+515e1c93e
15+
16+
# Download Zig
17+
rm -fr "$ZIG_VERSION" "zig-linux-x86_64-$ZIG_VERSION.tar.xz"
18+
wget "https://ziglang.org/builds/zig-linux-x86_64-$ZIG_VERSION.tar.xz"
19+
tar xf "zig-linux-x86_64-$ZIG_VERSION.tar.xz"
20+
export PATH="$PWD/zig-linux-x86_64-$ZIG_VERSION:$PATH"
21+
22+
rustup target add x86_64-unknown-linux-musl
23+
CC="$PWD/scripts/zig-cc" \
24+
TARGET_CC="$PWD/scripts/zig-cc" \
25+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER="$PWD/scripts/zig-cc" \
26+
LD="$PWD/scripts/zig-cc" \
27+
ZIG_TARGET="x86_64-linux-musl" \
28+
cargo check --release --target x86_64-unknown-linux-musl -p deltachat_ffi --features jsonrpc

0 commit comments

Comments
 (0)