paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.77k stars 633 forks source link

error[E0152]: duplicate lang item in crate `std` (which `memchr` depends on): `panic_impl`. #5199

Closed weimeme closed 1 month ago

weimeme commented 1 month ago

Is there an existing issue?

Experiencing problems? Have you tried our Stack Exchange first?

Description of bug

https://github.com/paritytech/polkadot-sdk.git

cd polkadot-sdk

rm Cargo.toml

cd substrate/bin/node

cargo check

err info:

mpiling tracing-gum-proc-macro v5.0.0 (/Users/xxx/Desktop/polkadot-sdk-polkadot-v1.15.0/polkadot/node/gum/proc-macro)
     Compiling pallet-staking-reward-curve v12.0.0 (/Users/xxx/Desktop/polkadot-sdk-polkadot-v1.15.0/substrate/frame/staking/reward-curve)
     Compiling sc-tracing-proc-macro v11.0.0 (/Users/xxx/Desktop/polkadot-sdk-polkadot-v1.15.0/substrate/client/tracing/proc-macro)
     Compiling sc-chain-spec-derive v12.0.0 (/Users/xxx/Desktop/polkadot-sdk-polkadot-v1.15.0/substrate/client/chain-spec/derive)
     Compiling sp-crypto-ec-utils v0.14.0 (/Users/xxx/Desktop/polkadot-sdk-polkadot-v1.15.0/substrate/primitives/crypto/ec-utils)
     Compiling kitchensink-runtime v3.0.0 (/Users/xxx/Desktop/polkadot-sdk-polkadot-v1.15.0/substrate/bin/node/runtime)
     Compiling node-primitives v2.0.0 (/Users/xxx/Desktop/polkadot-sdk-polkadot-v1.15.0/substrate/bin/node/primitives)
  error[E0152]: duplicate lang item in crate `std` (which `memchr` depends on): `panic_impl`.
    |
    = note: the lang item is first defined in crate `sp_io` (which `frame_support` depends on)
    = note: first definition in `sp_io` loaded from /Users/xxx/Desktop/polkadot-sdk-polkadot-v1.15.0/target/debug/wbuild/kitchensink-runtime/target/wasm32-unknown-unknown/release/deps/libsp_io-3681a6c1f9c760ed.rmeta
    = note: second definition in `std` loaded from /Users/xxx/Desktop/polkadot-sdk-polkadot-v1.15.0/target/debug/wbuild/kitchensink-runtime/target/wasm32-unknown-unknown/release/deps/libstd-0cabeb6643be4d7f.rmeta

  For more information about this error, try `rustc --explain E0152`.
  error: could not compile `frame-support` (lib) due to 1 previous error
  warning: build failed, waiting for other jobs to finish...

Steps to reproduce

https://github.com/paritytech/polkadot-sdk.git

cd polkadot-sdk

rm Cargo.toml

cd substrate/bin/node

cargo check
gui1117 commented 1 month ago

why do you remove Cargo.toml ?

I guess this messes up the feature...