fuzzland / ityfuzz

Blazing Fast Bytecode-Level Hybrid Fuzzer for Smart Contracts
https://docs.ityfuzz.rs
MIT License
734 stars 116 forks source link

Compilation error on rust-nightly `type annotations needed for Box<_>` #515

Closed gnattishness closed 2 weeks ago

gnattishness commented 3 weeks ago

Building master (960e9e1) with a recent version of nightly (rustc 1.81.0-nightly (8337ba918 2024-06-12)) fails:

$ cargo +nightly install --git https://github.com/fuzzland/ityfuzz --locked
...
error[E0282]: type annotations needed for `Box<_>`
  --> /home/xxx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
help: consider giving `items` an explicit type, where the placeholders `_` are specified
   |
83 |     let items: Box<_> = format_items
   |              ++++++++

This appears to be due to the issue explained in https://github.com/time-rs/time/issues/681 and resolved in https://github.com/time-rs/time/pull/671

To resolve

  1. Please update time in the Cargo.lock e.g. cargo update --package time

  2. It looks like this wasn't caught in CI and workflows, suggesting that the Cargo.lock isn't being relied on there: https://github.com/fuzzland/ityfuzz/blob/960e9e148d376615df776529ddaedba93af0dced/.github/workflows/release.yml#L153 Please consider adding a --locked or --frozen to the build command, to ensure repeatable/reproducible builds.

gnattishness commented 3 weeks ago

I can add 2) as a separate issue if you'd prefer :slightly_smiling_face:

jacob-chia commented 2 weeks ago

Maintaining compatibility with the latest rust-toolchain for ityfuzz is challenging, because not all dependencies are compatible with the latest version or upgrading them would introduce breaking changes. Therefore, instead of building ityfuzz with the latest rust-toolchain, use the version specified by ityfuzz which can be found at https://github.com/fuzzland/ityfuzz/blob/master/rust-toolchain.toml.

You can install ityfuzz in two ways:

  1. (recommended) ityfuzzup
curl -L https://ity.fuzz.land/ | bash
ityfuzzup
  1. cargo install with a specific toolchain
cargo +nightly-2024-01-01 install --git https://github.com/fuzzland/ityfuzz --locked