From 0a19e7f35867837cd0e43aa56fae1b0a90083b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Fri, 16 Jan 2026 13:11:02 +0000 Subject: [PATCH 1/8] Create `.cargo/config.toml` with `musl`-specific build config --- .cargo/config.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000000..932451d1e30 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,15 @@ +[target.x86_64-unknown-linux-musl] +linker = "clang" +rustflags = [ + "-C", "link-arg=-fuse-ld=lld", + "-C", "link-arg=-static-libstdc++", + "-C", "target-feature=+crt-static", + "-L", "/usr/lib/x86_64-linux-musl", +] + +[env] +CC_x86_64-unknown-linux-musl = "clang" +CXX_x86_64-unknown-linux-musl = "clang++" +AR_x86_64-unknown-linux-musl = "ar" +CFLAGS_x86_64-unknown-linux-musl = "-fPIC" +CXXFLAGS_x86_64-unknown-linux-musl = "-fPIC -stdlib=libc++" From df8257a5e6ce21ec489b9a20096a31e01a04ad83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Fri, 16 Jan 2026 13:11:33 +0000 Subject: [PATCH 2/8] Update release workflow --- .github/workflows/build-release-binaries.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-release-binaries.yaml b/.github/workflows/build-release-binaries.yaml index be055e08770..308486e88c8 100644 --- a/.github/workflows/build-release-binaries.yaml +++ b/.github/workflows/build-release-binaries.yaml @@ -50,8 +50,7 @@ jobs: if: matrix.platform.os == 'ubuntu-22.04' run: | sudo apt-get update - sudo apt-get install -y musl-tools clang build-essential curl llvm-dev libclang-dev linux-headers-generic libsnappy-dev liblz4-dev libzstd-dev libgflags-dev zlib1g-dev libbz2-dev - sudo ln -s /usr/bin/g++ /usr/bin/musl-g++ + sudo apt-get install -y musl-tools clang lld libc++-dev libc++abi-dev build-essential curl llvm-dev libclang-dev linux-headers-generic libsnappy-dev liblz4-dev libzstd-dev libgflags-dev zlib1g-dev libbz2-dev - name: Install deps for macOS build if: matrix.platform.os == 'macos-latest' From 4ffda9430e1ffb339668b4330ef97a1092c4570a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Fri, 16 Jan 2026 14:48:43 +0000 Subject: [PATCH 3/8] Change linker behavior against `libc++` --- .cargo/config.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 932451d1e30..1c470e063f5 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,7 +2,9 @@ linker = "clang" rustflags = [ "-C", "link-arg=-fuse-ld=lld", - "-C", "link-arg=-static-libstdc++", + "-C", "link-arg=-lc++", + "-C", "link-arg=-lc++abi", + "-C", "link-arg=-static", "-C", "target-feature=+crt-static", "-L", "/usr/lib/x86_64-linux-musl", ] From f2de646cd0fbd0d43bb8b3f40a0b83eb28a75fb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Fri, 16 Jan 2026 15:27:02 +0000 Subject: [PATCH 4/8] Update `.cargo/config.toml` --- .cargo/config.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 1c470e063f5..684bbc92ad9 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,9 +2,9 @@ linker = "clang" rustflags = [ "-C", "link-arg=-fuse-ld=lld", + "-C", "link-arg=--no-as-needed", "-C", "link-arg=-lc++", "-C", "link-arg=-lc++abi", - "-C", "link-arg=-static", "-C", "target-feature=+crt-static", "-L", "/usr/lib/x86_64-linux-musl", ] @@ -15,3 +15,4 @@ CXX_x86_64-unknown-linux-musl = "clang++" AR_x86_64-unknown-linux-musl = "ar" CFLAGS_x86_64-unknown-linux-musl = "-fPIC" CXXFLAGS_x86_64-unknown-linux-musl = "-fPIC -stdlib=libc++" +LDFLAGS_x86_64-unknown-linux-musl = "-stdlib=libc++ -lc++abi" From e397b021844337937154a23db72b43a0a74b041c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Fri, 16 Jan 2026 17:19:09 +0000 Subject: [PATCH 5/8] Remove `--no-as-needed` from linking process --- .cargo/config.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 684bbc92ad9..635374b9c9d 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,7 +2,7 @@ linker = "clang" rustflags = [ "-C", "link-arg=-fuse-ld=lld", - "-C", "link-arg=--no-as-needed", + "-C", "link-arg=-stdlib=libc++", "-C", "link-arg=-lc++", "-C", "link-arg=-lc++abi", "-C", "target-feature=+crt-static", @@ -16,3 +16,4 @@ AR_x86_64-unknown-linux-musl = "ar" CFLAGS_x86_64-unknown-linux-musl = "-fPIC" CXXFLAGS_x86_64-unknown-linux-musl = "-fPIC -stdlib=libc++" LDFLAGS_x86_64-unknown-linux-musl = "-stdlib=libc++ -lc++abi" +ROCKSDB_LIB_DIR = "" From 1bb59a0439014818c1da43137f9db27a83874ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Fri, 16 Jan 2026 17:45:44 +0000 Subject: [PATCH 6/8] Fix empty flag in cargo config --- .cargo/config.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 635374b9c9d..f256563caf5 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -16,4 +16,3 @@ AR_x86_64-unknown-linux-musl = "ar" CFLAGS_x86_64-unknown-linux-musl = "-fPIC" CXXFLAGS_x86_64-unknown-linux-musl = "-fPIC -stdlib=libc++" LDFLAGS_x86_64-unknown-linux-musl = "-stdlib=libc++ -lc++abi" -ROCKSDB_LIB_DIR = "" From 1ccf80ee77f243eea4b45f8065022f780ffc2f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Fri, 16 Jan 2026 23:04:57 +0000 Subject: [PATCH 7/8] Replace `musl` target with `gnu` --- .cargo/config.toml | 18 ------------------ .github/workflows/build-release-binaries.yaml | 10 +++------- 2 files changed, 3 insertions(+), 25 deletions(-) delete mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index f256563caf5..00000000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,18 +0,0 @@ -[target.x86_64-unknown-linux-musl] -linker = "clang" -rustflags = [ - "-C", "link-arg=-fuse-ld=lld", - "-C", "link-arg=-stdlib=libc++", - "-C", "link-arg=-lc++", - "-C", "link-arg=-lc++abi", - "-C", "target-feature=+crt-static", - "-L", "/usr/lib/x86_64-linux-musl", -] - -[env] -CC_x86_64-unknown-linux-musl = "clang" -CXX_x86_64-unknown-linux-musl = "clang++" -AR_x86_64-unknown-linux-musl = "ar" -CFLAGS_x86_64-unknown-linux-musl = "-fPIC" -CXXFLAGS_x86_64-unknown-linux-musl = "-fPIC -stdlib=libc++" -LDFLAGS_x86_64-unknown-linux-musl = "-stdlib=libc++ -lc++abi" diff --git a/.github/workflows/build-release-binaries.yaml b/.github/workflows/build-release-binaries.yaml index 308486e88c8..906e1124d90 100644 --- a/.github/workflows/build-release-binaries.yaml +++ b/.github/workflows/build-release-binaries.yaml @@ -16,7 +16,7 @@ jobs: strategy: matrix: platform: - - { os: ubuntu-22.04, target: x86_64-unknown-linux-musl } + - { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu } - { os: macos-latest, target: aarch64-apple-darwin } runs-on: ${{ matrix.platform.os }} @@ -42,15 +42,11 @@ jobs: if: matrix.platform.os == 'macos-latest' run: rustup target add aarch64-apple-darwin - - name: Add musl target - if: matrix.platform.os == 'ubuntu-22.04' - run: rustup target add x86_64-unknown-linux-musl - - - name: Install deps for musl build + - name: Install deps for Linux build if: matrix.platform.os == 'ubuntu-22.04' run: | sudo apt-get update - sudo apt-get install -y musl-tools clang lld libc++-dev libc++abi-dev build-essential curl llvm-dev libclang-dev linux-headers-generic libsnappy-dev liblz4-dev libzstd-dev libgflags-dev zlib1g-dev libbz2-dev + sudo apt-get install -y build-essential libclang-dev - name: Install deps for macOS build if: matrix.platform.os == 'macos-latest' From dabed1ffb8f60ba6a7af360060dc98a44e67f57d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Sat, 17 Jan 2026 00:27:30 +0000 Subject: [PATCH 8/8] Update docs to reflect autogenerated `README` --- README.md | 6 +++--- cli/main.rs | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 52a6274afa9..4f42a58a6e2 100644 --- a/README.md +++ b/README.md @@ -135,8 +135,8 @@ after the migration. [`OnRuntimeUpgrade::pre_upgrade`] returns a [`Vec`] tha arbitrary encoded data (usually some pre-upgrade state) which will be passed to [`OnRuntimeUpgrade::pre_upgrade`] after upgrading and used for post checking. -**Note on Multi-Block Migrations (MBM):** If the runtime uses MBMs, the standard -`pre_upgrade` and `post_upgrade` checks might be skipped by the executive. To +**Note on Multi-Block Migrations (MBM):** If the runtime uses MBMs, the standard +`pre_upgrade` and `post_upgrade` checks might be skipped by the executive. To force these hooks to run synchronously for testing, use the `--disable-mbm-checks` flag. ### [`VersionedMigration`] @@ -285,7 +285,7 @@ try-runtime \ [`Action::OffchainWorker`]: try_runtime_core::commands::Action::OffchainWorker [`Action::CreateSnapshot`]: try_runtime_core::commands::Action::CreateSnapshot [`Action::FastForward`]: try_runtime_core::commands::Action::FastForward -[`SharedParams`]: try_runtime_core::shared_parameters::SharedParams +[`SharedParams`]: try_runtime_core::common::shared_parameters::SharedParams [`SharedParams::runtime`]: try_runtime_core::common::shared_parameters::SharedParams::runtime [`SharedParams::overwrite_state_version`]: try_runtime_core::common::shared_parameters::SharedParams::overwrite_state_version diff --git a/cli/main.rs b/cli/main.rs index c52faeabf37..f32ae1fed86 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -151,6 +151,10 @@ //! arbitrary encoded data (usually some pre-upgrade state) which will be passed to //! [`OnRuntimeUpgrade::pre_upgrade`] after upgrading and used for post checking. //! +//! **Note on Multi-Block Migrations (MBM):** If the runtime uses MBMs, the standard +//! `pre_upgrade` and `post_upgrade` checks might be skipped by the executive. To +//! force these hooks to run synchronously for testing, use the `--disable-mbm-checks` flag. +//! //! ### [`VersionedMigration`] //! //! It is strongly suggested to use [`VersionedMigration`] when writing custom migrations for @@ -198,6 +202,8 @@ //! try-runtime \ //! --runtime /path-to-substrate/target/release/wbuild/my-runtime.wasm \ //! on-runtime-upgrade \ +//! # Passing this flag will skip multi-block-migration checks and only run pre_upgrade/post_upgrade checks. +//! --disable-mbm-checks \ //! live --uri ws://localhost:9999 //! ``` //!