1

New to move and sui.

I am trying to follow the documentation on Sui and attempted to use the command sui move build to build my move package.

I encountered this error:

Failed to build Move modules: "Unable to resolve packages for package 'my_first_package'".

Attached picture below shows:

  1. my folder structure in local.
  2. the content of the .toml file.
  3. sui cloned locally pointing to devnet branch.

attached picture

TylerH
  • 20,799
  • 66
  • 75
  • 101
Jim
  • 450
  • 2
  • 10

3 Answers3

3

I solved my own problem, lol, by pointing Sui dependency correctly to sui-framework/ on local.

Content of .toml file:

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

[dependencies]
Sui = { local = "../sui/crates/sui-framework/"}
# { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework", rev = "devnet" }

[addresses]
my_first_package =  "0x0"
sui =  "0x2"

Originally, retrieving from git was taking too long to build so it might be better to git clone sui to local and build relying on local.

Jim
  • 450
  • 2
  • 10
1

Afaik you don't need to define 'sui' as a named address in the .toml file at all.

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

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework", rev = "devnet" }

[addresses]
my_module =  "0x0"

works just fine

calimoose
  • 115
  • 6
  • I have the following `.toml`: ```toml [package] name = "my_first_package" version = "0.0.1" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework", rev = "devnet" } # { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework", rev = "devnet" } # { local = "../sui/crates/sui-framework/"} [addresses] my_first_package = "0x0" # sui = "0x2" ``` Gives an error though: ``` >sui move build Failed to build Move modules: "Unable to resolve packages for package 'my_first_package'". ``` – Jim Oct 25 '22 at 05:55
0

I had the same issue, and I realized that the tutorial I was following was using deprecated location.

It went from:

Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework", rev = "devnet" }

to

Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }

A more permanent solution would be to use sui move new tmp_package and then look at the auto generated Move.toml file.

Merton
  • 1
  • 1