Cannot build Iroha_client_cli: cargo.lock file does not exist

104 views Asked by At

I'm trying to build the iroha_client_cli on Macos with Apple M1 chip.

I getting the following error:


   Compiling wasm-opt v0.114.2
   Compiling iroha_wasm_builder v2.0.0-pre-rc.20 (/$HOME/dev/iroha/wasm_builder)
   Compiling iroha_client v2.0.0-pre-rc.20 (/$HOME/dev/iroha/client)
error: failed to run custom build command for `iroha_client v2.0.0-pre-rc.20 (/$HOME/dev/iroha/client)`

Caused by:
  process didn't exit successfully: `/$HOME/dev/iroha/target/release/build/iroha_client-e762088dc7f585a8/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=tests/integration/smartcontracts

  --- stderr
  Error: Failed to check the smartcontract at path: /$HOME/dev/iroha/client/tests/integration/smartcontracts

  Caused by:
      `cargo check` returned non zero exit code (exit status: 101). Stderr:
      warning: /$HOME/dev/iroha/smart_contract/trigger/Cargo.toml: unused manifest key `lints` (may be supported in a future version)

      consider passing `-Zlints` to enable this feature.
      warning: /$HOME/dev/iroha/smart_contract/executor/Cargo.toml: unused manifest key `lints` (may be supported in a future version)

      consider passing `-Zlints` to enable this feature.
      warning: /$HOME/dev/iroha/schema/Cargo.toml: unused manifest key `lints` (may be supported in a future version)

      consider passing `-Zlints` to enable this feature.
      error: "/$HOME/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:
              rustup component add rust-src --toolchain nightly-2023-06-25-x86_64-apple-darwin


  Location:
      wasm_builder/src/lib.rs:415:9

running rustup component add rust-src --toolchain nightly-2023-06-25-x86_64-apple-darwindoesnt change anything. I already did and I got the same error.

I also tried cleaning up cargo and using these toolchains:

stable-aarch64-apple-darwin (default)
stable-x86_64-apple-darwin
nightly-2023-06-25-x86_64-apple-darwin

Also tried with +nightly, and got same error:

cargo +nightly build -p iroha_client_cli --release 

Other info:

cargo -V
rustc --version
cargo 1.73.0 (9c4383fb5 2023-08-26)
rustc 1.73.0 (cc66ad468 2023-10-03)

rustup which rustc
rustup which cargo
/$HOME/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc
/$HOME/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo

type rustc
type cargo
rustc is $HOME.cargo/bin/rustc
cargo is $HOME.cargo/bin/cargo
1

There are 1 answers

0
Matias Salimbene On BEST ANSWER

I got the answer from Discord, the install script wasn't detecting my arch:

Vladislav, [6 nov 2023, 12:35:09]: I'm not sure why your nightly channel is x86-64 with M1

Try adding this one nightly-2023-06-25-aarch64-apple-darwin

And then do rustup default nightly-2023-06-25-aarch64-apple-darwin Rustup tries to setup the latest version of nightly which does not help in your case