ChainSafe / forest

🌲 Rust Filecoin Node Implementation
https://forest.chainsafe.io
Apache License 2.0
620 stars 146 forks source link

New Cargo Feature requires Cargo.toml files update #1349

Closed bodo-hugo-barwich closed 2 years ago

bodo-hugo-barwich commented 2 years ago

Describe the bug Any Cargo or make command fails with Error feature 'resolver' is required

To Reproduce Steps to reproduce the behavior: Fresh Development Installation with branch main updated

$ git log -1
commit 356757e2c776132e4c8db0a85e4b1733137330fd (HEAD -> main, origin/main, origin/HEAD)
Author: noot <36753753+noot@users.noreply.github.com>
Date:   Fri Dec 17 20:03:29 2021 -0500

    drand v14 update: fix fetching around null tipsets (#1339)

running make release or cargo clean

Log output

$ make release
cargo build --release --bin forest
error: failed to parse manifest at `/absolute/path/to/forest/Cargo.toml`

Caused by:
  feature `resolver` is required

  consider adding `cargo-features = ["resolver"]` to the manifest
make: *** [Makefile:55: release] Error 101
$ cargo clean
error: failed to parse manifest at `/absolute/path/to/forest/Cargo.toml`

Caused by:
  feature `resolver` is required

  consider adding `cargo-features = ["resolver"]` to the manifest

Expected behaviour should compile normally

Environment (please complete the following information):

Other information and links

Features Meta Tracker New resolver Cargo Feature

bodo-hugo-barwich commented 2 years ago

Actually modifying the Cargo.toml as described in the Cargo Meta Tracker does solve this issue. but it needs to be done to all Cargo.toml files

$ cat Cargo.toml | grep -i -B3 -A3 "resolver"

cargo-features = ["resolver"]

[workspace]
members = [
$ make release
cargo build --release --bin forest
    Updating crates.io index
    Updating git repository `https://github.com/ChainSafe/libp2p-bitswap`
  Downloaded crossbeam-queue v0.3.2
  Downloaded hmac v0.8.1
  Downloaded futures-task v0.3.15
  Downloaded const_fn v0.4.8
  Downloaded async-executor v1.4.1
  Downloaded instant v0.1.10
  Downloaded tracing-futures v0.2.5
  Downloaded hashbrown v0.11.2
  Downloaded aes v0.7.5
  Downloaded git-version v0.3.4
  Downloaded cuckoofilter v0.5.0
  Downloaded filecoin-proofs v9.0.2
  Downloaded universal-hash v0.4.1
  Downloaded unicode-segmentation v1.8.0
  Downloaded unicode-bidi v0.3.5
  Downloaded blstrs v0.2.2
  Downloaded typenum v1.13.0
  Downloaded tracing-attributes v0.1.15
  Downloaded ff-cl-gen v0.3.0
  Downloaded cpufeatures v0.2.1
  Downloaded clang-sys v1.2.0
  Downloaded crypto-mac v0.10.1
  Downloaded crossbeam-deque v0.8.1
  Downloaded crossbeam v0.8.1
  Downloaded crossbeam-epoch v0.9.5
  Downloaded blake3 v0.3.8
  Downloaded femme v2.1.1
  Downloaded cc v1.0.69
  Downloaded cid v0.6.1
  Downloaded bls-signatures v0.9.0
  Downloaded byteorder v1.4.3
  Downloaded byte-unit v4.0.12
  Downloaded byte-pool v0.2.3
  Downloaded bimap v0.6.1
  Downloaded async-std-resolver v0.20.3
  Downloaded bincode v1.3.3
  Downloaded tokio v1.8.4
  Downloaded uint v0.9.1
  Downloaded dtoa v0.4.8
  Downloaded prost-types v0.9.0
  Downloaded hostname v0.3.1
  Downloaded heck v0.3.3
  Downloaded asynchronous-codec v0.6.0
  Downloaded futures-executor v0.3.15
  Downloaded polling v2.1.0
  Downloaded pin-project-lite v0.2.7
  Downloaded data-encoding-macro v0.1.12
  Downloaded proc-macro2 v1.0.27
  Downloaded enum-as-inner v0.3.3
  Downloaded pin-project-lite v0.1.12
  Downloaded rustc_version v0.3.3
  Downloaded http v0.2.4
  Downloaded futures-channel v0.3.15
  Downloaded cpufeatures v0.1.5
  Downloaded flume v0.10.9
  Downloaded fixedbitset v0.4.0
  Downloaded futures v0.3.15
  Downloaded prometheus v0.12.0
  Downloaded trust-dns-resolver v0.20.3
  Downloaded git-version-macro v0.3.4
  Downloaded libloading v0.7.0
  Downloaded num-complex v0.4.0
  Downloaded ipld_amt v0.2.1
  Downloaded sct v0.6.1
  Downloaded jobserver v0.1.22
  Downloaded prost v0.9.0
  Downloaded serde_repr v0.1.7
  Downloaded forest_actor v1.0.5
  Downloaded signal-hook-registry v1.4.0
  Downloaded signature v1.3.1
  Downloaded slab v0.4.3
  Downloaded polyval v0.5.3
  Downloaded tungstenite v0.13.0
  Downloaded standback v0.2.17
  Downloaded half v1.7.1
  Downloaded bellperson v0.16.3
  Downloaded az v1.1.2
  Downloaded bindgen v0.57.0
  Downloaded procfs v0.9.1
  Downloaded subtle v2.4.1
  Downloaded match_cfg v0.1.0
  Downloaded ipld_amt v1.0.0
  Downloaded socket2 v0.4.0
  Downloaded multihash v0.14.0
  Downloaded blstrs v0.3.0
  Downloaded forest_actor v3.0.0
  Downloaded http-client v6.4.1
  Downloaded groupy v0.4.1
  Downloaded prost v0.8.0
  Downloaded ed25519 v1.1.1
  Downloaded dashmap v4.0.2
  Downloaded surf v2.2.0
  Downloaded proc-macro-crate v1.0.0
  Downloaded poly1305 v0.7.2
  Downloaded httparse v1.4.1
  Downloaded thiserror v1.0.26
  Downloaded multistream-select v0.10.4
error: failed to parse manifest at `/home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/multistream-select-0.10.4/Cargo.toml`

Caused by:
  feature `resolver` is required

  consider adding `cargo-features = ["resolver"]` to the manifest
make: *** [Makefile:55: release] Error 101
elmattic commented 2 years ago

Hey Bodo, have you tried to build with last version?

(run rustup update stable to upgrade cargo and rustc to 1.57.0)

truemagic-coder commented 2 years ago

FYI it works on Ubuntu 20.04 (latest) with Rust 1.57.0 (stable). Make release created the release and cargo clean did not error.

Using Ubuntu 20.04 (latest) with Rust 1.48.0 (stable). The same error happened to me as Bodo. I had to delete the rust-toolchain file (denoting stable) in the git repo to override 1.57.0 to 1.48.0. The documentation for forest can be updated with the rustup update stable command. Would you like me to submit a PR to the README?

I know this is a new issue but I also tried building the Docker image and that did not work. Do you want me to create a new issue in the tracker?

Compiling forest_libp2p v0.1.0 (/usr/src/forest/node/forest_libp2p) error: git describe failed with status 128: fatal: not a git repository (or any of the parent directories): .git --> node/forest_libp2p/src/behaviour.rs:59:47 59 static ref CURRENT_COMMIT: &'static str = git_version!(); ^^^^^^^^^^^^^^

= note: this error originates in the macro proc_macro_call (in Nightly builds, run with -Z macro-backtrace for more info)

Compiling genesis v0.1.0 (/usr/src/forest/utils/genesis) error: could not compile forest_libp2p due to previous error warning: build failed, waiting for other jobs to finish... error: failed to compile forest v0.1.0 (/usr/src/forest/forest), intermediate artifacts can be found at /usr/src/forest/target

bodo-hugo-barwich commented 2 years ago

The error that I was observing is reproducible as seen in this test workflow Rust Compiler Matrix Test

It seems especially applicable to the Rust Versions < 1.52.0 as it can be concluded from the cargo commit history.

But I noticed that it does not only affect this project but several libraries that use this feature. Also I saw that the Minimum Rust Version for the project was incremented to 1.55.

So, this issue is actually not applicable to the project.

bodo-hugo-barwich commented 2 years ago

According to the Test Matrix the earliest working Rust compiler version is 1.53.0 Rust Compiler Test Matrix