rs-ipfs / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
28 stars 5 forks source link

Version conflict on if-addrs-sys #4

Open DaoZin opened 3 years ago

DaoZin commented 3 years ago

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-ipfs Updating crates.io index Updating git repositoryhttps://github.com/NLnetLabs/domain.git error: failed to select a version forif-addrs-sys. ... required by packageif-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

driemworks commented 3 years ago

@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 = "ipfs@v0.2.1", 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 ipfs@0.2.0, not 0.2.1.

saravana87 commented 3 years ago

@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 = "ipfs@v0.2.1", 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 ="ipfs@v0.2.1". Should I add it in the docker version?

driemworks commented 3 years ago

@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 = "ipfs@v0.2.1", 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 ="ipfs@v0.2.1". 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

saravana87 commented 3 years ago

@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.

driemworks commented 3 years ago

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