2

I am use the latest rust toolchain, compiler the pallet-ibc at the branch feature/dv-ics20 : https://github.com/octopus-network/substrate-ibc, this give the blow error.

suyinrong@suyinrongdeMacBook-Pro  /Volumes/Seagate Basic/octopus/substrate-ibc   feature/dv-ics20 ±  cargo build
warning: Patch `tendermint-light-client v0.23.5 (https://github.com/informalsystems/tendermint-rs?branch=v0.23.x#bcd57ab6)` was not used in the crate graph.
Patch `tendermint-rpc v0.23.5 (https://github.com/informalsystems/tendermint-rs?branch=v0.23.x#bcd57ab6)` was not used in the crate graph.
Patch `tendermint-testgen v0.23.5 (https://github.com/informalsystems/tendermint-rs?branch=v0.23.x#bcd57ab6)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
   Compiling pallet-ibc v3.0.0-pre.0 (/Volumes/Seagate Basic/octopus/substrate-ibc)
error: failed to run custom build command for `pallet-ibc v3.0.0-pre.0 (/Volumes/Seagate Basic/octopus/substrate-ibc)`

Caused by:
  process didn't exit successfully: `/Volumes/Seagate Basic/octopus/substrate-ibc/target/debug/build/pallet-ibc-b83f4d16dd5692b4/build-script-build` (exit status: 1)
  --- stdout
  Information that should be included in a bug report.
  Executing build command: "rustup" "run" "nightly" "cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/Volumes/Seagate Basic/octopus/substrate-ibc/target/debug/wbuild/pallet-ibc/Cargo.toml" "--color=always" "--release"
  Using rustc version: rustc 1.61.0-nightly (c84f39e6c 2022-03-20)


  --- stderr
  warning: Patch `tendermint-light-client v0.23.5 (https://github.com/informalsystems/tendermint-rs?branch=v0.23.x#bcd57ab6)` was not used in the crate graph.
  Patch `tendermint-rpc v0.23.5 (https://github.com/informalsystems/tendermint-rs?branch=v0.23.x#bcd57ab6)` was not used in the crate graph.
  Patch `tendermint-testgen v0.23.5 (https://github.com/informalsystems/tendermint-rs?branch=v0.23.x#bcd57ab6)` was not used in the crate graph.
  Check that the patched package version and available features are compatible
  with the dependency requirements. If the patch has a different version from
  what is locked in the Cargo.lock file, run `cargo update` to use the new
  version. This may also occur with an optional dependency that is not enabled.
     Compiling ibc v0.12.0 (/Volumes/Seagate Basic/octopus/ibc-rs/modules)
  error: duplicate lang item in crate `std` (which `arrayvec` depends on): `panic_impl`.
    |
    = note: the lang item is first defined in crate `sp_io` (which `sp_application_crypto` depends on)
    = note: first definition in `sp_io` loaded from /Volumes/Seagate Basic/octopus/substrate-ibc/target/debug/wbuild/pallet-ibc/target/wasm32-unknown-unknown/release/deps/libsp_io-af37dfe030ffe3a3.rmeta
    = note: second definition in `std` loaded from /Users/suyinrong/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libstd-d9a8e4ca4a56d589.rlib

  error: duplicate lang item in crate `std` (which `arrayvec` depends on): `oom`.
    |
    = note: the lang item is first defined in crate `sp_io` (which `sp_application_crypto` depends on)
    = note: first definition in `sp_io` loaded from /Volumes/Seagate Basic/octopus/substrate-ibc/target/debug/wbuild/pallet-ibc/target/wasm32-unknown-unknown/release/deps/libsp_io-af37dfe030ffe3a3.rmeta
    = note: second definition in `std` loaded from /Users/suyinrong/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libstd-d9a8e4ca4a56d589.rlib

  error: could not compile `ibc` due to 2 previous errors

My Env:

Default host: aarch64-apple-darwin
rustup home:  /Users/suyinrong/.rustup

installed toolchains
--------------------

stable-aarch64-apple-darwin
nightly-2022-02-17-aarch64-apple-darwin
nightly-aarch64-apple-darwin
1.58-aarch64-apple-darwin (default)

installed targets for active toolchain
--------------------------------------

aarch64-apple-darwin
wasm32-unknown-unknown

active toolchain
----------------

1.58-aarch64-apple-darwin (default)
rustc 1.58.1 (db9d1b20b 2022-01-20)

2 Answers 2

2

If you read the error:

Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.

Did you try this?

error: duplicate lang item is typically caused by versioning issues of some kind. So if update doesn't do it, it may be something more systemic. You might want to file an issue with the upstream IBC repo you are using.

2
  • 1
    but, just run cargo update also have this erorr.
    – D.Davirain
    Commented Mar 21, 2022 at 17:46
  • file an issue, after inspecting your lock file for conflicting versions of things and why they are present.
    – Nuke
    Commented Mar 21, 2022 at 17:47
0

If you have a local crate, add this in the lib.rs:

#![cfg_attr(not(feature = "std"), no_std)]

If you use remote crates, add default-features = false, in your Cargo.toml. For example:

imported_crate = { git = "...", default-features = false, branch = "..." }

see more details about no_std: How to resolve duplicate lang item error?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.