I found the exact same first issue here and I checked I don't have any duplicate dependencies. I also try cargo clean & cargo update
command, nothing changes.
ganesholi@Ganeshs-MacBook-Air MarketplaceMVP_Substrate % cargo build --release
Compiling sp-state-machine v0.28.0 (https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2f)
Compiling node-template-runtime v4.0.0-dev (/Users/ganesholi/Developer/MarketplaceMVP_Substrate/runtime)
error: `<C as TrieCacheProvider<H>>::Cache<'_>` does not live long enough
--> /Users/ganesholi/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/primitives/state-machine/src/trie_backend_essence.rs:305:38
|
305 | let cache = cache.as_mut().map(|c| c as _);
| ^
error: could not compile `sp-state-machine` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `node-template-runtime v4.0.0-dev (/Users/ganesholi/Developer/MarketplaceMVP_Substrate/runtime)`
Caused by:
process didn't exit successfully: `/Users/ganesholi/Developer/MarketplaceMVP_Substrate/target/release/build/node-template-runtime-52c2d654e2027d65/build-script-build` (exit status: 1)
--- stdout
Information that should be included in a bug report.
Executing build command: RUSTFLAGS="-C target-cpu=mvp -C target-feature=-sign-ext -C link-arg=--export-table -Clink-arg=--export=__heap_base -C link-arg=--import-memory " SKIP_WASM_BUILD="" "/Users/ganesholi/.rustup/toolchains/nightly-2023-01-01-aarch64-apple-darwin/bin/cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/Users/ganesholi/Developer/MarketplaceMVP_Substrate/target/release/wbuild/node-template-runtime/Cargo.toml" "--color=always" "--profile" "release"
Using rustc version: rustc 1.68.0-nightly (574b64a97 2022-12-31)
--- stderr
Compiling getrandom v0.2.10
Compiling syn v2.0.29
Compiling syn v1.0.109
Compiling memchr v2.5.0
Compiling generic-array v0.14.7
Compiling ahash v0.7.6
Compiling const-oid v0.9.5
Compiling ppv-lite86 v0.2.17
error: the wasm*-unknown-unknown targets are not supported by default, you may need to enable the "js" feature. For more information see: https://docs.rs/getrandom/#webassembly-support
--> /Users/ganesholi/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.2.10/src/lib.rs:285:9
|
285 | / compile_error!("the wasm*-unknown-unknown targets are not supported by \
286 | | default, you may need to enable the \"js\" feature. \
287 | | For more information see: \
288 | | https://docs.rs/getrandom/#webassembly-support");
| |________________________________________________________________________^
error[E0433]: failed to resolve: use of undeclared crate or module `imp`
--> /Users/ganesholi/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.2.10/src/lib.rs:341:9
|
341 | imp::getrandom_inner(dest)?;
| ^^^ use of undeclared crate or module `imp`
For more information about this error, try `rustc --explain E0433`.
error: could not compile `getrandom` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
ganesholi@Ganeshs-MacBook-Air MarketplaceMVP_Substrate %
This is my github Someone please suggest me why I am getting this issue?
I had the same issue when updating my substrate-contracts-node
cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git
Cheers,
--locked
for thecargo install
.