-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Sui Rust SDK Bug #22336
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
Comments
Thank you for opening this issue, a team member will review it shortly. Until then, please do not interact with any users that claim to be from Sui support and do not click on any links! |
Cargo is able to find crates in a git repo by traversing the file tree: see Cargo's official documentation. I have multiple Rust projects using the sui-sdk crate, without importing move-core-types. Those compile perfectly. I checked on my Cargo.lock and the version used is the same as yours: 1.51.0 I'm on macOS and I tested with the exact same version of cargo as yours, it compiles. What you can try:
|
It works with but not with use sui_types::base_types::SuiAddress; Is this how you did it? |
Furthermore, I encountered an error after cloning https://github.com/MystenLabs/sui.git and attempting to run
As someone who is not an experienced Rust developer, I expected basic examples like this to run more smoothly. It would be helpful if these examples worked out of the box without requiring additional system setup or native dependencies. I am being this verbose to provide insight into how a less experienced developer approaches this (I saw that Sam Blackshear asked developers for feedback on what could be improved). |
Steps to Reproduce Issue
Follow the instructions here to get started with the Rust SDK: https://docs.sui.io/references/rust-sdk
Create a
Cargo.toml
with:Then create a
src
folder and add themain.rs
file as described in https://docs.sui.io/references/rust-sdk.Then run:
cargo build
Expected Result
It should build the project.
Actual Result
I get this error message:
I found this explanation for it:
It failed to find
move-core-types
becausesui-sdk
expects it as a local workspace dependency at a specific path (external-crates/move/crates/move-core-types
), but whensui-sdk
is used as a standalone Git or path dependency outside its original workspace, Cargo cannot resolve workspace-relative paths. Even if the files are present, Cargo looks formove-core-types
in your own project’s workspace context, not Sui's, so it fails unless you manually add that dependency or build within the full Sui repo.When I downloaded the Sui repo manually with
git clone
and then added the dependency assui-sdk = { path = "./sui/crates/sui-sdk" }
, it fixed the issue.System Information
Windows 11 / Ubuntu (tested with both)
cargo 1.87.0-nightly (1d1d646c0 2025-02-21)
The text was updated successfully, but these errors were encountered: