#36193 guix: introduce a minimal `linux-base-gcc` variant

ReviewabilityReviewsAgreementSize
#36193 fanquake guix: introduce a minimal `linux-base-gcc` variantReady0Positive22 + 13 tests
  • Reduce static non-GUI Linux release binary sizes by stripping unused standard library components
  • Saves roughly half a megabyte across binaries like bitcoind and bitcoin-cli
  • Ready to review
  • Concept approval without stated reasons (hebasto)
  • Open question on whether disabling features on gcc-cross-sans-libc is needed (hebasto)
  • Suggested keeping internal toolchain symbols unexported and checking Boost macro side effects (hebasto)
  • Verified matching Guix build outputs (willcl-ark, rustaceanrob)
  • 22 lines added or modified outside tests
  • 13 lines added or modified in tests
  • 2 lines removed in total
  • 4 files, 5 commits
Build and CI#38 of 56
P3 · cleanup
  • P3 because reducing release binary sizes by roughly half a megabyte is a deferrable optimization
  • The benefit is modest and does not affect runtime performance or functionality
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

Introduces a minimal `linux-base-gcc` toolchain variant in Guix for non-GUI static Linux builds, disabling unused `libstdc++` features (`--disable-wchar_t`, `--enable-clocale=generic`, and `--with-libstdcxx-zoneinfo=no`). It also disables the experimental `libstdc++fs` library across Linux GCC builds and adds a patch in `depends` so Boost Test compiles without `std::wcrtomb`.

Problem: Guix non-GUI Linux release binaries link unused `libstdc++` components such as wide-character handling, timezone info, and the experimental filesystem TS library, unnecessarily inflating binary sizes.

Evidence of importance:

  • Author measurements demonstrate ~0.48 MB size reductions across non-GUI binaries (bitcoind drops from 17.75 MB to 17.27 MB, bitcoin-cli from 8.20 MB to 7.72 MB).

Risk of a mistake: medium (build). Altering GCC libstdc++ compilation flags affects release binaries and could cause runtime breakages if non-GUI code relies on disabled standard library features.

Changed since the previous assessment: Dropped commits associated with PR #36531 (including changes to Guix module loading via `--load-path`), removing the dependency on that PR.

Reviewability

Ready

Nothing known that would invalidate a review now.

Waiting on (from the thread read):

  • author: response to hebasto's review comments and question 2026-10-31

Agreement

Positive

support without stated reasons, no open objection (hebasto)

Thread notes: Added hebasto's review comments suggesting not exporting internal Guix toolchain definitions and questioning the need to disable libstdc++ features on gcc-cross-sans-libc.

Objections, suggestions, and questions:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
hebasto (member)question, interfacewhether --disable-wchar_t is a libstdc++ configure option rather than a GCC oneanswered · fanquake explained it is passed through GCC and clarified the commit messageansweredyes2026-09-08: 'Isn't `--disable-wchar_t` a `libstdc++` configure option rather than a GCC one?'
Status from: 2026-09-09: fanquake: 'Yes, and we are passing that option through GCC. I will make the commit message clearer.'
hebasto (member)suggestion, safetycheck for potential side effects of Boost wchar macros on Boost.MultiIndexopenansweredno2026-09-16: 'It might be worth checking for potential side effects of those macros on Boost.MultiIndex.'
hebasto (member)suggestion, interfacedo not export linux-base-gcc and linux-base-gcc-minimal as they are only used in toolchains.scmopenansweredno2026-10-31: '`linux-base-gcc` seems to be used only in `toolchains.scm`. So there is no need to export it'
hebasto (member)question, approachwhether disabling libstdc++ features on gcc-cross-sans-libc-... is intentional given it is already configured with --disable-libstdc++-v3openansweredno2026-10-31: 'Is adding this line intentional? Disabling libstdc++ features doesn’t seem to affect the `gcc-cross-sans-libc-...` package, as Guix configures it with `--disable-libstdc++-v3`.'

Support:

  • hebasto (member) (Concept ACK, 2026-09-16): Concept ACK [not substantive]

Participants:

  • hebasto (member, support, 8 statements 2026-09-08 to 2026-10-31): Concept ACK, verified Guix build, asked about configure options and gcc-cross-sans-libc, and suggested not exporting unneeded symbols
  • willcl-ark (member, neutral, 3 statements 2026-09-09 to 2026-10-22): reported Guix build hashes
  • rustaceanrob (member, neutral, 1 statements 2026-09-10 to 2026-09-10): reported Guix build hashes

Files

15 lines under test/bench/ci.

  • depends/patches/boost/drop_wcrtomb_wchar_t.patch +17/-0
  • contrib/guix/toolchains.scm +10/-1
  • depends/packages/boost.mk +5/-0
  • contrib/guix/linux_static.scm +3/-1

Card

The short text the ranking pass compares across PRs.

Introduces a minimal linux-base-gcc toolchain variant for non-GUI Linux static Guix builds, disabling unused libstdc++ features including wide-character support, zoneinfo, and the filesystem TS library. It also patches Boost Test in depends to invoke wcrtomb without std namespace qualification to maintain compatibility without wchar_t support. This reduces release binary sizes for tools like bitcoind and bitcoin-cli by roughly 0.5 MB.

Data

dossier JSON · extract JSON · model ledger, generated 2026-11-01T01:16, confidence high, input hash 28103dde2c0c3450
thread read through 2026-10-31 (18 statements), head 0f07034e6c
labels: Build system

Categories

Build and CI

P3 · cleanup

Reduces static non-GUI Linux binary sizes by ~0.48 MB by stripping unused `libstdc++` components in a minimal GCC toolchain variant. The PR description provides measurements demonstrating reductions across binaries (e.g. `bitcoind` from 17.75 MB to 17.27 MB, `bitcoin-cli` from 8.20 MB to 7.72 MB); while beneficial, binary size pruning is a deferrable optimization.

Membership: Matches the 'Build system' label and directly edits Guix build configurations (`contrib/guix/`) and depends packages (`depends/packages/boost.mk`).

Factors: security/stability 0, bug 0, performance 1, user value 1, leverage 0