Skip to content

Commit 50e527e

Browse files
authored
Fix build-release-binaries workflow by switching from musl to glibc target (#128)
Fixes the broken `build-release-binaries.yaml` workflow that was failing due to C++ standard library conflicts when building for `x86_64-unknown-linux-musl`. ## Changes - Switched Linux target from `x86_64-unknown-linux-musl` to `x86_64-unknown-linux-gnu` - Removed `.cargo/config.toml` (no longer needed without musl) - Simplified Linux build dependencies (removed musl-specific packages) - Added Multi-Block Migration (MBM) documentation to source code to satisfy `doc` job in CI (left broken in #127) - Updated README with MBM notes and fixed broken links (also because of `doc` CI job) ## Why? The musl build was failing because RocksDB (a C++ dependency) couldn't link correctly with both libstdc++ and libc++ simultaneously. The glibc target builds cleanly and produces binaries compatible with all major Linux distributions. ## Trade-offs - **Lost**: Static linking (musl benefit) - **Gained**: Working builds, compatibility with 99% of Linux users
1 parent 0df25a9 commit 50e527e

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.github/workflows/build-release-binaries.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
platform:
19-
- { os: ubuntu-22.04, target: x86_64-unknown-linux-musl }
19+
- { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu }
2020
- { os: macos-latest, target: aarch64-apple-darwin }
2121

2222
runs-on: ${{ matrix.platform.os }}
@@ -42,16 +42,11 @@ jobs:
4242
if: matrix.platform.os == 'macos-latest'
4343
run: rustup target add aarch64-apple-darwin
4444

45-
- name: Add musl target
46-
if: matrix.platform.os == 'ubuntu-22.04'
47-
run: rustup target add x86_64-unknown-linux-musl
48-
49-
- name: Install deps for musl build
45+
- name: Install deps for Linux build
5046
if: matrix.platform.os == 'ubuntu-22.04'
5147
run: |
5248
sudo apt-get update
53-
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
54-
sudo ln -s /usr/bin/g++ /usr/bin/musl-g++
49+
sudo apt-get install -y build-essential libclang-dev
5550
5651
- name: Install deps for macOS build
5752
if: matrix.platform.os == 'macos-latest'

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ after the migration. [`OnRuntimeUpgrade::pre_upgrade`] returns a [`Vec<u8>`] tha
135135
arbitrary encoded data (usually some pre-upgrade state) which will be passed to
136136
[`OnRuntimeUpgrade::pre_upgrade`] after upgrading and used for post checking.
137137

138-
**Note on Multi-Block Migrations (MBM):** If the runtime uses MBMs, the standard
139-
`pre_upgrade` and `post_upgrade` checks might be skipped by the executive. To
138+
**Note on Multi-Block Migrations (MBM):** If the runtime uses MBMs, the standard
139+
`pre_upgrade` and `post_upgrade` checks might be skipped by the executive. To
140140
force these hooks to run synchronously for testing, use the `--disable-mbm-checks` flag.
141141

142142
### [`VersionedMigration`]
@@ -285,7 +285,7 @@ try-runtime \
285285
[`Action::OffchainWorker`]: try_runtime_core::commands::Action::OffchainWorker
286286
[`Action::CreateSnapshot`]: try_runtime_core::commands::Action::CreateSnapshot
287287
[`Action::FastForward`]: try_runtime_core::commands::Action::FastForward
288-
[`SharedParams`]: try_runtime_core::shared_parameters::SharedParams
288+
[`SharedParams`]: try_runtime_core::common::shared_parameters::SharedParams
289289
[`SharedParams::runtime`]: try_runtime_core::common::shared_parameters::SharedParams::runtime
290290
[`SharedParams::overwrite_state_version`]: try_runtime_core::common::shared_parameters::SharedParams::overwrite_state_version
291291

cli/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@
151151
//! arbitrary encoded data (usually some pre-upgrade state) which will be passed to
152152
//! [`OnRuntimeUpgrade::pre_upgrade`] after upgrading and used for post checking.
153153
//!
154+
//! **Note on Multi-Block Migrations (MBM):** If the runtime uses MBMs, the standard
155+
//! `pre_upgrade` and `post_upgrade` checks might be skipped by the executive. To
156+
//! force these hooks to run synchronously for testing, use the `--disable-mbm-checks` flag.
157+
//!
154158
//! ### [`VersionedMigration`]
155159
//!
156160
//! It is strongly suggested to use [`VersionedMigration`] when writing custom migrations for
@@ -198,6 +202,8 @@
198202
//! try-runtime \
199203
//! --runtime /path-to-substrate/target/release/wbuild/my-runtime.wasm \
200204
//! on-runtime-upgrade \
205+
//! # Passing this flag will skip multi-block-migration checks and only run pre_upgrade/post_upgrade checks.
206+
//! --disable-mbm-checks \
201207
//! live --uri ws://localhost:9999
202208
//! ```
203209
//!

0 commit comments

Comments
 (0)