feat(config): migrate configuration loading to config-rs #68
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
+12
-9
@@ -11,10 +11,10 @@ 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}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ pipeline {
|
|||||||
# 1. Set CARGO_HOME to a writable directory in the workspace
|
# 1. Set CARGO_HOME to a writable directory in the workspace
|
||||||
export CARGO_HOME="$(pwd)/.cargo"
|
export CARGO_HOME="$(pwd)/.cargo"
|
||||||
mkdir -p "$CARGO_HOME"
|
mkdir -p "$CARGO_HOME"
|
||||||
|
|
||||||
# 2. Add local bin to PATH (for tools you might install)
|
# 2. Add local bin to PATH (for tools you might install)
|
||||||
export PATH="$(pwd)/.local/bin:${PATH}"
|
export PATH="$(pwd)/.local/bin:${PATH}"
|
||||||
|
|
||||||
@@ -44,14 +44,17 @@ 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..."
|
||||||
|
|
||||||
# Ensure rust-src is installed (needed for build-std)
|
# Ensure rust-src is installed (needed for build-std)
|
||||||
# We use '|| true' so it doesn't fail if already installed or network flakes
|
# We use '|| true' so it doesn't fail if already installed or network flakes
|
||||||
rustup component add rust-src || true
|
rustup component add rust-src || true
|
||||||
|
|
||||||
cargo build --release -Z build-std=std,panic_abort
|
cargo build --release -Z build-std=std,panic_abort
|
||||||
else
|
else
|
||||||
echo "Detected Stable toolchain. Building with standard pre-compiled library..."
|
echo "Detected Stable toolchain. Building with standard pre-compiled library..."
|
||||||
@@ -71,7 +74,7 @@ pipeline {
|
|||||||
# 2. Verify it exists
|
# 2. Verify it exists
|
||||||
if [ -f "$BINARY_PATH" ]; then
|
if [ -f "$BINARY_PATH" ]; then
|
||||||
echo "Found compiled binary at: $BINARY_PATH"
|
echo "Found compiled binary at: $BINARY_PATH"
|
||||||
|
|
||||||
# 3. Rename with the matrix tag (e.g., sqm-autorate-rust-aarch64-musl)
|
# 3. Rename with the matrix tag (e.g., sqm-autorate-rust-aarch64-musl)
|
||||||
# This ensures unique filenames in the shared workspace root
|
# This ensures unique filenames in the shared workspace root
|
||||||
cp "$BINARY_PATH" "sqm-autorate-rust-${TARGET}"
|
cp "$BINARY_PATH" "sqm-autorate-rust-${TARGET}"
|
||||||
@@ -82,7 +85,7 @@ pipeline {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
'''
|
'''
|
||||||
|
|
||||||
// 4. Archive the specific file we just copied
|
// 4. Archive the specific file we just copied
|
||||||
archiveArtifacts artifacts: "sqm-autorate-rust-${TARGET}", fingerprint: true, onlyIfSuccessful: true
|
archiveArtifacts artifacts: "sqm-autorate-rust-${TARGET}", fingerprint: true, onlyIfSuccessful: true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user