rust-cross / cargo-zigbuild

Compile Cargo project with zig as linker
MIT License
1.43k stars 51 forks source link

How to build with `cargo auditable` #192

Closed NuSkooler closed 10 months ago

NuSkooler commented 11 months ago

Hi, thanks for the great project!

We would like our builds to contain auditable information. Normally this would be done via cargo auditable --release for example. Is there a way to utilize cargo-zigbuild and auditable together?

NobodyXu commented 11 months ago

export CARGO=cargo-zigbuild cargo-auditable, that's how cargo-binstall does it (NOTE that cargo-auditable is invoked directly, invoking it via cargo would reset the env CARGO)

NuSkooler commented 10 months ago

@NobodyXu Thanks for the information and quick reply! Perhaps I'm doing something wrong, but I tried this without luck:

export CARGO="cargo-zigbuild cargo-auditable"
cargo-auditable auditable build --release --target x86_64-pc-windows-gnu

But that yields

error: linker `x86_64-w64-mingw32-gcc` not found

Any ideas?

NobodyXu commented 10 months ago

Please try this:

export CARGO="cargo-zigbuild"
cargo-auditable auditable build --release --target x86_64-pc-windows-gnu
NuSkooler commented 10 months ago

@NobodyXu Thank you so much, that works (and makes sense)!