substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Version conflict on if-addrs-sys

Open DaoZin opened this issue 4 years ago • 5 comments

There seems to be an issue with the if-addrs-sys package, i tried checking and building with cargo right out of the box and i am unable to. When i do run cargo check i get the following error:

Updating git repositoryhttps://github.com/rs-ipfs/rust-ipfsUpdating crates.io index Updating git repositoryhttps://github.com/NLnetLabs/domain.giterror: failed to select a version forif-addrs-sys. ... required by package if-addrs v0.6.4... which is depended on bylibp2p-tcp v0.27.0... which is depended on bylibp2p v0.34.0... which is depended on byipfs v0.2.1 (https://github.com/rs-ipfs/rust-ipfs#cf370325)... which is depended on bynode-cli v2.0.0 (/home/cbnits/Documents/ref/substrate/bin/node/cli)... which is depended on bychain-spec-builder v2.0.0 (/home/cbnits/Documents/ref/substrate/bin/utils/chain-spec-builder)versions that meet the requirements^0.3` are: 0.3.2, 0.3.1

the package if-addrs-sys links to the native library ifaddrs, but it conflicts with a previous package which links to ifaddrs as well: package get_if_addrs-sys v0.1.1 ... which is depended on by get_if_addrs v0.5.3 ... which is depended on by libp2p-tcp v0.22.0 ... which is depended on by libp2p v0.28.1 ... which is depended on by node-browser-testing v2.0.0 (/home/cbnits/Documents/ref/substrate/bin/node/browser-testing)

failed to select a version for if-addrs-sys which could resolve this conflict `

What do you think is the solution to this?

Reference Screenshot:

Screenshot from 2021-01-28 12-00-52

DaoZin avatar Jan 28 '21 06:01 DaoZin

@dEvK4n3Ki were you able to solve the issue? I encountered the same thing. It looks like the latest version of rust-ipfs uses libp2p 0.34.0 but the older libs used in this repo use 0.28.1. One fix is to specify the tag = "[email protected]", which uses libp2p 0.28.1. I have a fork that does that: https://github.com/driemworks/substrate/tree/offchain_ipfs_wsl Another (not as easy but definitey better) option would be to rebase this repo with the parity/substrate master branch.

edit: should be [email protected], not 0.2.1.

driemworks avatar Aug 03 '21 01:08 driemworks

@dEvK4n3Ki were you able to solve the issue? I encountered the same thing. It looks like the latest version of rust-ipfs uses libp2p 0.34.0 but the older libs used in this repo use 0.28.1. One fix is to specify the tag = "[email protected]", which uses libp2p 0.28.1. I have a fork that does that: https://github.com/driemworks/substrate/tree/offchain_ipfs_wsl Another (not as easy but definitey better) option would be to rebase this repo with the parity/substrate master branch.

Can you tell me where to add tag ="[email protected]". Should I add it in the docker version?

saravana87 avatar Aug 10 '21 17:08 saravana87

@dEvK4n3Ki were you able to solve the issue? I encountered the same thing. It looks like the latest version of rust-ipfs uses libp2p 0.34.0 but the older libs used in this repo use 0.28.1. One fix is to specify the tag = "[email protected]", which uses libp2p 0.28.1. I have a fork that does that: https://github.com/driemworks/substrate/tree/offchain_ipfs_wsl Another (not as easy but definitey better) option would be to rebase this repo with the parity/substrate master branch.

Can you tell me where to add tag ="[email protected]". Should I add it in the docker version?

There are three packages that depend on ipfs, so the tag needs to be specified in the Cargo.toml in each. Take a look at: https://github.com/driemworks/substrate/commit/2072db4c13e77d8eab6e7ee3a9e7a2a4ce3653c3

I'm using WSL so if your system is different this could differ. I'm only able to get the project to run using ngihtly-2020-08-23. That is, running cargo +nightly-2020-08-23 build --release and then cargo +nightly-2020-08-23 run --release -- --dev --tmp

driemworks avatar Aug 10 '21 17:08 driemworks

@driemworks Thanks for your reply. I edited the tag in all the 3 files. I got the following error. image

Please let me know how to fix this.

saravana87 avatar Aug 11 '21 15:08 saravana87

The error says wasm32-unknown-unknown target may not be installed. Install it: rustup target add wasm32-unknown-unknown

driemworks avatar Aug 11 '21 21:08 driemworks