open-web3-stack / open-runtime-module-library

Substrate Open Runtime Module Library
Apache License 2.0
447 stars 289 forks source link

Unable to use crates as dependencies using git #1000

Closed lemunozm closed 1 month ago

lemunozm commented 1 month ago

Hi!

When configuring the dependency as follows:

orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.6.0" }

I'm experienced the following error:

> cargo check                                        
    Updating git repository `https://github.com/open-web3-stack/open-runtime-module-library`
error: no matching package named `orml-traits` found
location searched: https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.6.0

I'm experiencing this only for versions above polkadot-v1.6.0 and master. If I specify polkadot-v1.1.0 or below it compiles as expected. Also if specified as orml-traits = "0.8.0" (corresponding to polkadot-v1.7.0) it compiles as expected.

Any idea of what could happen?

Tested with different rust versions & platforms in an empty project

zjb0807 commented 1 month ago
warning: Patch `orml-traits v0.4.1-dev (https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e63)` was not used in the crate graph.

polkadot-v1.1.0 doesn't work in your Cargo.lock file, so it runs cargo check fine.

We don't have Cargo.toml in the root , you can't use it with git, it's different from moonbeam-polkadot-v1.7.2/Cargo.toml

lemunozm commented 1 month ago

For me, polkadot-v1.1.0 works fine with git. What does not work fine is any version above polkadot-1.6.0

wischli commented 1 month ago

@zjb0807 What is the recommended way to specify orml crates for post polkadot-v1.1.0 versions?

xlc commented 1 month ago

It is currently recommended to use crates.io for polkadot-sdk and orml.

Otherwise you can add orml as a submodule. This is how Acala is using it.

lemunozm commented 1 month ago

Thanks for the answer!

Just curious, what makes polkadot-v1.1.0 works using git but versions greater than polkadot-v1.6.0 not?

xlc commented 1 month ago

I think it is due to this https://github.com/open-web3-stack/open-runtime-module-library/pull/960

lemunozm commented 1 month ago

That seems to be, thanks!