rooch icon indicating copy to clipboard operation
rooch copied to clipboard

[CLI] Cannot compile Move contracts when dependent on the git repository

Open wubuku opened this issue 2 years ago • 2 comments

Configure the dependencies in Move.toml as the git repository, like this:

[package]
name = "RoochDemo"
version = "0.0.1"

[dependencies]
MoveosStdLib = { git = "https://github.com/rooch-network/rooch.git", subdir = "moveos/moveos-stdlib/moveos-stdlib", rev = "main" }
#MoveosStdlib = { local = "../../rooch/moveos/moveos-stdlib/moveos-stdlib" }

[addresses]
rooch_demo = "_"
moveos_std = "0x2"
rooch_framework = "0x3"

Run:

rooch move build --named-addresses rooch_demo={ACCOUNT_ADDR}
UPDATING GIT DEPENDENCY https://github.com/rooch-network/rooch.git

The compilation will error out:

Error: Failed to resolve dependencies for package 'RoochDemo'

If the dependency is changed to local (that is, changed to look like the line that is commented out), it works.

Are there some problems?

wubuku avatar Jun 20 '23 14:06 wubuku

Change MoveosStdLib to MoveosStdlib, but the error message is not friendly to devs, needs to be improved.

jolestar avatar Jun 21 '23 09:06 jolestar

I think it should raise an error:

Name of dependency declared in package '{}' does not match dependency's package name '{}'

Based on the code

https://github.com/move-language/move/blob/8f5303a365cf9da7554f8f18c393b3d6eb4867f2/language/tools/move-package/src/resolution/dependency_graph.rs#L313-L321

But it does not work as expected. We need to figure it out.

jolestar avatar Jun 21 '23 10:06 jolestar