sui
sui copied to clipboard
Unable to build project
Unable to build project
dep_package % sui move build --force
UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
INCLUDING DEPENDENCY Sui
INCLUDING DEPENDENCY MoveStdlib
BUILDING dep_package
error[Sui E01001]: invalid object construction
┌─ /Users/.move/https___github_com_MystenLabs_sui_git_framework__testnet/crates/sui-framework/packages/sui-framework/sources/random.move:53:20
│
53 │ let self = Random {
│ ╭────────────────────^
54 │ │ id: object::randomness_state(),
│ │ -- -------------------------- Non fresh UID from this position
│ │ │
│ │ The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object
55 │ │ inner: versioned::create(version, inner, ctx),
56 │ │ };
│ ╰─────────^ Invalid object creation without a newly created UID.
Failed to build Move modules: Compilation error.
Expected Result
When running sui move build --force can't compile
System Information
- OS: MacOS
- Compiler: SUI testnet
This was fixed yesterday. Try to reinstall the sui cli either through
cargo install --locked --git https://github.com/MystenLabs/sui.git sui
or through homebrew
brew tap mystenlabs/tap
brew install mystenlabs/tap/sui
I am not quite sure that fixes it as the approach above is for mainnet right? It seems to be fine for mainnet but for testnet we would need to use
cargo install --locked --git https://github.com/MystenLabs/sui.git sui --branch testnet
However building this here locally is broken with
error[E0599]: no function or associated item named `random_for_testing_only` found for struct `SuiAddress` in the current scope
--> crates/sui-json-rpc-types/src/sui_event.rs:163:33
|
163 | sender: SuiAddress::random_for_testing_only(),
| ^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `SuiAddress`
@stefan-mysten Yes, still broken for both testnet and devnet.
@inanisvitae @andyjsbell yes, this was merged on main and will probably be merged into testnet/devnet next week as per release schedule. I will see if I can cherry pick it into those branches. Thanks for the patience!
@inanisvitae @andyjsbell - I cherry picked the fix into the release branch, which will be used for the release on Monday (devnet 1.16.0) / Tuesday (testnet 1.15.0). Thanks for your patience. If you cannot wait until then, either use main or releases/sui-v1.15.0-release branch, which will be the branch used for the Tuesday release (testnet).
I have same problem, and fix it as follow:
- download the binary file: https://github.com/MystenLabs/sui/releases/tag/mainnet-v1.14.2
- rename the target/release/sui-macos-x86_64 to sui
- move the sui file to ~/.cargo/bin
- cd ~/.move/https___github_com_MystenLabs_sui_git_framework__testnet/
- change the branch to releases/sui-v1.14.0-release, and pull the remote code.
For reference, other OG have provided simpler solutions, but I have not tried:
- cargo install --locked --git https://github.com/MystenLabs/sui.git —tag mainnet-v1.14.2 sui
- change the move.toml, the git branch version.
Just for the record, if you use Homebrew, you can install directly from our tap. https://docs.sui.io/guides/developer/getting-started/sui-install#install-homebrew
This problem should have been fixed by now, so closing the issue. Please open a new issue if you encounter any problems.