fix(ci): inject libatomic for mips and force static linking
Some checks failed
Build MIPS Binary / build (push) Failing after 1m2s

This commit is contained in:
spinline
2026-02-06 23:41:30 +03:00
parent 146b312b4c
commit 0985f328e2
2 changed files with 18 additions and 2 deletions

View File

@@ -31,9 +31,12 @@ jobs:
trunk build --release trunk build --release
- name: Build Backend (MIPS) - name: Build Backend (MIPS)
env:
# Ensure we are building a fully static binary
RUSTFLAGS: "-C target-feature=+crt-static"
run: | run: |
cd backend cd backend
cargo zigbuild --target mips-unknown-linux-musl --release -Z build-std=std,panic_abort cargo zigbuild --target mips-unknown-linux-musl --release
file target/mips-unknown-linux-musl/release/backend file target/mips-unknown-linux-musl/release/backend
- name: Rename Binary - name: Rename Binary

View File

@@ -60,7 +60,20 @@ RUN . "$HOME/.cargo/env" && \
# Install wasm-bindgen-cli (Compiling from source to avoid glibc issues, doing it ONCE here) # Install wasm-bindgen-cli (Compiling from source to avoid glibc issues, doing it ONCE here)
cargo install wasm-bindgen-cli --version 0.2.108 cargo install wasm-bindgen-cli --version 0.2.108
# 6. Install Gitea Act Runner Binary # 6. Fix: Create dummy libatomic.a for MIPS
# openssl-sys demands -latomic, but Zig provides the symbols in compiler-rt.
# We create an empty archive to satisfy the linker.
RUN . "$HOME/.cargo/env" && \
echo '' > atomic.c && \
/root/zig/zig cc -target mips-linux-musl -c -o atomic.o atomic.c && \
/root/zig/zig ar rcs libatomic.a atomic.o && \
RUST_SYSROOT=$(rustc --print sysroot) && \
TARGET_LIB_DIR="$RUST_SYSROOT/lib/rustlib/mips-unknown-linux-musl/lib" && \
mkdir -p "$TARGET_LIB_DIR" && \
cp libatomic.a "$TARGET_LIB_DIR/" && \
rm atomic.c atomic.o libatomic.a
# 7. Install Gitea Act Runner Binary
# We fetch the binary directly to run as the entrypoint # We fetch the binary directly to run as the entrypoint
RUN ARCH=$(dpkg --print-architecture) && \ RUN ARCH=$(dpkg --print-architecture) && \
VERSION="0.2.11" && \ VERSION="0.2.11" && \