Skip to content

The build program's host toolchain under a cross target carries the host's C library (#622, 2026.9.12.4) - #627

Merged
Sunrisepeak merged 3 commits into
mainfrom
fix/622-host-c-library-under-a-row-pin
Sep 12, 2026
Merged

The build program's host toolchain under a cross target carries the host's C library (#622, 2026.9.12.4)#627
Sunrisepeak merged 3 commits into
mainfrom
fix/622-host-c-library-under-a-row-pin

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Found by the sandbox verification of 2026.9.12.3 (section J, a Web project whose build program is a plugin member): under --target wasm32-emscripten in a fresh home, the build program's host toolchain resolved to gcc and then its mcpp module failed at features.h. Two defects in host_tc_for_build_program's cross branch, both fixed:

  • when the row's pin replaced nothing (a fresh home whose first invocation names a target), the host spec fell through to the row's own pin (em++); it now resolves the platform's native default through the same function the first-run installer uses;
  • the cross branch called detect(frontend) without the runtime payload and binding the native call passes, so the toolchain carried no C library and the module compile ran with the payload's bare search path; it now receives the host's runtime payload and binding, and the compile line carries the glibc and linux-headers include directories.

The development machine masked the second defect: a subos sysroot leaked into the shared-store gcc's search path. Reproduced in a real xlings subos sandbox with the released binary and green with this branch. tests/e2e/657 gains a fresh-home phase and a native build in the same home afterwards; MCPP_VERBOSE=1 now prints the module compile command. Unit 113 passed; e2e 657, 630, 651, 652b, 656, 622 pass. Version 2026.9.12.4.

… paths (#622)

host_tc_for_build_program's cross branch called detect(frontend) with only
the compiler path, unlike the native call site's three-argument form. detect()
uses the second/third arguments (the host's runtime-binding identity) to probe
which glibc/linux-headers xpkg payloads belong to this exact toolchain
(Toolchain::payloadPaths); without them the field stays unset, so neither the
explicit -isystem/-idirafter <glibc>/include rows nor the sysroot-completion
symlinking that depends on it ever run.

Measured in the xlings sandbox (fresh registry, real gcc@16.1.0 payload) with
the released 2026.9.12.3: "Resolved host toolchain for build.mcpp: gcc 16.1.0"
(the row-pin fix already gets the right compiler), then "mcpp module compile
failed": features.h: No such file or directory. Fixed by passing the same
runtimePayload/runtimeBindingSnapshot the native path already trusts -- the
value is the host's, so it does not vary with --target. Not reliably
reproducible outside a real sandbox (this dev machine's own bundled sandbox
layout init fills in a usable sysroot through an unrelated path).

Also adds a small observability hook (mcpp.build.hostprogram): the mcpp
module's compile argv is now logged under MCPP_VERBOSE=1, which is the only
way to see it on a run that succeeds.
@Sunrisepeak
Sunrisepeak merged commit 13f5a8a into main Sep 12, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants