Skip to content

Backport #7625#8089

Closed
athei wants to merge 8 commits intostable2503from
at/backport
Closed

Backport #7625#8089
athei wants to merge 8 commits intostable2503from
at/backport

Conversation

@athei
Copy link
Copy Markdown
Member

@athei athei commented Mar 28, 2025

This backports the update to Rust 1.84 which is required for building pallet-revive-fixtures. While doing this I was compiling the workspace locally. There is a lot of broken stuff. From bodged backports I presume. Can't fix that all by my own. Let's wee what the CI has to say and let's ping the relevant people.

Let's not merge with red CI again.

athei and others added 4 commits March 28, 2025 16:11
Ref paritytech/ci_cd#1107

We mainly need that so that we can finally compile the `pallet_revive`
fixtures on stable. I did my best to keep the commits focused on one
thing to make review easier.

All the changes are needed because rustc introduced more warnings or is
more strict about existing ones. Most of the stuff could just be fixed
and the commits should be pretty self explanatory. However, there are a
few this that are notable:

A lot of runtimes to write `impl` blocks inside functions. This makes
sense to reduce the amount of conditional compilation. I guess I could
have moved them into a module instead. But I think allowing it here
makes sense to avoid the code churn.

The FRAME macros emit code that references various features like `std`,
`runtime-benchmarks` or `try-runtime`. If a create that uses those
macros does not have those features we get this warning. Those were
mostly when defining a `mock` runtime. I opted for silencing the warning
in this case rather than adding not needed features.

For the benchmarking ui tests I opted for adding the `runtime-benchmark`
feature to the `Cargo.toml`.

I am bumping the `trybuild` version and regenerating the ui tests. The
old version seems to be incompatible. This requires us to pass
`deny_warnings` in `CARGO_ENCODED_RUSTFLAGS` as `RUSTFLAGS` is ignored
in the new version.

This is no longer needed since the latest stable will compile them fine
using the `RUSTC_BOOTSTRAP=1`.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@athei athei requested review from a team and koute as code owners March 28, 2025 15:29
@paritytech-review-bot paritytech-review-bot bot requested a review from a team March 28, 2025 15:30
@github-actions
Copy link
Copy Markdown
Contributor

This pull request is amending an existing release. Please proceed with extreme caution,
as to not impact downstream teams that rely on the stability of it. Some things to consider:

  • Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change.
  • Should be a legit fix for some bug, not adding tons of new features.
  • Must either be already audited or not need an audit.
Emergency Bypass

If you really need to bypass this check: add validate: false to each crate
in the Prdoc where a breaking change is introduced. This will release a new major
version of that crate and all its reverse dependencies and basically break the release.

@athei
Copy link
Copy Markdown
Member Author

athei commented Mar 28, 2025

/cmd fmt

@acatangiu
Copy link
Copy Markdown
Contributor

@athei let me know if you need any help with this PR. Like you said, we should get the CI green before merging any other PRs to 2503.

@EgorPopelyaev EgorPopelyaev added the A3-backport Pull request is already reviewed well in another branch. label Mar 31, 2025
@athei
Copy link
Copy Markdown
Member Author

athei commented Mar 31, 2025

The current failure of the CI needs some CI script changes I guess. I checks for some hard coded features which we removed. Will look into that. But we really need to remove the git dependency from the repo. It makes releasing a massive PITA. Can't be to much to a ask to publish to crates.io if you want to have your stuff included here.

@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/14194143915
Failed job name: fmt

@athei
Copy link
Copy Markdown
Member Author

athei commented Apr 1, 2025

/cmt fmt

@iulianbarbu
Copy link
Copy Markdown
Contributor

I think this is pending adding a prdoc and fixing fmt?

@athei
Copy link
Copy Markdown
Member Author

athei commented Apr 1, 2025

I think this is pending adding a prdoc and fixing fmt?

There is probably more:

===========================================
======= Violation of rule: frame crates must not depend on anything in /client
===========================================
./benchmarking/Cargo.toml:40:sc-client-db = { path = "../../client/db", default-features = false }

@athei
Copy link
Copy Markdown
Member Author

athei commented Apr 1, 2025

Still doesn't compile:

error[E0432]: unresolved import `kitchensink_runtime::genesis_config_presets`
  --> substrate/bin/node/cli/src/chain_spec.rs:25:2
   |
25 |     genesis_config_presets::{session_keys, Staker, STASH},
   |     ^^^^^^^^^^^^^^^^^^^^^^ could not find `genesis_config_presets` in `kitchensink_runtime`

error[E0425]: cannot find value `DOLLARS` in this scope
  --> substrate/bin/node/cli/src/chain_spec.rs:49:41
   |
49 | const ENDOWMENT: Balance = 10_000_000 * DOLLARS;
   |                                         ^^^^^^^ not found in this scope
   |
help: consider importing one of these constants
   |
21 + use crate::chain_spec::testnet_parachains_constants::westend::currency::DOLLARS;
   |
21 + use kitchensink_runtime::constants::currency::DOLLARS;
   |

error[E0412]: cannot find type `SessionKeys` in this scope
  --> substrate/bin/node/cli/src/chain_spec.rs:81:6
   |
81 | ) -> SessionKeys {
   |      ^^^^^^^^^^^ not found in this scope
   |
help: consider importing one of these items
   |
21 + use crate::chain_spec::pallet_revive_eth_rpc::subxt_client::runtime_apis::session_keys::SessionKeys;
   |
21 + use crate::chain_spec::pallet_revive_eth_rpc::subxt_client::runtime_types::asset_hub_westend_runtime::SessionKeys;
   |
21 + use crate::chain_spec::sp_session::SessionKeys;
   |
21 + use kitchensink_runtime::SessionKeys;
   |

error[E0422]: cannot find struct, variant or union type `SessionKeys` in this scope
  --> substrate/bin/node/cli/src/chain_spec.rs:82:2
   |
82 |     SessionKeys { grandpa, babe, im_online, authority_discovery, mixnet, beefy }
   |     ^^^^^^^^^^^ not found in this scope
   |
help: consider importing one of these structs
   |
21 + use crate::chain_spec::pallet_revive_eth_rpc::subxt_client::runtime_apis::session_keys::SessionKeys;
   |
21 + use crate::chain_spec::pallet_revive_eth_rpc::subxt_client::runtime_types::asset_hub_westend_runtime::SessionKeys;
   |
21 + use kitchensink_runtime::SessionKeys;
   |

error[E0425]: cannot find value `dev_stakers` in this scope
   --> substrate/bin/node/cli/src/chain_spec.rs:395:18
    |
395 |             "devStakers": dev_stakers
    |                           ^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DOLLARS` in this scope
   --> substrate/bin/node/cli/src/chain_spec.rs:422:26
    |
422 |             "minCreateBond": 10 * DOLLARS,
    |                                   ^^^^^^^ not found in this scope
    |
help: consider importing one of these constants
    |
21  + use crate::chain_spec::testnet_parachains_constants::westend::currency::DOLLARS;
    |
21  + use kitchensink_runtime::constants::currency::DOLLARS;
    |

error[E0425]: cannot find value `DOLLARS` in this scope
   --> substrate/bin/node/cli/src/chain_spec.rs:423:23
    |
423 |             "minJoinBond": 1 * DOLLARS,
    |                                ^^^^^^^ not found in this scope
    |
help: consider importing one of these constants
    |
21  + use crate::chain_spec::testnet_parachains_constants::westend::currency::DOLLARS;
    |
21  + use kitchensink_runtime::constants::currency::DOLLARS;
    |

warning: unexpected `cfg` condition value: `staking-playground`
   --> substrate/bin/node/cli/src/chain_spec.rs:355:32
    |
355 |     let validator_count = if cfg!(feature = "staking-playground") {
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `clap`, `clap_complete`, `cli`, `default`, `node-inspect`, `polkadot-sdk`, `runtime-benchmarks`, and `try-runtime`
    = help: consider adding `staking-playground` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
    = note: requested on the command line with `-W unexpected-cfgs`

warning: unexpected `cfg` condition value: `staking-playground`
   --> substrate/bin/node/cli/src/chain_spec.rs:364:11
    |
364 |         if cfg!(feature = "staking-playground") { 10 } else { initial_authorities.len() as u32 };
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `clap`, `clap_complete`, `cli`, `default`, `node-inspect`, `polkadot-sdk`, `runtime-benchmarks`, and `try-runtime`
    = help: consider adding `staking-playground` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

error[E0425]: cannot find function `development_config_genesis_json` in this scope
   --> substrate/bin/node/cli/src/chain_spec.rs:458:30
    |
458 |         .with_genesis_config_patch(development_config_genesis_json())
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

Some errors have detailed explanations: E0412, E0422, E0425, E0432.
For more information about an error, try `rustc --explain E0412`.
warning: `staging-node-cli` (lib) generated 2 warnings
error: could not compile `staging-node-cli` (lib) due to 8 previous errors; 2 warnings emitted

@athei
Copy link
Copy Markdown
Member Author

athei commented Apr 1, 2025

I'll try to track down which backport was supposed to touch this file. But it looks like multiple things even.

@athei
Copy link
Copy Markdown
Member Author

athei commented Apr 2, 2025

The offending backport is just too big. Best course of action is to re-cut from master.

@athei athei closed this Apr 2, 2025
@athei athei deleted the at/backport branch October 3, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A3-backport Pull request is already reviewed well in another branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants