ci: support static cross-compilation with vendored UCI
Add Dockerfile.ci with pkg-config for vendored UCI builds. Switch Jenkinsfile from pre-built Docker images to Dockerfile-based agents for full control over the build environment. Add static CRT linking via RUSTFLAGS for standalone static binaries across the CI matrix.
This commit is contained in:
2 files changed
+13
-3
No files matched your search
@@ -0,0 +1,7 @@
|
|||||||
|
ARG TARGET
|
||||||
|
|
||||||
|
FROM ghcr.io/rust-cross/rust-musl-cross:${TARGET}
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends pkg-config \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
Vendored
+6
-3
@@ -12,9 +12,9 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
agent {
|
agent {
|
||||||
docker {
|
dockerfile {
|
||||||
image "ghcr.io/rust-cross/rust-musl-cross:${TARGET}"
|
filename 'Dockerfile.ci'
|
||||||
alwaysPull true
|
additionalBuildArgs "--pull --build-arg TARGET=${TARGET}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,6 +44,9 @@ pipeline {
|
|||||||
echo "----------------------------------"
|
echo "----------------------------------"
|
||||||
|
|
||||||
# 5. Check Toolchain & Build
|
# 5. Check Toolchain & Build
|
||||||
|
# Force standalone static artifacts across the entire CI matrix.
|
||||||
|
export RUSTFLAGS="${RUSTFLAGS:+$RUSTFLAGS }-C target-feature=+crt-static"
|
||||||
|
|
||||||
# We grep for "nightly" in the version string (e.g., "rustc 1.95.0-nightly...")
|
# We grep for "nightly" in the version string (e.g., "rustc 1.95.0-nightly...")
|
||||||
if rustc -V | grep -q "nightly"; then
|
if rustc -V | grep -q "nightly"; then
|
||||||
echo "Detected Nightly toolchain. Enabling '-Z build-std' to support panic=abort..."
|
echo "Detected Nightly toolchain. Enabling '-Z build-std' to support panic=abort..."
|
||||||
|
|||||||
Reference in new issue
Block a user