matrix-org / vodozemac

An implementation of Olm and Megolm in pure Rust.
Apache License 2.0
175 stars 30 forks source link

Update the afl binary install command to the correct package #166

Closed MTRNord closed 3 months ago

MTRNord commented 3 months ago

It seems like it at some point had been renamed to cargo-afl.

It seems to at least with afl/olm-message-decoding still work.

However the new cfg linting in rust is a bit unhappy about the fuzzing cfg flags:

warning: unexpected `cfg` condition name: `fuzzing`
  --> src/main.rs:29:11
   |
29 | #[cfg(not(fuzzing))]
   |           ^^^^^^^
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(fuzzing)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

I am not sure if it should be ignored or not.

Signed-Off-By: MTRNord git@nordgedanken.dev

poljar commented 3 months ago

It seems like it at some point had been renamed to cargo-afl.

It seems to at least with afl/olm-message-decoding still work.

However the new cfg linting in rust is a bit unhappy about the fuzzing cfg flags:

warning: unexpected `cfg` condition name: `fuzzing`
  --> src/main.rs:29:11
   |
29 | #[cfg(not(fuzzing))]
   |           ^^^^^^^
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(fuzzing)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

I am not sure if it should be ignored or not.

We have this configured to be allowed:

https://github.com/matrix-org/vodozemac/blob/abe6b624f1ef3df70a02374da755e30a5a0fc15e/Cargo.toml#L19-L20

MTRNord commented 3 months ago

It seems like it at some point had been renamed to cargo-afl.

It seems to at least with afl/olm-message-decoding still work.

However the new cfg linting in rust is a bit unhappy about the fuzzing cfg flags:

warning: unexpected `cfg` condition name: `fuzzing`
  --> src/main.rs:29:11
   |
29 | #[cfg(not(fuzzing))]
   |           ^^^^^^^
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(fuzzing)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

I am not sure if it should be ignored or not.

We have this configured to be allowed:

https://github.com/matrix-org/vodozemac/blob/abe6b624f1ef3df70a02374da755e30a5a0fc15e/Cargo.toml#L19-L20

Hm I might have gotten that error due to running it in the afl harness folder which has it's own cargo.toml 🤔