paritytech / cumulus

Write Parachains on Substrate
GNU General Public License v3.0
620 stars 380 forks source link

multiple `polkadot-parachain` packages in your project #1406

Open rakanalh opened 2 years ago

rakanalh commented 2 years ago

When trying to compile cumulus from the root of the project like so (say branch :

cargo build --release --locked -p polkadot-parachain

The outcome would look as follows:

cargo build --release --locked -p polkadot-parachain
error: There are multiple `polkadot-parachain` packages in your project, and the specification `polkadot-parachain` is ambiguous.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
  polkadot-parachain:0.9.24
  polkadot-parachain:0.9.230

This is caused by the fact that the polkadot-parachain package defines it's name as such:

https://github.com/paritytech/cumulus/blob/95ca5a085727c1494ddeeae4a2b2e69c4ee1933b/polkadot-parachain/Cargo.toml#L1-L11

and also imports a crate with the same name: https://github.com/paritytech/cumulus/blob/95ca5a085727c1494ddeeae4a2b2e69c4ee1933b/polkadot-parachain/Cargo.toml#L72

This leads to confusion as to which one should be passed to -p CLI argument so that actual binary is built, without having to look at Cargo.toml

gilescope commented 1 year ago

The polkadot crate should be renamed in some way I would suggest (or alternatively we can have our bin name different to the crate name - that would also fix it).

bkontur commented 1 year ago

at least, polkadot-parachain dependency in cumulus/polkadot-parachain/Cargo.toml is not needed, and is removed in this PR: https://github.com/paritytech/cumulus/pull/1680/files#diff-5dcee2b3279312fb4434bec01df2816aeae5d1e593e2118b74706e1a2c905c83L72

and I am just wondering, if hack like with codec deps, should work here also: codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }

so instead: polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, features = [ "wasm-api" ], branch = "master" } we use: polkadot-parachain = { package = "polkadot-parachain-lib", git = "https://github.com/paritytech/polkadot", default-features = false, features = [ "wasm-api" ], branch = "master" }