Fix Rust build: add target specification, fix cargo arguments, improve error handling
This commit is contained in:
parent
989beeb14b
commit
2f7b484bb1
2 changed files with 23 additions and 11 deletions
|
|
@ -146,7 +146,7 @@ jobs:
|
||||||
cd /tmp/deb-bootupd
|
cd /tmp/deb-bootupd
|
||||||
|
|
||||||
# Set Rust compilation safeguards
|
# 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_INCREMENTAL=0
|
||||||
export CARGO_NET_RETRY=3
|
export CARGO_NET_RETRY=3
|
||||||
|
|
||||||
|
|
@ -156,14 +156,20 @@ jobs:
|
||||||
echo "Building deb-bootupd in release mode..."
|
echo "Building deb-bootupd in release mode..."
|
||||||
echo "Rust flags: $RUSTFLAGS"
|
echo "Rust flags: $RUSTFLAGS"
|
||||||
echo "Memory limit: $(ulimit -v) KB"
|
echo "Memory limit: $(ulimit -v) KB"
|
||||||
|
echo "Current target: $(rustc --print target-list | grep x86_64-unknown-linux-gnu)"
|
||||||
|
|
||||||
# Try building with increased verbosity
|
# Ensure we have the correct target
|
||||||
RUST_BACKTRACE=1 cargo build --release --verbose || {
|
rustup target add x86_64-unknown-linux-gnu
|
||||||
echo "❌ Build failed, trying with debug mode..."
|
|
||||||
RUST_BACKTRACE=1 cargo build --debug --verbose || {
|
# 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..."
|
echo "❌ Debug build also failed, checking Rust installation..."
|
||||||
rustc --version --verbose
|
rustc --version --verbose
|
||||||
cargo --version --verbose
|
cargo --version --verbose
|
||||||
|
echo "Available targets:"
|
||||||
|
rustup target list --installed
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,12 +138,12 @@ jobs:
|
||||||
echo "CARGO_HOME: $CARGO_HOME"
|
echo "CARGO_HOME: $CARGO_HOME"
|
||||||
echo "PATH includes: $PATH"
|
echo "PATH includes: $PATH"
|
||||||
|
|
||||||
- name: Build project
|
- name: Build Rust project
|
||||||
run: |
|
run: |
|
||||||
cd /tmp/deb-bootupd
|
cd /tmp/deb-bootupd
|
||||||
|
|
||||||
# Set Rust compilation safeguards
|
# 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_INCREMENTAL=0
|
||||||
export CARGO_NET_RETRY=3
|
export CARGO_NET_RETRY=3
|
||||||
|
|
||||||
|
|
@ -153,14 +153,20 @@ jobs:
|
||||||
echo "Building deb-bootupd in release mode..."
|
echo "Building deb-bootupd in release mode..."
|
||||||
echo "Rust flags: $RUSTFLAGS"
|
echo "Rust flags: $RUSTFLAGS"
|
||||||
echo "Memory limit: $(ulimit -v) KB"
|
echo "Memory limit: $(ulimit -v) KB"
|
||||||
|
echo "Current target: $(rustc --print target-list | grep x86_64-unknown-linux-gnu)"
|
||||||
|
|
||||||
# Try building with increased verbosity
|
# Ensure we have the correct target
|
||||||
RUST_BACKTRACE=1 cargo build --release --verbose || {
|
rustup target add x86_64-unknown-linux-gnu
|
||||||
echo "❌ Build failed, trying with debug mode..."
|
|
||||||
RUST_BACKTRACE=1 cargo build --debug --verbose || {
|
# 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..."
|
echo "❌ Debug build also failed, checking Rust installation..."
|
||||||
rustc --version --verbose
|
rustc --version --verbose
|
||||||
cargo --version --verbose
|
cargo --version --verbose
|
||||||
|
echo "Available targets:"
|
||||||
|
rustup target list --installed
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue