Skip to content

Commit

Permalink
[ci] Update rust in ci image (1.75 and 2024-01-22) (#3016)
Browse files Browse the repository at this point in the history
cc paritytech/ci_cd#926

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Dónal Murray <donal.murray@parity.io>
Co-authored-by: Vladimir Istyufeev <vladimir@parity.io>
  • Loading branch information
6 people authored Jan 30, 2024
1 parent 5a6f6d3 commit 5b7f24f
Showing 22 changed files with 116 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fmt-check.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ jobs:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
container:
image: paritytech/ci-unified:bullseye-1.74.0-2023-11-01-v20231204
image: docker.io/paritytech/ci-unified:bullseye-1.75.0-2024-01-22-v20240109
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

3 changes: 2 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,8 @@ workflow:
- if: $CI_COMMIT_BRANCH

variables:
CI_IMAGE: !reference [.ci-unified, variables, CI_IMAGE]
# CI_IMAGE: !reference [.ci-unified, variables, CI_IMAGE]
CI_IMAGE: "docker.io/paritytech/ci-unified:bullseye-1.75.0-2024-01-22-v20240109"
# BUILDAH_IMAGE is defined in group variables
BUILDAH_COMMAND: "buildah --storage-driver overlay2"
RELENG_SCRIPTS_BRANCH: "master"
2 changes: 0 additions & 2 deletions bridges/snowbridge/parachain/pallets/system/src/lib.rs
Original file line number Diff line number Diff line change
@@ -79,8 +79,6 @@ use xcm_executor::traits::ConvertLocation;
#[cfg(feature = "runtime-benchmarks")]
use frame_support::traits::OriginTrait;

pub use pallet::*;

pub type BalanceOf<T> =
<<T as pallet::Config>::Token as Inspect<<T as frame_system::Config>::AccountId>>::Balance;
pub type AccountIdOf<T> = <T as frame_system::Config>::AccountId;
4 changes: 2 additions & 2 deletions docs/sdk/src/reference_docs/development_environment_advice.rs
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@
//! // Use nightly formatting.
//! // See the polkadot-sdk CI job that checks formatting for the current version used in
//! // polkadot-sdk.
//! "rust-analyzer.rustfmt.extraArgs": ["+nightly-2023-11-01"],
//! "rust-analyzer.rustfmt.extraArgs": ["+nightly-2024-01-22"],
//! }
//! ```
//!
@@ -79,7 +79,7 @@
//! # Use nightly formatting.
//! # See the polkadot-sdk CI job that checks formatting for the current version used in
//! # polkadot-sdk.
//! extraArgs = { "+nightly-2023-11-01" },
//! extraArgs = { "+nightly-2024-01-22" },
//! },
//! },
//! ```
2 changes: 1 addition & 1 deletion polkadot/node/subsystem-bench/src/availability/mod.rs
Original file line number Diff line number Diff line change
@@ -161,7 +161,7 @@ fn prepare_test_inner(
candidate_hashes
.get(&Hash::repeat_byte(block_num as u8))
.expect("just inserted above")
.get(0)
.first()
.expect("just inserted above")
.clone(),
);
1 change: 0 additions & 1 deletion polkadot/node/subsystem-bench/src/core/keyring.rs
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
use polkadot_primitives::ValidatorId;
use sc_keystore::LocalKeystore;
use sp_application_crypto::AppCrypto;
pub use sp_core::sr25519;
use sp_core::sr25519::Public;
use sp_keystore::Keystore;
use std::sync::Arc;
1 change: 0 additions & 1 deletion polkadot/node/subsystem-bench/src/core/mock/mod.rs
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@ pub mod runtime_api;

pub use av_store::*;
pub use chain_api::*;
pub use network_bridge::*;
pub use runtime_api::*;

pub struct AlwaysSupportsParachains {}
4 changes: 2 additions & 2 deletions substrate/frame/alliance/src/mock.rs
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@
pub use sp_core::H256;
use sp_runtime::traits::Hash;
pub use sp_runtime::{
traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Lazy, Verify},
BuildStorage, MultiSignature,
traits::{BlakeTwo256, IdentifyAccount, Lazy, Verify},
BuildStorage,
};
use sp_std::convert::{TryFrom, TryInto};

8 changes: 4 additions & 4 deletions substrate/frame/contracts/fixtures/build.rs
Original file line number Diff line number Diff line change
@@ -159,15 +159,15 @@ fn invoke_cargo_fmt<'a>(
) -> Result<()> {
// If rustfmt is not installed, skip the check.
if !Command::new("rustup")
.args(["nightly-2023-11-01", "run", "rustfmt", "--version"])
.args(["nightly-2024-01-22", "run", "rustfmt", "--version"])
.output()
.map_or(false, |o| o.status.success())
{
return Ok(())
}

let fmt_res = Command::new("rustup")
.args(["nightly-2023-11-01", "run", "rustfmt", "--check", "--config-path"])
.args(["nightly-2024-01-22", "run", "rustfmt", "--check", "--config-path"])
.arg(config_path)
.args(files)
.output()
@@ -182,7 +182,7 @@ fn invoke_cargo_fmt<'a>(
eprintln!("{}\n{}", stdout, stderr);
eprintln!(
"Fixtures files are not formatted.\n
Please run `rustup nightly-2023-11-01 run rustfmt --config-path {} {}/*.rs`",
Please run `rustup nightly-2024-01-22 run rustfmt --config-path {} {}/*.rs`",
config_path.display(),
contract_dir.display()
);
@@ -309,7 +309,7 @@ fn find_workspace_root(current_dir: &Path) -> Option<PathBuf> {
let cargo_toml_contents =
std::fs::read_to_string(current_dir.join("Cargo.toml")).ok()?;
if cargo_toml_contents.contains("[workspace]") {
return Some(current_dir)
return Some(current_dir);
}
}

3 changes: 3 additions & 0 deletions substrate/frame/support/procedural/src/pallet/expand/call.rs
Original file line number Diff line number Diff line change
@@ -261,6 +261,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream {
});

quote::quote_spanned!(span =>
#[doc(hidden)]
mod warnings {
#(
#call_index_warnings
@@ -270,6 +271,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream {
)*
}

#[allow(unused_imports)]
#[doc(hidden)]
pub mod __substrate_call_check {
#[macro_export]
@@ -455,6 +457,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream {
}

impl<#type_impl_gen> #pallet_ident<#type_use_gen> #where_clause {
#[allow(dead_code)]
#[doc(hidden)]
pub fn call_functions() -> #frame_support::__private::metadata_ir::PalletCallMetadataIR {
#frame_support::__private::scale_info::meta_type::<#call_ident<#type_use_gen>>().into()
Original file line number Diff line number Diff line change
@@ -449,3 +449,69 @@ note: required by a bound in `Result`
| pub enum Result<T, E> {
| ^ required by this bound in `Result`
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::codec::Decode` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | // construct_runtime! {
21 | || pub struct Runtime where
22 | || Block = Block,
23 | || NodeBlock = Block,
... ||
27 | || }
28 | || }
| ||_- in this macro invocation
... |
|
= note: required for `Pallet<Runtime>` to implement `Callable<Runtime>`
note: required because it appears within the type `RuntimeCall`
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | // construct_runtime! {
21 | || pub struct Runtime where
22 | || Block = Block,
23 | || NodeBlock = Block,
... ||
27 | || }
28 | || }
| ||_- in this macro invocation
... |
note: required by a bound in `frame_support::sp_runtime::traits::Dispatchable::Config`
--> $WORKSPACE/substrate/primitives/runtime/src/traits.rs
|
| type Config;
| ^^^^^^^^^^^^ required by this bound in `Dispatchable::Config`
= note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | // construct_runtime! {
21 | || pub struct Runtime where
22 | || Block = Block,
23 | || NodeBlock = Block,
... ||
27 | || }
28 | || }
| ||_- in this macro invocation
... |
|
= note: required for `Pallet<Runtime>` to implement `Callable<Runtime>`
note: required because it appears within the type `RuntimeCall`
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | // construct_runtime! {
21 | || pub struct Runtime where
22 | || Block = Block,
23 | || NodeBlock = Block,
... ||
27 | || }
28 | || }
| ||_- in this macro invocation
... |
note: required by a bound in `frame_support::pallet_prelude::ValidateUnsigned::Call`
--> $WORKSPACE/substrate/primitives/runtime/src/traits.rs
|
| type Call;
| ^^^^^^^^^^ required by this bound in `ValidateUnsigned::Call`
= note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@ error[E0220]: associated type `Block` not found for `Self`
--> tests/pallet_ui/default_config_with_no_default_in_system.rs:25:31
|
25 | type MyGetParam2: Get<Self::Block>;
| ^^^^^ there is a similarly named associated type `Block` in the trait `frame_system::Config`
| ^^^^^ there is an associated type `Block` in the trait `frame_system::Config`
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
// limitations under the License.

#[frame_support::pallet]
#[allow(unused_imports)]
mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
@@ -32,5 +33,4 @@ mod pallet {
#[derive(scale_info::TypeInfo, codec::Encode, codec::Decode)]
enum MyError {}

fn main() {
}
fn main() {}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0277]: the trait bound `MyError: PalletError` is not satisfied
--> tests/pallet_ui/error_does_not_derive_pallet_error.rs:28:15
--> tests/pallet_ui/error_does_not_derive_pallet_error.rs:29:15
|
28 | CustomError(crate::MyError),
29 | CustomError(crate::MyError),
| ^^^^^^^^^^^^^^ the trait `PalletError` is not implemented for `MyError`
|
= help: the following other types implement trait `PalletError`:
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
// limitations under the License.

#[frame_support::pallet]
#[allow(unused_imports)]
mod pallet {
use frame_support::pallet_prelude::{Hooks, IsType};
use frame_system::pallet_prelude::BlockNumberFor;
@@ -41,5 +42,4 @@ mod pallet {
}
}

fn main() {
}
fn main() {}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error[E0277]: the trait bound `<T as pallet::Config>::Bar: Clone` is not satisfied
--> tests/pallet_ui/event_field_not_member.rs:40:7
--> tests/pallet_ui/event_field_not_member.rs:41:7
|
40 | B { b: T::Bar },
41 | B { b: T::Bar },
| ^ the trait `Clone` is not implemented for `<T as pallet::Config>::Bar`

error[E0369]: binary operation `==` cannot be applied to type `&<T as pallet::Config>::Bar`
--> tests/pallet_ui/event_field_not_member.rs:40:7
--> tests/pallet_ui/event_field_not_member.rs:41:7
|
40 | B { b: T::Bar },
41 | B { b: T::Bar },
| ^

error[E0277]: `<T as pallet::Config>::Bar` doesn't implement `std::fmt::Debug`
--> tests/pallet_ui/event_field_not_member.rs:40:7
--> tests/pallet_ui/event_field_not_member.rs:41:7
|
40 | B { b: T::Bar },
41 | B { b: T::Bar },
| ^ `<T as pallet::Config>::Bar` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
= help: the trait `std::fmt::Debug` is not implemented for `<T as pallet::Config>::Bar`
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ use codec::{Decode, Encode};
use frame_support::PalletError;

#[frame_support::pallet]
#[allow(unused_imports)]
mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
@@ -34,25 +35,24 @@ mod pallet {

#[derive(Encode, Decode, PalletError, scale_info::TypeInfo)]
pub enum MyError {
Foo,
Bar,
Baz(NestedError),
Struct(MyStruct),
Wrapper(Wrapper),
Foo,
Bar,
Baz(NestedError),
Struct(MyStruct),
Wrapper(Wrapper),
}

#[derive(Encode, Decode, PalletError, scale_info::TypeInfo)]
pub enum NestedError {
Quux
Quux,
}

#[derive(Encode, Decode, PalletError, scale_info::TypeInfo)]
pub struct MyStruct {
field: u8,
field: u8,
}

#[derive(Encode, Decode, PalletError, scale_info::TypeInfo)]
pub struct Wrapper(bool);

fn main() {
}
fn main() {}
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
// limitations under the License.

#[frame_support::pallet]
#[allow(unused_imports)]
mod pallet {
use frame_support::pallet_prelude::{Hooks, IsType};
use frame_system::pallet_prelude::BlockNumberFor;
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
// limitations under the License.

#[frame_support::pallet]
#[allow(unused_imports)]
mod pallet {
use frame_support::pallet_prelude::*;

@@ -34,5 +35,4 @@ mod pallet {
type Foo<T: Config> = StorageValue<_, u8, ResultQuery<Error::NonExistentValue>>;
}

fn main() {
}
fn main() {}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
error[E0107]: missing generics for enum `pallet::Error`
--> tests/pallet_ui/storage_result_query_missing_generics.rs:34:56
--> tests/pallet_ui/storage_result_query_missing_generics.rs:35:56
|
34 | type Foo<T: Config> = StorageValue<_, u8, ResultQuery<Error::NonExistentValue>>;
35 | type Foo<T: Config> = StorageValue<_, u8, ResultQuery<Error::NonExistentValue>>;
| ^^^^^ expected 1 generic argument
|
note: enum defined here, with 1 generic parameter: `T`
--> tests/pallet_ui/storage_result_query_missing_generics.rs:29:11
--> tests/pallet_ui/storage_result_query_missing_generics.rs:30:11
|
29 | pub enum Error<T> {
30 | pub enum Error<T> {
| ^^^^^ -
help: add missing generic argument
|
34 | type Foo<T: Config> = StorageValue<_, u8, ResultQuery<Error<T>::NonExistentValue>>;
35 | type Foo<T: Config> = StorageValue<_, u8, ResultQuery<Error<T>::NonExistentValue>>;
| +++
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ sp_api::decl_runtime_apis! {
}
}

#[allow(unused_imports)]
mod second {
sp_api::decl_runtime_apis! {
pub trait Api {
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: Two traits with the same name detected! The trait name is used to generate its ID. Please rename one trait at the declaration!
--> tests/ui/impl_two_traits_with_same_name.rs:41:15
--> tests/ui/impl_two_traits_with_same_name.rs:42:15
|
41 | impl second::Api<Block> for Runtime {
42 | impl second::Api<Block> for Runtime {
| ^^^

error: First trait implementation.
--> tests/ui/impl_two_traits_with_same_name.rs:37:13
--> tests/ui/impl_two_traits_with_same_name.rs:38:13
|
37 | impl self::Api<Block> for Runtime {
38 | impl self::Api<Block> for Runtime {
| ^^^

0 comments on commit 5b7f24f

Please sign in to comment.