diff --git a/Jenkinsfile b/Jenkinsfile index 5390dad..4015acf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,6 +28,10 @@ pipeline { sh ''' set -eu + # --------------------------------------------------------- + # Rust + # --------------------------------------------------------- + if ! command -v rustup >/dev/null 2>&1; then echo "ERROR: rustup is not installed on this worker." >&2 exit 1 @@ -42,12 +46,52 @@ pipeline { rustup default stable + # --------------------------------------------------------- + # mold linker + # --------------------------------------------------------- + + if ! command -v mold >/dev/null 2>&1; then + echo "mold not found — installing it..." + pkg install -y mold + else + echo "mold already installed." + fi + + # --------------------------------------------------------- + # Environment information + # --------------------------------------------------------- + echo - echo "Using:" + echo "Rust:" rustc --version + + echo + echo "Cargo:" cargo --version + + echo + echo "rustfmt:" rustfmt --version + + echo + echo "Clippy:" cargo clippy --version + + echo + echo "Compiler:" + cc --version || true + + echo + echo "mold:" + mold --version + + echo + echo "mold location:" + command -v mold + + echo + echo "Linker-related environment:" + env | grep -E 'RUSTFLAGS|CARGO.*RUSTFLAGS|MOLD' || true ''' } } @@ -58,7 +102,11 @@ pipeline { set -eu echo "Checking Rust formatting..." - cargo fmt --all -- --check + + cargo fmt \ + --all \ + -- \ + --check ''' } } @@ -134,6 +182,8 @@ pipeline { echo "Release build completed." if [ -f target/release/idlefox ]; then + echo + echo "Release binary:" ls -lh target/release/idlefox fi '''