Fix Rust build: add target specification, fix cargo arguments, improve error handling
Some checks failed
Build deb-bootupd Artifacts / build (push) Failing after 4m3s
Simple Build and Upload / build (push) Failing after 2m41s

This commit is contained in:
robojerk 2025-08-10 09:10:46 -07:00
parent 989beeb14b
commit 2f7b484bb1
2 changed files with 23 additions and 11 deletions

View file

@ -146,7 +146,7 @@ jobs:
cd /tmp/deb-bootupd
# Set Rust compilation safeguards
export RUSTFLAGS="-C target-cpu=native -C target-feature=+crt-static"
export RUSTFLAGS="-C target-cpu=native"
export CARGO_INCREMENTAL=0
export CARGO_NET_RETRY=3
@ -156,14 +156,20 @@ jobs:
echo "Building deb-bootupd in release mode..."
echo "Rust flags: $RUSTFLAGS"
echo "Memory limit: $(ulimit -v) KB"
echo "Current target: $(rustc --print target-list | grep x86_64-unknown-linux-gnu)"
# Try building with increased verbosity
RUST_BACKTRACE=1 cargo build --release --verbose || {
echo "❌ Build failed, trying with debug mode..."
RUST_BACKTRACE=1 cargo build --debug --verbose || {
# Ensure we have the correct target
rustup target add x86_64-unknown-linux-gnu
# Try building with release mode first
RUST_BACKTRACE=1 cargo build --release --target x86_64-unknown-linux-gnu --verbose || {
echo "❌ Release build failed, trying with debug mode..."
RUST_BACKTRACE=1 cargo build --target x86_64-unknown-linux-gnu --verbose || {
echo "❌ Debug build also failed, checking Rust installation..."
rustc --version --verbose
cargo --version --verbose
echo "Available targets:"
rustup target list --installed
exit 1
}
}

View file

@ -138,12 +138,12 @@ jobs:
echo "CARGO_HOME: $CARGO_HOME"
echo "PATH includes: $PATH"
- name: Build project
- name: Build Rust project
run: |
cd /tmp/deb-bootupd
# Set Rust compilation safeguards
export RUSTFLAGS="-C target-cpu=native -C target-feature=+crt-static"
export RUSTFLAGS="-C target-cpu=native"
export CARGO_INCREMENTAL=0
export CARGO_NET_RETRY=3
@ -153,14 +153,20 @@ jobs:
echo "Building deb-bootupd in release mode..."
echo "Rust flags: $RUSTFLAGS"
echo "Memory limit: $(ulimit -v) KB"
echo "Current target: $(rustc --print target-list | grep x86_64-unknown-linux-gnu)"
# Try building with increased verbosity
RUST_BACKTRACE=1 cargo build --release --verbose || {
echo "❌ Build failed, trying with debug mode..."
RUST_BACKTRACE=1 cargo build --debug --verbose || {
# Ensure we have the correct target
rustup target add x86_64-unknown-linux-gnu
# Try building with release mode first
RUST_BACKTRACE=1 cargo build --release --target x86_64-unknown-linux-gnu --verbose || {
echo "❌ Release build failed, trying with debug mode..."
RUST_BACKTRACE=1 cargo build --target x86_64-unknown-linux-gnu --verbose || {
echo "❌ Debug build also failed, checking Rust installation..."
rustc --version --verbose
cargo --version --verbose
echo "Available targets:"
rustup target list --installed
exit 1
}
}