Skip to content

mcpp's xlings invocations do not inherit XLINGS_ACTIVE_SUBOS (2026.9.14.3) - #638

Merged
Sunrisepeak merged 1 commit into
mainfrom
fix/xlings-active-subos-not-inherited
Sep 14, 2026
Merged

mcpp's xlings invocations do not inherit XLINGS_ACTIVE_SUBOS (2026.9.14.3)#638
Sunrisepeak merged 1 commit into
mainfrom
fix/xlings-active-subos-not-inherited

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

mcpp's xlings invocations no longer inherit XLINGS_ACTIVE_SUBOS. Found by the sandbox verification of #634 (item A7), after 2026.9.14.2 was released.

The defect

A shell that ran xlings subos use <name> (with or without --sandbox) exports XLINGS_ACTIVE_SUBOS=<name>, and xlings ranks that variable above a home's own activeSubos (xlings src/core/config.cppm, resolve_subos_scope_). The variable names a SubOS of the shell's xlings home. mcpp's registry is a different home, and mcpp derives its tool, sysroot and pkg-config view paths from subos/default. mcpp passed the variable through to its own xlings, so the registry acted on a SubOS of the shell's name.

Measured on the released 2026.9.14.2, fresh MCPP_HOME, mcpp self env:

registry/subos/ bootstrap tools (elfpatch, ninja, patchelf)
XLINGS_ACTIVE_SUBOS=m634leak current default m634leak in subos/m634leak/bin; subos/default/bin holds only xlings
variable unset current default in subos/default/bin

In the #634 sandbox, a project's xim:gtk4 payloads were installed into registry/subos/<name>/, and the view mcpp::pkg_config_libdir() names (subos/default/usr/lib/pkgconfig) did not exist, so pkg-config gtk4 found nothing.

The change

  • invocation_env() decides XLINGS_ACTIVE_SUBOS absent for every invocation, global and project mode. The POSIX prefix renders it as env -u XLINGS_ACTIVE_SUBOS.
  • ScopedInvocationEnv applies every scope variable on Windows (previously only XLINGS_PROJECT_DIR) and restores each after the invocation.
  • docs/91 (and its Chinese mirror) states the rule beside the XLINGS_SUBOS_LIB opt-out, which has the same cause. CHANGELOG; version group 1 moves to 2026.9.14.3.

Tests

  • Unit XlingsInvocationEnv.TheShellsActiveSubosIsNeverInherited: the decision in both modes, the process environment restored on Windows; ThePosixPrefixRendersTheDecision reads the new prefix.
  • e2e 686 (fresh-sandbox): a fresh home's first command with the variable set creates no registry/subos/<name>, and its tools are in subos/default/bin. Local: fails on 2026.9.14.2 (A: the registry acted on the shell's SubOS (bin: elfpatch ninja patchelf)), passes on this branch.

…UBOS (2026.9.14.3)

A shell that ran `xlings subos use <name>` exports XLINGS_ACTIVE_SUBOS, and
xlings ranks it above a home's own `activeSubos`. It names a SubOS of the
shell's xlings home; mcpp's registry is a different home, whose tool and view
paths mcpp derives from `subos/default`. Inherited, the variable made the
registry install mcpp's tools and a project's payloads into a SubOS of the
shell's name: on 2026.9.14.2 a fresh home's ninja and patchelf landed in
registry/subos/<name>/bin, and the pkg-config view mcpp::pkg_config_libdir()
names stayed empty. Found by the sandbox verification of #634 (A7).

invocation_env() now decides the variable absent for every invocation; the
POSIX prefix renders `env -u XLINGS_ACTIVE_SUBOS`, and ScopedInvocationEnv
removes it on Windows for the invocation and restores it afterwards (the
guard now saves every scope variable rather than one).

Unit XlingsInvocationEnv.TheShellsActiveSubosIsNeverInherited; e2e 686, which
fails on 2026.9.14.2 and passes here. Version group 1 moves to 2026.9.14.3.
@Sunrisepeak
Sunrisepeak merged commit 9b6a118 into main Sep 14, 2026
40 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