You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: make the build.mcpp host helper self-contained on musl AND MinGW (2026.7.28.2)
The compiled build.mcpp helper is exec'd by the host OS, outside anything
mcpp controls — no wrapper, no injected LD_LIBRARY_PATH, no PATH guarantee.
Whether it is actually runnable is a per-platform mechanism, and only two of
the four were closed:
Linux + glibc payload ok — host_base_flags bakes absolute payload paths
into -Wl,-rpath
Linux + musl (#295) bad — rpath cannot reach PT_INTERP, an absolute
/lib/ld-musl-<arch>.so.1 no payload installs
and no glibc distro ships -> execve ENOENT,
surfacing as a bare exit 127
Windows PE (#299) bad — PE has no rpath at all, so the helper resolves
libstdc++-6 / libgcc_s / libwinpthread via the
process PATH -> STATUS_DLL_NOT_FOUND
macOS ok — the system libc++ is always present
Both gaps are the same defect (build_program.cppm re-derives the helper link
policy instead of reusing the main build's, cf. prepare.cppm's musl ->
linkage="static" default), so they get ONE decision point rather than two
parallel predicates: a single staticHostHelper in run_build_program, with the
chosen policy folded into the build-program cache identity so pre-fix helpers
are rebuilt instead of reused. `-static` is appended to the final link argv
only — never to `base`, which also feeds the bundled module's compile and
precompile commands.
Also:
- process.cppm: keep the posix_spawnp error code and message in the captured
output instead of collapsing to an unexplained exit 127 (both capture_exec
and capture_exec_deadline). All three consumers of RunResult::output gate on
exit_code first, so nothing downstream changes.
- host_base_flags: stop emitting -Wl,-rpath on PE, where it is inert.
- tests/e2e/168 (was 167 — taken on main by 167_build_defines_module_scan):
discovers the installed musl-gcc payload instead of hardcoding 15.1.0, so it
runs on the aarch64 host where the regression actually lives; asserts static
+ no PT_INTERP. Verified by negative control: reverting the -static push
reproduces the exact #295 failure.
- tests/e2e/97: hold the build.mcpp helper to the same standalone bar as the
produced exe (import table + run with the toolchain bin off PATH). This runs
under the real MinGW GCC 16.1.0 on Windows CI, which is #299's configuration.
- ci-aarch64-fresh-install: append a PR regression gate that builds this source
and runs e2e 168 against it. The checkout must come AFTER the fresh-install
steps: .xlings.json declares an `mcpp` workspace pin, so a checkout present
in $GITHUB_WORKSPACE makes `xlings install mcpp` workspace-scoped — which
both voids the fresh-install charter (validating the pinned version, not the
published one) and leaves bare `mcpp` unresolvable outside the workspace.
Dropped the duplicated inline assertions, including
`! readelf … | grep -q …`, which bash exempts from errexit and which could
therefore never fail.
Closes#295Closes#299
Supersedes #300
Co-authored-by: Zhe Feng <zhefeng7110@outlook.com>
0 commit comments