Skip to content

2026.10.23.1: the target base and the execution host; trimmed release paths (#833, #832) - #834

Open
Sunrisepeak wants to merge 14 commits into
mainfrom
release/2026.10.23.1
Open

Sunrisepeak wants to merge 14 commits into
mainfrom
release/2026.10.23.1

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Summary

Closes #833. Fixes the mcpp half of #832 (the index half is openxlings/xim-pkgindex#1032).

The target base. A sysroot is the prebuilt supplier of a target's lower layers, not a layer. [target.<triple>].sysroot takes a package, a locator (glibc@system, musl@system, macosx|iphoneos|iphonesimulator@system|<version>, msvc@…), { path = "<dir>", provides = [...] } or "", from four tiers (--sysroot / MCPP_TARGET_<TRIPLE>_SYSROOT / MCPP_SYSROOT → the project → config.toml → the target row). It is resolved once into tc.base (mcpp.toolchain.base::Resolution) — the five groups of base fields Toolchain carried move there — and every reader uses it.

  • Measured, not guessed: the driver says where the C runtime is, the preprocessor which C library and version. Debian multiarch is supplied only to a gcc that needs it (glibc@system builds with gcc and clang). A base older than the compiler's runtime requires is refused before compiling, naming both versions.
  • The artifact binds its base: PT_INTERP and RUNPATH name the base's loader and C library; rule B checks against it; the base's identity enters the fingerprint; mcpp pack states the glibc floor in HOST-REQUIREMENTS.
  • Fixed: a stated base hands ld --sysroot (gcc's clean link specs drop the driver's); no artifact loads the host's loader over a sysroot's libc; mcpp no longer writes into a vendor's sysroot; a toolchain phase's spec + path-only keys is refused, spec + sysroot is the program's statement of the base.
  • Apple and MSVC: SDKROOT names an SDK on every host; an SDK without the row's slice is refused naming it; x86_64-ios-sim is verified (built on Apple silicon, run on a macos-15-intel simulator by the new ios-intel-run job). The clang *-windows-msvc row takes { path } for a VS tree or a /winsysroot layout.
  • Reports: Using sysroot glibc 2.31 ← … [custom · mcpp.toml:12], mcpp why sysroot, base / execution in resolution.json, refusal code target-base, --managed-only.

The execution host. [target.<triple>].run_under (also in config.toml, overridden by MCPP_TARGET_<TRIPLE>_RUN_UNDER) composes <run_under…> <runner…> <artifact> <args>. Runners receive MCPP_RUN_TRIPLE/KIND/MODE/ID/CLOSURE and MCPP_SYSROOT; the exit status is the program's. An Apple artifact on a non-macOS host without run_under is refused before anything is spawned.

#832, mcpp side. release and dist define NDEBUG and trim the paths an artifact carries (trim_paths: each package to <name>@<version>/…, store/home/build/toolchain/sysroot to /mcpp/…; source-map.gdbinit/.lldbinit for a debugger); both are profile keys and say so once after the upgrade. A pasted command quotes its path. The release workflow checks mcpp's own binary for the build machine's paths (check_release_paths.sh).

Specs: SPEC-006 v0.10 (§3.9–§3.11, appendix A), SPEC-002 v1.2 (§6), SPEC-004 v1.17. Docs 04, 09, 10, 20, 22, 25, 50 (en + zh). Design: .agents/docs/2026-10-23-target-base-and-execution-host-design.md (rev 5 records where the implementation departs from it, and why).

Compatibility

The ecosystem's default build is unchanged (same fingerprint and build.ninja measured on Linux). release/dist rebuild once for ndebug/trim_paths; dev does not. Every existing sysroot spelling keeps its meaning.

Test plan

  • Unit: 151 passed locally (new test_target_base: grammar, rows, measurement tables, identity, Apple locator via SDKROOT, link-model rendering)
  • e2e (local, Linux): 925 stated sysroot (S1–S4, S6, S7), 926 glibc@system gcc+llvm, 927 runner contract, 928 Apple SDK on Linux, 929 trim_paths/ndebug, 930 toolchain phase base; regression set over sysroot/runner/pack/profile tests
  • CI: Linux, macOS (incl. ios-intel-run), Windows; 931/932 need a fresh sandbox (932 after xim-pkgindex#1032 is published)

This branch has not been deployed

No deployments
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.

A stated sysroot with its own glibc: link fails, the artifact loads the host's loader, rule B compares the wrong glibc

1 participant