#36709 guix: compute --build triplet when lowering, not at load time

ReviewabilityReviewsAgreementSize
#36709 jespada guix: compute --build triplet when lowering, not at load timeReady0Positive0 + 4 tests
  • Fix Guix build failures when building under foreign architecture emulation using the system flag
  • Prevent cross toolchains from configuring with mismatched build triplets captured from the host
  • Ready for review now
  • Early positive reception with no open objections
  • Concept approval without stated reasons (hebasto)
  • Clarified question about the reproduction setup and motivation (sedited)
  • 0 lines added or modified outside tests
  • 4 lines added or modified in tests
  • 4 lines removed in total
  • 1 files, 1 commits
Build and CI#36 of 56
P3 · platform fix
  • P3 because it resolves toolchain build failures when running Guix under foreign architecture emulation
  • Benefits developers testing cross-architecture builds without changing native Guix release outputs
  • Ranking pass: Moved up from 43: fixes an actual Guix build failure under foreign-architecture emulation
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

Converts `building-on` in `contrib/guix/toolchains.scm` from an eagerly evaluated variable into a procedure evaluated when lowering derivations. This ensures cross-toolchain packages use the target system passed via Guix's `--system` flag rather than the host system running `guix shell`.

Problem: When running Guix with `--system` under emulation on a host of a different architecture (for example, `--system=aarch64-linux` on an x86_64 host), `guix shell` loads manifests before applying `--system`. As a result, `building-on` captures the host's `%current-system`, causing cross toolchains like `gcc-cross-sans-libc` to configure with mismatched `--build` triplets and fail to build.

Evidence of importance:

  • PR description demonstrates build failure: 'checking for CET support... configure: error: compiler and assembler with CET support are required for --enable-cet' when building under `--system=aarch64-linux` on x86_64
  • PR description confirms native builds produce identical toolchain derivations to master on both `linux_static.scm` and `manifest_gui.scm`

Risk of a mistake: medium (build). A mistake in Guix toolchain definitions could alter compiler build flags or break reproducible release builds across supported architectures.

Changed since the previous assessment: No functional changes; the previous description was generated before the patch was available.

Reviewability

Ready

Nothing known that would invalidate a review now.

Waiting on (from the thread read):

  • reviewer: further review after author answered sedited's question 2026-10-30
  • reviewer: code review following author reply and Concept ACK 2026-10-30

Agreement

Positive

support without stated reasons, no open objection (hebasto)

Thread notes: Initial record. hebasto offered a Concept ACK, and sedited asked about the author's motivation and setup, which jespada answered. / Initial record. sedited asked why the author ran into this, which was answered; hebasto left a Concept ACK.

Objections, suggestions, and questions:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
sedited (member)question, usefulnessHow and why did the author run into this issue?answered · author explained they encountered it while testing build reproducibility across architectures under QEMU emulationansweredyes2026-10-30: 'How and why did you run into this?'
Status from: 2026-10-30: jespada: 'I hit it while trying to build https://github.com/bitcoin/bitcoin/pull/36708 with an aarch64 build machine'

Support:

  • hebasto (member) (Concept ACK, 2026-10-30): Concept ACK. [not substantive]

Participants:

  • hebasto (member, support, 1 statements 2026-10-30 to 2026-10-30): Concept ACK
  • sedited (member, question, 1 statements 2026-10-30 to 2026-10-30): asked how and why the author ran into the issue

Files

8 lines under test/bench/ci.

  • contrib/guix/toolchains.scm +4/-4

Card

The short text the ranking pass compares across PRs.

Converts the `building-on` triplet resolution in `contrib/guix/toolchains.scm` from an eagerly evaluated variable into a procedure evaluated when lowering derivations. When running Guix with `--system` on a foreign host via emulation (such as building for aarch64 on x86_64), manifests previously evaluated `%current-system` at module load time, generating an incorrect `--build` triplet that broke cross-toolchain configuration for `gcc-cross-sans-libc`. The change fixes emulated cross-system Guix builds without modifying the derivations produced for native release builds.

Data

dossier JSON · extract JSON · model ledger, generated 2026-11-01T01:16, confidence high, input hash 4eaf4498b4b31f5f
thread read through 2026-10-30 (3 statements), head 1ea9ffd556
labels: Build system

Categories

Build and CI

P3 · platform fix (ranking pass: Moved up from 43: fixes an actual Guix build failure under foreign-architecture emulation)

Fixes a Guix build failure when running under foreign architecture emulation with `--system`. Guix shell currently captures the host `%current-system` at load time before applying `--system`, causing cross toolchains like `gcc-cross-sans-libc` to fail configuration due to mismatched triplets.

Membership: Matches 'Build system' label and edits 'contrib/guix/toolchains.scm', which configures Guix cross-toolchain packages.

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