From 83ee08052f248de5990b774b0f4510837010b9d7 Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Sat, 21 Feb 2026 14:45:32 +0700 Subject: [PATCH] feat: Enables nightly toolchain support Adds support for the nightly Rust toolchain, enabling the `build-std` feature when detected. This allows building with `panic=abort` for smaller binaries. --- Jenkinsfile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8769c07..e7246be 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,8 +43,20 @@ pipeline { cat "$CARGO_HOME/config.toml" echo "----------------------------------" - # 5. Build - cargo build --release + # 5. Check Toolchain & Build + # We grep for "nightly" in the version string (e.g., "rustc 1.95.0-nightly...") + if rustc -V | grep -q "nightly"; then + echo "Detected Nightly toolchain. Enabling '-Z build-std' to support panic=abort..." + + # Ensure rust-src is installed (needed for build-std) + # We use '|| true' so it doesn't fail if already installed or network flakes + rustup component add rust-src || true + + cargo build --release -Z build-std=std,panic_abort + else + echo "Detected Stable toolchain. Building with standard pre-compiled library..." + cargo build --release + fi ''' } }