diff --git a/.cargo/config.toml b/.cargo/config.toml index 09842cd..16ae724 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -15,18 +15,27 @@ rustflags = ["-C", "target-feature=+crt-static"] linker = "rust-lld" rustflags = ["-C", "target-feature=+crt-static"] -[target.x86_64-apple-darwin] -linker = "rust-lld" -rustflags = ["-C", "target-feature=+crt-static"] +# Disable rust-lld for x86 macOS because the linker crashers when compiling +# the installer in release mode with debug info on. +# [target.x86_64-apple-darwin] +# linker = "rust-lld" +# rustflags = ["-C", "target-feature=+crt-static"] [target.x86_64-unknown-linux-musl] linker = "rust-lld" rustflags = ["-C", "target-feature=+crt-static"] -# optimizations to reduce the binary size +# keep line numbers in stack traces for non-firmware binaries [profile.release] +debug = "limited" + +# optimizations to reduce the binary size of firmware binaries +[profile.firmware] +inherits = "release" strip = true opt-level = "z" lto = true codegen-units = 1 panic = "abort" +debug = false + diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 5d11598..994a22f 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -50,11 +50,11 @@ jobs: with: targets: armv7-unknown-linux-musleabihf - name: Build rootshell (arm32) - run: cargo build --bin rootshell --target armv7-unknown-linux-musleabihf --release + run: cargo build --bin rootshell --target armv7-unknown-linux-musleabihf --profile=firmware - uses: actions/upload-artifact@v4 with: name: rootshell - path: target/armv7-unknown-linux-musleabihf/release/rootshell + path: target/armv7-unknown-linux-musleabihf/firmware/rootshell if-no-files-found: error build_rayhunter: strategy: @@ -74,11 +74,11 @@ jobs: npm install npm run build popd - cargo build --bin rayhunter-daemon --target armv7-unknown-linux-musleabihf --release --no-default-features --features ${{ matrix.device.name }} + cargo build --bin rayhunter-daemon --target armv7-unknown-linux-musleabihf --profile=firmware --no-default-features --features ${{ matrix.device.name }} - uses: actions/upload-artifact@v4 with: name: rayhunter-daemon-${{ matrix.device.name }} - path: target/armv7-unknown-linux-musleabihf/release/rayhunter-daemon + path: target/armv7-unknown-linux-musleabihf/firmware/rayhunter-daemon if-no-files-found: error build_rust_installer: needs: