rust-fuzz / cargo-fuzz

Command line helpers for fuzzing
https://rust-fuzz.github.io/book/cargo-fuzz.html
Apache License 2.0
1.53k stars 109 forks source link

Distributed release files can only compile for musl #355

Open addisoncrump opened 9 months ago

addisoncrump commented 9 months ago

See: https://github.com/astral-sh/ruff/issues/9368

It seems that binstall (which pulls from GitHub since the release) installs the musl copies distributed in the latest release, but the released files can only build musl-targeting fuzzers.

I would expect that the distributed files should be compatible with any toolchain.

taiki-e commented 7 months ago

I have tested all musl binaries (0.11.2-0.12.0), and they all have this issue.

And, this is due to the following code using the target that is used to build cargo-fuzz itself as the default target.

https://github.com/rust-fuzz/cargo-fuzz/blob/351f11df33b9416c778265843d98c8ebe61060f9/src/utils.rs#L1-L4

The more correct way here is to get host triple from the output of cargo --version --verbose, like this.

(Workaround is passing --target x86_64-unknown-linux-gnu to cargo fuzz.)

taiki-e commented 7 months ago

The more correct way here is to get host triple from the output of cargo --version --verbose, like this.

However, to provide the fully same behavior as the default target selection in cargo, a library such as cargo-config2 is needed because we need to handle config while handling its hierarchical structure and environment variables.

taiki-e commented 7 months ago

Filed #365 to fix this.

addisoncrump commented 3 months ago

Bump, this just happened again.