MystenLabs / sui

Sui, a next-generation smart contract platform with high throughput, low latency, and an asset-oriented programming model powered by the Move programming language
https://sui.io
Apache License 2.0
5.98k stars 11.1k forks source link

Failed to build Move modules #16906

Open datznt opened 5 months ago

datznt commented 5 months ago

Steps to Reproduce Issue

I had some errors when trying to build the project: Failed to build Move modules: Failed to resolve dependencies for package 'test'

e.g.

  1. choco install sui
  2. sui move new test
  3. cd test && sui move build

Expected Result

Successful

Actual Result

UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
Failed to build Move modules: Failed to resolve dependencies for package 'test'

Caused by:
    0: Fetching 'Sui'
    1: Failed to reset to latest Git state 'framework/testnet' for package 'Sui', to skip set --skip-fetch-latest-git-deps | Exit status: exit code: 128.

System Information

stefan-mysten commented 5 months ago

Hi @datznt ,

It might be that the git checkout in your cache seems broken in some way -- the fix is to delete the cache from .move (or delete the whole of ~/.move at the moment). Be careful before deleting any files/folders to make sure you're not deleting any needed files.

datznt commented 5 months ago

Hi @datznt ,

It might be that the git checkout in your cache seems broken in some way -- the fix is to delete the cache from .move (or delete the whole of ~/.move at the moment). Be careful before deleting any files/folders to make sure you're not deleting any needed files.

Thanks for replying I tried deleting the .move folder and it didn't resolve. Other ways I have tried: sui move build --force

stefan-mysten commented 5 months ago

Sorry to hear that. Let's try to find more information about your environment.

Is it possible to share your Move toml file? I can try to reproduce on a Windows machine if I get the toml.

datznt commented 5 months ago

Sorry to hear that. Let's try to find more information about your environment.

Is it possible to share your Move toml file? I can try to reproduce on a Windows machine if I get the toml.

Try this command and you will have Move toml file: sui move new test

Or contents of my Move toml file:

[package]
name = "test"

# edition = "2024.alpha" # To use the Move 2024 edition, currently in alpha
# license = ""           # e.g., "MIT", "GPL", "Apache 2.0"
# authors = ["..."]      # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"]

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

# For remote import, use the `{ git = "...", subdir = "...", rev = "..." }`.
# Revision can be a branch, a tag, and a commit hash.
# MyRemotePackage = { git = "https://some.remote/host.git", subdir = "remote/path", rev = "main" }

# For local dependencies use `local = path`. Path is relative to the package root
# Local = { local = "../path/to" }

# To resolve a version conflict and force a specific version for dependency
# override use `override = true`
# Override = { local = "../conflicting/version", override = true }

[addresses]
test = "0x0"

# Named addresses will be accessible in Move as `@name`. They're also exported:
# for example, `std = "0x1"` is exported by the Standard Library.
# alice = "0xA11CE"

[dev-dependencies]
# The dev-dependencies section allows overriding dependencies for `--test` and
# `--dev` modes. You can introduce test-only dependencies here.
# Local = { local = "../path/to/dev-build" }

[dev-addresses]
# The dev-addresses section allows overwriting named addresses for the `--test`
# and `--dev` modes.
# alice = "0xB0B"
stefan-mysten commented 5 months ago

Thanks for the info. I am able to reproduce the error on Win10. I am looking into it and hope to get back soon with more info on how to fix this.

stefan-mysten commented 5 months ago

Thanks for your patience. I relayed internally that something is wrong. In the meantime, if you can, I'd recommend to use an older version. I tested the v1.20.0 on my Win10 machine and it compiled successfully. You can either install it via choco

choco uninstall sui
choco install sui --version=1.20.0

or you can download the release binary https://github.com/MystenLabs/sui/releases

datznt commented 5 months ago

Thanks for your patience. I relayed internally that something is wrong. In the meantime, if you can, I'd recommend to use an older version. I tested the v1.20.0 on my Win10 machine and it compiled successfully. You can either install it via choco

choco uninstall sui
choco install sui --version=1.20.0

or you can download the release binary https://github.com/MystenLabs/sui/releases

Love it, hope Sui will be better

stefan-mysten commented 5 months ago

We're working on improving Windows support, so please keep filing issues to help us identify unknown issues.

datznt commented 5 months ago

We're working on improving Windows support, so please keep filing issues to help us identify unknown issues.

Hi, I tried v1.19.1 and it worked with command sui move build --skip-fetch-latest-git-deps. Versions from v1.20.0 and above all have the same problem like:

>> sui -V
sui 1.20.0-8ea6008-dirty
>> sui move build                             
UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
Failed to build Move modules: Failed to resolve dependencies for package 'wasi'

Caused by:
    0: Fetching 'Sui'
    1: Failed to reset to latest Git state 'framework/testnet' for package 'Sui', to skip set --skip-fetch-latest-git-deps | Exit status: exit code: 128.

When I build with flag --skip-fetch-latest-git-deps it shows another error like:

>> sui move build --skip-fetch-latest-git-deps
INCLUDING DEPENDENCY Sui
INCLUDING DEPENDENCY MoveStdlib
BUILDING wasi
Total number of linter warnings suppressed: 2 (filtered categories: 1)
Failed to build Move modules: The system cannot find the path specified. (os error 3).
stefan-mysten commented 5 months ago

@datznt thanks for the detailed info. That does not sound good. I'll look into it asap.

datznt commented 5 months ago

@datznt thanks for the detailed info. That does not sound good. I'll look into it asap.

I found many people with the same error as me on discord. Now i will work with version v1.19.1

stefan-mysten commented 5 months ago

Thanks for reporting this. It might be some issue related to folder permissions somehow. If you ever get the chance, you could try to use sui move build --install-dir <DIR> and give a path to a directory where you have full access. Alternatively, you could try with a different terminal though I guess that's not the issue, but who knows how permissions are handled by the console.

stefan-mysten commented 5 months ago

@datznt could you also tell me your Git version?

datznt commented 5 months ago

@datznt could you also tell me your Git version?

here: git version 2.41.0.windows.3

windyund commented 5 months ago

I also meet same error in macOs

os version: Macos sonoma 14.4.1 sui version: 1.21.1 git version: 2.39.3 (Apple Git-146) rustc 1.77.0 (aedd173a2 2024-03-17) @stefan-mysten

stefan-mysten commented 5 months ago

@windyund thanks for reporting. Have you tried any of the suggested fixes (remove .move folder, install older version, etc), and did any of those work?

summertoo commented 5 months ago

Steps to Reproduce Issue

I had some errors when trying to build the project: Failed to build Move modules: Failed to resolve dependencies for package 'test'

e.g.

  1. choco install sui
  2. sui move new test
  3. cd test && sui move build

Expected Result

Successful

Actual Result

UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
Failed to build Move modules: Failed to resolve dependencies for package 'test'

Caused by:
    0: Fetching 'Sui'
    1: Failed to reset to latest Git state 'framework/testnet' for package 'Sui', to skip set --skip-fetch-latest-git-deps | Exit status: exit code: 128.

System Information

  • OS: Windows 11
  • Compiler: sui 1.21.1-5f2bfb1-dirty
  • sui client active-env: testnet
  • rustup -V: rustup 1.27.0 (bbb9276d2 2024-03-08)
  • git -v: git version 2.41.0.windows.3

check your Move.tml and edit the [dependencies]

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

datznt commented 5 months ago

@summertoo I tried v1.19.1 and it worked

summertoo commented 5 months ago

@datznt
v1.19.1 is ok. but v1.20.1 and v1.21.1 is not work... >-<

tnowacki commented 5 months ago

We are still investigating. But we have noticed that it seems to be working with PowerShell. You might try that and see if it resolves any issues while we continue to try and fix the root problem.

cgswords commented 5 months ago

In addition to PowerShell, try enabling long paths via git config:

git config --system core.longpaths true

huisq commented 5 months ago

I'm still getting this error with 1.19.1 version. Any idea? sui -V: sui 1.19.1-041c5f2-dirty image

stefan-mysten commented 5 months ago

@huisq are you on Windows? If yes, can you do the following and let us know if any worked or not:

huisq commented 5 months ago

Yes, using Windows My Move.toml `[package] name = "MyFirstPackage" version = "0.0.1"

[dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/devnet" } [addresses] my_first_package = "0x0"` image now it just doesn't build at all and with sui move build --skip-dependency-verification image

summertoo commented 5 months ago

@datznt v1.19.1 is ok. but v1.20.1 and v1.21.1 is not work... >-<

It seems that using Powershell is working properly

stefan-mysten commented 5 months ago

@huisq thanks. The --skip-dependency-verification flag is for sui client publish, sorry, I messed them up.

What terminal are you using? Can you try with Powershell with admin rights?

tnowacki commented 5 months ago

We think we have fixed it for windows with cmd.exe. Sorry about the issue! The fix should be out in 1.23

windyund commented 5 months ago

@windyund thanks for reporting. Have you tried any of the suggested fixes (remove .move folder, install older version, etc), and did any of those work?

I can execute it in Powershell, but the terminal fails

huisq commented 5 months ago

still fails for me at powershell, terminal, and basically tried every solution above.

stefan-mysten commented 5 months ago

@huisq sorry to hear that. Could you please provide a bit more details about your setup?

Ovodo commented 4 months ago

hey I am using wsl2 and i am getting a similar error image

here is my move.toml file image

stefan-mysten commented 4 months ago

@Ovodo could you share a few more details?

Ovodo commented 4 months ago

I am using the latest sui version 1.24. upgraded to this from 1.22 to see if this will fix the error but didnt. Yes i tried moving it as close as possible to the mnt/ folder. It was working fine some weeks ago but suddenly started to see this error. I also had sui on my windows system too but wasnt working fine so i tried wsl. don't know if there is a conflict but as i said it was working earlier some weeks ago.

stefan-mysten commented 4 months ago

@Ovodo thanks for all the extra information. Let me try installing WSL on a Win11 machine that I have and see if I can replicate this error.

stefan-mysten commented 4 months ago

@Ovodo unfortunately I cannot replicate this error on my WSL environment (Ubuntu-22.04). I found a post on Reddit mentioning to try not using the /mnt/c folder, and use instead the home folder of WSL (~), due to issues with symlinks and others. Can you try that?

here's my config:

sui -V
sui 1.24.0-92ba3bc

cat /proc/version
Linux version 5.10.102.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Wed Mar 2 00:30:59 UTC 2022
Ovodo commented 4 months ago

okay thank you. i will try this

stefan-mysten commented 4 months ago

@Ovodo great, let me know if it works or not, and then we can see how we can further debug it.

0xDatapunk commented 4 months ago

I am on mac, and got similar issue:

% sui move build UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git Failed to build Move modules: Failed to resolve dependencies for package 'sui_nft'

Caused by: 0: Fetching 'Sui' 1: Failed to fetch to latest Git state for package 'Sui', to skip set --skip-fetch-latest-git-deps | Exit status: exit status: 128. % sui -V
sui 1.24.1-2aadf14aa

stefan-mysten commented 4 months ago

@0xDatapunk sorry to hear you've been having issues. Did any of the proposed solutions from above work for you? For example:

delete the .move folder in your project, including any external crates folder, and any Move.lock files
0xDatapunk commented 4 months ago

it seemed to have helped. Thanks so much!

stefan-mysten commented 4 months ago

@0xDatapunk glad to hear that helped.

stefan-mysten commented 4 months ago

@Ovodo I have not heard back from you, so I assume you managed to figure it out?

Ovodo commented 4 months ago

Sorry @stefan-mysten i havent gotten back to you. i have been focused on the frontend aspect of the app since. I just tried this and i am getting a similar error image image

Ovodo commented 4 months ago

It says error parsing manifest. I think theres a problem in identifying the remote repo. I just used the sui move new command to create a new poject and then the error when i try to run test or build.

stefan-mysten commented 4 months ago

Thanks @Ovodo. I am not sure how to debug this, but maybe could you try this: RUST_LOG=debug sui move build and share the results with me?

Ovodo commented 4 months ago

I am getting something similar. just with the debug line and my cli version [image: image.png]

On Wed, May 15, 2024 at 4:30 PM stefan-mysten @.***> wrote:

Thanks @Ovodo https://github.com/Ovodo. I am not sure how to debug this, but maybe could you try this: RUST_LOG=debug sui move build and share the results with me?

— Reply to this email directly, view it on GitHub https://github.com/MystenLabs/sui/issues/16906#issuecomment-2112863713, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZRQLAKCYUOBSMGEGO754MLZCN5QBAVCNFSM6AAAAABFLIWPTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJSHA3DGNZRGM . You are receiving this because you were mentioned.Message ID: @.***>

yandrushchak commented 4 months ago

Happened to me as well, was able to troubleshoot it by manually fetching SUI git repo.

Steps that fixed this problem for me:

  1. Go to %userprofile%/.move folder
  2. Fetch https://github.com/MystenLabs/sui.git repo framework/testnet to a https___github_com_MystenLabs_sui_git_framework__testnet folder (assuming the framework/testnet branch is specified in your Move.toml)
  3. For me, the previous step returned some weird git errors (fatal: early EOF fatal: fetch-pack: invalid index-pack outputing sideband packet). I assume that's the root cause of failed sui move build command. Fixed this by first fetching the main branch, and switching to framework/testnet afterwards.
  4. After doing this, sui move build works fine since it no longer has to fetch an entire SUI repo.

It seems like SUI CLI just swallows any git clone errors. It would be much easier to troubleshoot if it would expose these errors in its error output.

Ovodo commented 3 months ago

Thank you. this helped me. I have been able to download the repo manually and link it with the local method for adding dependencies to the move.toml file. 👍🏽

On Mon, May 20, 2024 at 4:32 PM Yevhenii Andrushchak < @.***> wrote:

Happened to me as well, was able to troubleshoot it by manually fetching SUI git repo.

Steps that fixed this problem for me:

  1. Go to %userprofile%/.move folder
  2. Fetch https://github.com/MystenLabs/sui.git repo framework/testnet to a https_github_com_MystenLabs_sui_git_frameworktestnet folder (assuming the framework/testnet branch is specified in your Move.toml)
  3. For me, the previous step returned some weird git errors (fatal: early EOF fatal: fetch-pack: invalid index-pack outputing sideband packet). I assume that's the root cause of failed sui move build command. Fixed this by first fetching the main branch, and switching to framework/testnet afterwards.
  4. After doing this, sui move build works fine since it no longer has to fetch an entire SUI repo.

It seems like SUI CLI just swallows any git clone errors. It would be much easier to troubleshoot if it would expose these errors in its error output.

— Reply to this email directly, view it on GitHub https://github.com/MystenLabs/sui/issues/16906#issuecomment-2120696298, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZRQLAODQ2CSCL7FKQ7RECTZDIJPHAVCNFSM6AAAAABFLIWPTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQGY4TMMRZHA . You are receiving this because you were mentioned.Message ID: @.***>

MrReN commented 1 month ago

I have this same issue.

stefan-mysten commented 1 month ago

@MrReN can you please provide more details?