3

I was upgrading a para chain from polkadot version 0.9.28 to v0.9.29 when I encountered a few suspicious looking build errors originating from deep inside substrate.

To eliminate the risk of some integration error I first built the branch polkadot-v0.9.28 on cumulus repo without any problems then checked out polkadot-v0.9.29 and were able to reproduce the same build error.

cumulus$ cargo build --release
   Compiling sp-keystore v0.12.0 (https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358)
   Compiling sp-state-machine v0.12.0 (https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358)
   Compiling sc-allocator v4.1.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358)
   Compiling sp-rpc v6.0.0 (https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358)
   Compiling librocksdb-sys v0.6.1+6.28.2
   Compiling rococo-runtime v0.9.29 (https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44)
   Compiling polkadot-runtime v0.9.29 (https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44)
   Compiling kusama-runtime v0.9.29 (https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44)
   Compiling polkadot-test-runtime v0.9.29 (https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44)
   Compiling cumulus-test-runtime v0.1.0 (/home/simson/nodle/cumulus/test/runtime)
   Compiling cumulus-test-relay-validation-worker-provider v0.1.0 (/home/simson/nodle/cumulus/test/relay-validation-worker-provider)
   Compiling parachain-template-runtime v0.1.0 (/home/simson/nodle/cumulus/parachain-template/runtime)
   Compiling statemine-runtime v2.0.0 (/home/simson/nodle/cumulus/parachains/runtimes/assets/statemine)
   Compiling collectives-polkadot-runtime v1.0.0 (/home/simson/nodle/cumulus/parachains/runtimes/collectives/collectives-polkadot)
   Compiling shell-runtime v0.1.0 (/home/simson/nodle/cumulus/parachains/runtimes/starters/shell)
   Compiling rococo-parachain-runtime v0.1.0 (/home/simson/nodle/cumulus/parachains/runtimes/testing/rococo-parachain)
   Compiling seedling-runtime v0.1.0 (/home/simson/nodle/cumulus/parachains/runtimes/starters/seedling)
   Compiling statemint-runtime v1.0.0 (/home/simson/nodle/cumulus/parachains/runtimes/assets/statemint)
   Compiling contracts-rococo-runtime v0.2.0 (/home/simson/nodle/cumulus/parachains/runtimes/contracts/contracts-rococo)
error: `sp_trie::recorder::Recorder<H>::as_trie_recorder::{opaque#0}<'_>` does not live long enough
   --> /home/simson/.cargo/git/checkouts/substrate-7e08433d4c370a21/7c4ac35/primitives/state-machine/src/trie_backend_essence.rs:181:44
    |
181 |         let recorder = recorder.as_mut().map(|r| r as _);
    |                                                  ^

error: `sp_trie::recorder::Recorder<H>::as_trie_recorder::{opaque#0}<'_>` does not live long enough
   --> /home/simson/.cargo/git/checkouts/substrate-7e08433d4c370a21/7c4ac35/primitives/state-machine/src/trie_backend_essence.rs:219:44
    |
219 |         let recorder = recorder.as_mut().map(|r| r as _);
    |                                                  ^

error: could not compile `sp-state-machine` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `cumulus-test-relay-validation-worker-provider v0.1.0 (/home/simson/nodle/cumulus/test/relay-validation-worker-provider)`

Caused by:
  process didn't exit successfully: `/home/simson/nodle/cumulus/target/release/build/cumulus-test-relay-validation-worker-provider-12e504f71174b33a/build-script-build` (exit status: 1)

Any ideas what could be the problem here and how to solve it?

1
  • I've just compiled cumulus brach polkadot-v0.9.29 without any errors whatsoever. Maybe it's the rust version? Try running rustup update. Sep 29, 2022 at 9:57

1 Answer 1

3

Yeah that is a recent breakage. Here is the commit that fixed it on master. I think this is some regression in rustc: https://github.com/rust-lang/rust/issues/100544

1
  • This seems to be happening again on rustc 1.68.0-nightly (cc47b0699 2023-01-08). sp_trie::recorder::Recorder<H>::as_trie_recorder::{opaque#0}<'_> does not live long enough Jan 9 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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