1

Error message:

error: failed to select a version for 'log'.
... required by package 'frame-benchmarking v4.0.0-dev (https://github.com/paritytech/substrate#580ebae1)'
... which satisfies git dependency 'frame-benchmarking' of package 'pallet-contracts v4.0.0-dev (https://github.com/paritytech/substrate#580ebae1)'
... which satisfies git dependency 'pallet-contracts' of package 'node-template-runtime v4.0.0-dev (/home/sergej/substrate-test/runtime)'
... which satisfies path dependency 'node-template-runtime' (locked to 4.0.0-dev) of package 'node-template v4.0.0-dev (/home/sergej/substrate-test/node)'
versions that meet the requirements '^0.4.16' are: 0.4.16

all possible versions conflict with previously selected packages.

previously selected package 'log v0.4.14' ... which satisfies dependency 'log = "^0.4"' (locked to 0.4.14) of package 'finality-grandpa v0.15.0' ... which satisfies dependency 'finality-grandpa = "^0.15.0"' (locked to 0.15.0) of package 'sc-finality-grandpa v0.10.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.18#fc3fd073)' ... which satisfies git dependency 'sc-finality-grandpa' (locked to 0.10.0-dev) of package 'node-template v4.0.0-dev (/home/sergej/substrate-test/node)'

failed to select a version for 'log' which could resolve this conflict

This happened after I added this to the Cargo.toml in the runtime directory:

pallet-contracts = { git = "https://github.com/paritytech/substrate", package = "pallet-contracts", default-features = false }
pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate", package = "pallet-contracts-primitives", default-features = false }
pallet-contracts-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", package = "pallet-contracts-rpc-runtime-api", default-features = false }
4
  • 1
    try rev="580ebae1" on your pallet-contracts crate imports so that your importing the same version of substrate (otherwise I think it will just take latest master which is likely conflicting wtih the one you have brought in. Alternatively, cargo update -p sp-io should upgrade the locked substrate version to the latest master. Hope this helps.
    – Squirrel
    Apr 20, 2022 at 16:17
  • 1
    @Squirrel It worked :D
    – Szegoo
    Apr 20, 2022 at 16:45
  • Excellent news. Rock on!
    – Squirrel
    Apr 20, 2022 at 18:12
  • 1
    @Squirrel Either we should close this thread, or post the solution as an answer
    – Shawn Tabrizi
    Apr 21, 2022 at 23:43

1 Answer 1

1

It's pulling in two substrate versions at once. Substrate is not mix and match - you only ever want one version of substrate in your Cargo.lock file.

Try rev="580ebae1" on your pallet-contracts crate imports so that your importing the same version of substrate (otherwise I think it will just take latest master which is likely conflicting wtih the one you have brought in. Alternatively, cargo update -p sp-io should upgrade the locked substrate version to the latest master. Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.