Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build Move modules: Failed to resolve dependencies for package <PACKAGE> #20514

Open
jonahsimon13 opened this issue Dec 5, 2024 · 8 comments
Assignees
Labels
cli Command line tools

Comments

@jonahsimon13
Copy link

Steps to Reproduce Issue

Trying to build a Move package and I get the following error:

Failed to build Move modules: Failed to resolve dependencies for package 'lottery'

Caused by:
0: Deserializing packages
1: missing field id for key move.dependencies at line 8 column 3.

System Information

  • OS: MacOS Sonoma 14.4
  • Compiler: 1.36.2

This has happened since using Sui 1.36.2. Other packages build fine, but this one and a couple others are throwing this error and there are no obvious differences in the .toml files. I tried deleting Move.lock, /build, and ~/.move and it did not resolve the issue.

@damirka
Copy link
Contributor

damirka commented Dec 5, 2024

Hey @jonahsimon13! Would you be comfortable providing more details about what's going on? Perhaps, sharing a repro / package you're trying to build, and the steps taken?

@jonahsimon13
Copy link
Author

The repo I'm working in has about 25 project folders, and I was able to build everything a week or two ago. Now, some of the packages build and others give the deserialization error. I think the only thing that changed prior to the issue arising was I reinstalled sui by building from source where previously I had used cargo install. This also put me on version 1.36.2.

@damirka
Copy link
Contributor

damirka commented Dec 5, 2024

Can you try using the most recent 1.38 and tell me if it works? Also, which branch did you build it from?

@jonahsimon13
Copy link
Author

This is on the mainnet branch, I updated sui to 1.39.0 and the issue persisted. My colleague was able to reproduce it and solved it by manually changing the move.lock files in the package I was trying to build, and another package that it depended on that also threw the same error. Making the same changes worked for me as well. For reference, in the lockfiles wherever a dependency was listed, it needed to be changed from this format:

dependencies = [
{ name = "MoveStdlib" },
]

to this format:

dependencies = [
{ id = "MoveStdlib", name = "MoveStdlib" },
]

and wherever a package was listed, it needed to be changed from this format:

[[move.package]]
name = "Sui"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/mainnet", subdir = "crates/sui-framework/packages/sui-framework" }

to this format:

[[move.package]]
id = "Sui"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/mainnet", subdir = "crates/sui-framework/packages/sui-framework" }

@stefan-mysten stefan-mysten self-assigned this Dec 9, 2024
@stefan-mysten stefan-mysten added the cli Command line tools label Dec 9, 2024
@mdgeorge4153 mdgeorge4153 self-assigned this Dec 9, 2024
@mdgeorge4153
Copy link
Contributor

mdgeorge4153 commented Dec 10, 2024

@jonahsimon13 Is there a version field in your Move.lock file (in particular, the lock file used when you had the error)?

@jonahsimon13
Copy link
Author

Yes it has version = 3

@mdgeorge4153
Copy link
Contributor

Do you happen to remember what tool produced that lockfile (e.g. was it output by sui move build)? The problem is that version 3 of the file format requires the id fields. If you had removed the version from the lock file (or set it to 2), then it would have worked.

@jonahsimon13
Copy link
Author

It was output by 'sui move build'. I think what happened was multiple people working in the same repo on different versions of sui led to incompatible lock files (or the same lock file with incompatible fields) getting pushed up/pulled down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Command line tools
Projects
None yet
Development

No branches or pull requests

4 participants