From dfb37c0c871657daa20b1e58934a087d5915f4a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 21:05:42 +0000 Subject: [PATCH 1/2] Bump prettyplease from 0.2.37 to 0.3.0 in /tools/runtime-codegen Bumps [prettyplease](https://github.com/dtolnay/prettyplease) from 0.2.37 to 0.3.0. - [Release notes](https://github.com/dtolnay/prettyplease/releases) - [Commits](https://github.com/dtolnay/prettyplease/compare/0.2.37...0.3.0) --- updated-dependencies: - dependency-name: prettyplease dependency-version: 0.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tools/runtime-codegen/Cargo.lock | 14 ++++++++++++-- tools/runtime-codegen/Cargo.toml | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/runtime-codegen/Cargo.lock b/tools/runtime-codegen/Cargo.lock index bcce1e5589..be83ceb09b 100644 --- a/tools/runtime-codegen/Cargo.lock +++ b/tools/runtime-codegen/Cargo.lock @@ -1204,7 +1204,7 @@ dependencies = [ "blake2", "file-guard", "fs-err", - "prettyplease", + "prettyplease 0.2.37", "proc-macro2", "quote", "syn 2.0.118", @@ -2634,6 +2634,16 @@ dependencies = [ "syn 2.0.118", ] +[[package]] +name = "prettyplease" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bfe0f4c752e450fc2faf62654f1c134747922825d5b04ca717b8874f41a40c0" +dependencies = [ + "proc-macro2", + "syn 3.0.1", +] + [[package]] name = "primitive-types" version = "0.13.1" @@ -2879,7 +2889,7 @@ dependencies = [ "color-eyre", "indoc", "parity-scale-codec", - "prettyplease", + "prettyplease 0.3.0", "proc-macro2", "subxt-codegen", "subxt-utils-fetchmetadata", diff --git a/tools/runtime-codegen/Cargo.toml b/tools/runtime-codegen/Cargo.toml index 3ca509a14d..6505ac30fa 100644 --- a/tools/runtime-codegen/Cargo.toml +++ b/tools/runtime-codegen/Cargo.toml @@ -16,7 +16,7 @@ clap = { version = "4.5.3", features = ["derive", "cargo"] } codec = { package = "parity-scale-codec", version = "3.7.4", features = ["derive"] } color-eyre = "0.6.1" indoc = "2.0.5" -prettyplease = "0.2.20" +prettyplease = "0.3.0" proc-macro2 = "1.0.56" subxt-codegen = { version = "0.44.0" } subxt-utils-fetchmetadata = { version = "0.44.0", features = ["url"] } From ce2bdfb6d00520a0181b087672c194a48eb21eef Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 10 Aug 2026 15:17:12 +0200 Subject: [PATCH 2/2] Fix runtime-codegen build against prettyplease 0.3 prettyplease 0.3 moved to syn 3, while subxt-codegen still exposes syn 2 types, so passing its `syn::File` to `prettyplease::unparse` no longer compiles: error[E0308]: mismatched types expected `syn::file::File`, found `subxt_codegen::syn::File` Add a direct syn 3 dependency and parse with it in `print_runtime`; the type substitutes and derives keep using subxt-codegen's syn 2 re-export. Verified with `SKIP_WASM_BUILD=1 cargo check --locked --manifest-path tools/runtime-codegen/Cargo.toml` (the CI job's command). --- tools/runtime-codegen/Cargo.lock | 1 + tools/runtime-codegen/Cargo.toml | 2 ++ tools/runtime-codegen/src/main.rs | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/runtime-codegen/Cargo.lock b/tools/runtime-codegen/Cargo.lock index be83ceb09b..1dddbb4afb 100644 --- a/tools/runtime-codegen/Cargo.lock +++ b/tools/runtime-codegen/Cargo.lock @@ -2893,6 +2893,7 @@ dependencies = [ "proc-macro2", "subxt-codegen", "subxt-utils-fetchmetadata", + "syn 3.0.1", "wasm-loader", "wasm-testbed", ] diff --git a/tools/runtime-codegen/Cargo.toml b/tools/runtime-codegen/Cargo.toml index 6505ac30fa..4a9e4f26c3 100644 --- a/tools/runtime-codegen/Cargo.toml +++ b/tools/runtime-codegen/Cargo.toml @@ -20,5 +20,7 @@ prettyplease = "0.3.0" proc-macro2 = "1.0.56" subxt-codegen = { version = "0.44.0" } subxt-utils-fetchmetadata = { version = "0.44.0", features = ["url"] } +# Must stay on the same major as `prettyplease`'s `syn`, see `print_runtime`. +syn = { version = "3.0.0", features = ["full", "parsing"] } wasm-loader = { git = "https://github.com/chevdor/subwasm", branch = "master" } wasm-testbed = { git = "https://github.com/chevdor/subwasm", branch = "master" } diff --git a/tools/runtime-codegen/src/main.rs b/tools/runtime-codegen/src/main.rs index 9e09e31857..496848f05f 100644 --- a/tools/runtime-codegen/src/main.rs +++ b/tools/runtime-codegen/src/main.rs @@ -78,7 +78,10 @@ impl TypeSubstitute { } fn print_runtime(runtime_api: proc_macro2::TokenStream) { - let syn_tree = syn::parse_file(&runtime_api.to_string()).unwrap(); + // `prettyplease` builds on `syn` 3, while `subxt-codegen` still exposes `syn` 2 types. Both + // versions are in the tree, so parse with our own `syn` (`::syn`, the 3.x one) instead of the + // re-export used everywhere else in this file. + let syn_tree = ::syn::parse_file(&runtime_api.to_string()).unwrap(); let pretty_runtime_api = prettyplease::unparse(&syn_tree); indoc::printdoc!(