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
6.12k stars 11.16k forks source link

Can't install with --features gas-profiler #17274

Closed EasonC13 closed 6 months ago

EasonC13 commented 6 months ago

Steps to Reproduce Issue

I follow this document: https://docs.sui.io/references/cli/client#profile-a-transaction

At ubuntu 22.04, rustc 1.74.1

cargo install --locked --git https://github.com/MystenLabs/sui.git --branch mainnet sui --features gas-profiler --force

Then I got the following error

   Compiling nix v0.23.2
   Compiling fd-lock v3.0.8
   Compiling newline-converter v0.2.2
   Compiling ureq v2.9.1
   Compiling libtest-mimic v0.6.1
   Compiling miette-derive v7.0.0
   Compiling async-recursion v1.0.4
   Compiling backtrace-ext v0.2.1
   Compiling supports-hyperlinks v3.0.0
   Compiling owo-colors v4.0.0
   Compiling supports-unicode v3.0.0
   Compiling datatest-stable v0.1.3 (https://github.com/nextest-rs/datatest-stable.git?rev=72db7f6d1bbe36a5407e96b9488a581f763e106f#72db7f6d)
   Compiling inquire v0.6.2
   Compiling rusoto_kms v0.48.0
   Compiling rustyline-derive v0.7.0
   Compiling shell-words v1.1.0
   Compiling miette v7.0.0
   Compiling move-cli v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/external-crates/move/crates/move-cli)
   Compiling rustyline v9.1.2
   Compiling secp256k1 v0.27.0
   Compiling fastcrypto v0.1.7 (https://github.com/MystenLabs/fastcrypto?rev=d7a33a9f79271bfc19fc4c8816ea5467e4205e17#d7a33a9f)
   Compiling shared-crypto v0.0.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/shared-crypto)
   Compiling fastcrypto-tbls v0.1.0 (https://github.com/MystenLabs/fastcrypto?rev=d7a33a9f79271bfc19fc4c8816ea5467e4205e17#d7a33a9f)
   Compiling mysten-util-mem v0.11.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/mysten-util-mem)
   Compiling narwhal-crypto v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/narwhal/crypto)
   Compiling fastcrypto-zkp v0.1.2 (https://github.com/MystenLabs/fastcrypto?rev=d7a33a9f79271bfc19fc4c8816ea5467e4205e17#d7a33a9f)
   Compiling sui-tls v0.0.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-tls)
   Compiling jemalloc-ctl v0.5.0
   Compiling rustls-webpki v0.102.2
   Compiling tokio-rustls v0.25.0
   Compiling tonic v0.11.0
   Compiling narwhal-types v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/narwhal/types)
   Compiling tonic-health v0.11.0
   Compiling mysten-network v0.2.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/mysten-network)
   Compiling narwhal-config v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/narwhal/config)
   Compiling consensus-config v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/consensus/config)
   Compiling sui-types v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-types)
   Compiling zstd v0.12.3+zstd.1.5.2
   Compiling sui-keys v0.0.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-keys)
   Compiling sui-verifier-latest v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/latest/sui-verifier)
   Compiling sui-rest-api v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-rest-api)
   Compiling sui-config v0.0.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-config)
   Compiling sui-package-resolver v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-package-resolver)
   Compiling sui-json v0.0.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-json)
   Compiling sui-move-natives-latest v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/latest/sui-move-natives)
   Compiling sui-json-rpc-types v0.0.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-json-rpc-types)
   Compiling sui-move-build v1.23.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-move-build)
   Compiling sui-verifier-v0 v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/v0/sui-verifier)
   Compiling sui-move-natives-v2 v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/v2/sui-move-natives)
   Compiling sui-move-natives-v0 v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/v0/sui-move-natives)
   Compiling sui-move-natives-v1 v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/v1/sui-move-natives)
   Compiling sui-verifier-v1 v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/v1/sui-verifier)
   Compiling sui-framework v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-framework)
   Compiling sui-verifier-v2 v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/v2/sui-verifier)
   Compiling sui-adapter-v1 v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/v1/sui-adapter)
   Compiling sui-adapter-v2 v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/v2/sui-adapter)
   Compiling sui-adapter-v0 v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/v0/sui-adapter)
   Compiling sui-adapter-latest v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution/latest/sui-adapter)
   Compiling sui-transaction-builder v0.0.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-transaction-builder)
   Compiling sui-execution v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/sui-execution)
   Compiling sui-transaction-checks v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-transaction-checks)
   Compiling sui-json-rpc-api v0.0.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-json-rpc-api)
   Compiling sui-authority-aggregation v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-authority-aggregation)
   Compiling sui-move v1.23.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-move)
   Compiling sui-sdk v1.23.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-sdk)
   Compiling sui-package-management v1.23.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-package-management)
   Compiling sui-source-validation v1.23.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-source-validation)
   Compiling sui-framework-snapshot v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-framework-snapshot)
   Compiling sui-genesis-builder v0.0.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-genesis-builder)
   Compiling sui-swarm-config v0.0.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-swarm-config)
   Compiling rocksdb v0.21.0
   Compiling typed-store v0.4.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/typed-store)
   Compiling sui-storage v0.1.0 (/home/eason/.cargo/git/checkouts/sui-6ac459c53b1b685a/db6e04d/crates/sui-storage)
error[E0706]: functions in traits cannot be declared `async`
   --> consensus/core/src/network/anemo_network.rs:309:5
    |
309 |     async fn install_service(&mut self, network_keypair: NetworkKeyPair, service: Arc<S>) {
    |     -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |
    |     `async` because of this
    |
    = note: `async` trait functions are not currently supported
    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0706]: functions in traits cannot be declared `async`
   --> consensus/core/src/network/anemo_network.rs:482:5
    |
482 |     async fn stop(&mut self) {
    |     -----^^^^^^^^^^^^^^^^^^^
    |     |
    |     `async` because of this
    |
    = note: `async` trait functions are not currently supported
    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0706]: functions in traits cannot be declared `async`
   --> consensus/core/src/network/tonic_network.rs:425:5
    |
425 |     async fn install_service(&mut self, _network_keypair: NetworkKeyPair, service: Arc<S>) {
    |     -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |
    |     `async` because of this
    |
    = note: `async` trait functions are not currently supported
    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0706]: functions in traits cannot be declared `async`
   --> consensus/core/src/network/tonic_network.rs:475:5
    |
475 |     async fn stop(&mut self) {
    |     -----^^^^^^^^^^^^^^^^^^^
    |     |
    |     `async` because of this
    |
    = note: `async` trait functions are not currently supported
    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0706]: functions in traits cannot be declared `async`
   --> consensus/core/src/network/mod.rs:120:5
    |
120 |     async fn install_service(&mut self, network_keypair: NetworkKeyPair, service: Arc<S>);
    |     -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |
    |     `async` because of this
    |
    = note: `async` trait functions are not currently supported
    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0706]: functions in traits cannot be declared `async`
   --> consensus/core/src/network/mod.rs:123:5
    |
123 |     async fn stop(&mut self);
    |     -----^^^^^^^^^^^^^^^^^^^^
    |     |
    |     `async` because of this
    |
    = note: `async` trait functions are not currently supported
    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

For more information about this error, try `rustc --explain E0706`.
error: could not compile `consensus-core` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `sui v1.23.0 (https://github.com/MystenLabs/sui.git?branch=testnet#db6e04d4)`, intermediate artifacts can be found at `/tmp/cargo-install70Smes`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
EasonC13 commented 6 months ago

Fixed by updating rust to latest version:

rustup update stable

rustc 1.74.1 -> rustc 1.77.2

abdullahabro commented 5 months ago

@EasonC13 i also got similar errors while executing cargo install --locked --git https://github.com/MystenLabs/sui.git --branch mainnet sui

I also tried updating rust to the latest version by rustup update stable

but getting similar error still

Did you perform any additional step that i might be missing ?

EDIT : It worked , i just had to set default rust version to latest stable by rustup default <version>