cargo-fuzz icon indicating copy to clipboard operation
cargo-fuzz copied to clipboard

Distributed release files can only compile for musl

Open addisoncrump opened this issue 1 year ago • 5 comments

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.

addisoncrump avatar Jan 03 '24 00:01 addisoncrump

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 avatar Mar 02 '24 09:03 taiki-e

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 avatar Mar 02 '24 10:03 taiki-e

Filed #365 to fix this.

taiki-e avatar Mar 02 '24 11:03 taiki-e

Bump, this just happened again.

addisoncrump avatar Jun 17 '24 22:06 addisoncrump