Skip to content

fix(subos, luban): part 3 follow-ups -- the domain check asks inside the domain (J51) and says why for every refusal; an image boots on the monitor its home installs (J52) - #702

Merged
Sunrisepeak merged 3 commits into
mainfrom
fix/domain-check-reason
Oct 23, 2026

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #701 (part 3, J47). Two findings after 2026.10.23.2:

1. Main's asan shard 1/4 failed on b69aee2.

test_domain_producer.cpp:654: Expected: refused.transcript().find("cannot build the domain at /xlings") != npos
[error] .../bin/xlings: selected dispatcher is not a marked xlings build

subos __domain-check printed a domain_producer::prepare refusal bare. An unmarked build, as in the asan lane, is one such refusal. Now every refusal for a private domain is this host cannot build the domain at <home> in a private namespace (<why>). That is the line luban shows when it keeps a system in place.

2. J51, found in the real verification of 23.2.

The host: its own /usr/bin/bwrap fails, and the home uses its own xim:bwrap. On it, luban upgrade vcore worked (core 2026.10.20.1 → 2026.10.23.1, 0 notes), but it did not avoid the move:

✓ .../state/luban/relayout/vcore.luban (45286 entries)
✓ removing vcore
✓ making vcore (luban:core@2026.10.20.1)
  vcore stays in this home's prefix: this host cannot build it its own (xlings self doctor --isolation)
  • The check only ran self init in the namespace, and that worked.
  • subos new --rootfs inside the domain saw only the host's broken bwrap; the domain does not carry the home's xim:bwrap. It stopped at the AppArmor setup question (exit 2) and fell back to the prefix, after the export.

The fix:

  • After self init, the check asks the domain, through the interface: __domain-check /xlings in the domain's own home.
  • For a home's own prefix, __domain-check answers whether a root made here can be entered. That is sandbox::root_host_ready: the step making a root starts with (xim:bwrap installed first where there is none, shared with prepare_root_host), never asked.
  • The same home now answers:
[error] this host cannot build the domain at /xlings in a private namespace (bwrap cannot create a sandbox here: /usr/bin/bwrap: ...)

3. J52, found by luban-os-ci's daily L6-02 on 23.2.

In a new home, luban enter <iso> stopped at:

✗ booting an image needs a virtual machine monitor here
    xlings install qemu-system

A machine's start installs xim:qemu-system itself. Both now take the same step (install_monitor_), and the hint appears only when the install fails.

  • New test AnImageBootsOnTheMonitorItsHomeInstallsTheFirstTime (requirement LUBAN-IMAGE-VMM) uses a fixture monitor. It fails without the fix and passes with it.
  • docs/luban/05-images.md (en, zh) updated.
  • Part 3 design §4 lists J51–J53. J53 is luban-os-ci's own fix: it now installs luban-os through xlings.

Tests

  • ADomainCheckTriesTheNamespaceAsMakingASystemThereStarts asserts the whole sentence on every host.
  • It also asserts the own-prefix answer.
  • test_domain_producer and all of test_luban (32) pass locally.
  • DOM-CHECK-TRIED text updated.
  • Part 3 design §3.4 and the task row J51 updated.

No version bump: it ships with the next release. Released 23.2 still moves such systems correctly, only at the cost of the archive. Labelled ci:asan so the lane that failed runs here.

Co-authored-by: speak-agent 248744407+speak-agent@users.noreply.github.com

…annot hand off included

`subos __domain-check` printed what `domain_producer::prepare` refused bare,
without "this host cannot build the domain at <home> ... (why)". luban shows
that line when it keeps a system in place (J47). An unmarked build (main's
asan lane) is such a refusal; the test now asserts the whole sentence on
every host.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
@Sunrisepeak Sunrisepeak added the ci:asan Run the ASan/UBSan unit suite on this PR (xlings-ci-linux unit-asan) label Oct 23, 2026
…ere can be entered (J51)

Verifying 2026.10.23.2 on a host whose own bwrap fails: `luban upgrade` asked
`subos __domain-check /xlings`, which only ran `self init` in the namespace.
It said yes; `subos new --rootfs` in the domain then saw only the host's
broken bwrap (the domain does not carry the home's xim:bwrap), fell back to
the prefix, and the move had already exported, removed and remade the system.

The check now runs `__domain-check /xlings` inside the domain too, through
the interface. For a home's own prefix that answers whether a root made here
can be entered (`sandbox::root_host_ready`: the step making a root starts
with, bwrap installed first where there is none, never asked). The domain's
reason comes back in the one error.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
@Sunrisepeak Sunrisepeak changed the title fix(subos): the domain check says why for every refusal, a build it cannot hand off included fix(subos): the domain check asks inside the domain whether a root there can be entered (J51), and says why for every refusal Oct 23, 2026
… time, as a machine's start does (J52)

luban-os-ci L6-02: in a new home `luban enter <iso>` stopped at "booting an
image needs a virtual machine monitor here -- xlings install qemu-system",
while a machine's start installs xim:qemu-system itself. Both now take the
same step (install_monitor_); the hint is said only when the install fails.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
@Sunrisepeak Sunrisepeak changed the title fix(subos): the domain check asks inside the domain whether a root there can be entered (J51), and says why for every refusal fix(subos, luban): part 3 follow-ups -- the domain check asks inside the domain (J51) and says why for every refusal; an image boots on the monitor its home installs (J52) Oct 23, 2026
@speak-agent

Copy link
Copy Markdown
Collaborator

Self-review (correctness, compatibility, UX, cross-platform):

  • J51, the inner check. The domain's entry is refreshed from the owner's binary before every domain run (domain_producer::run → refresh_entry). So the inner __domain-check is always the same version as the outer one; there is no mixed-version answer. The inner check is asked through interface subos_command, so its reason comes back as an event and doesn't leak onto the caller's stderr.
  • J51, cost. In the domain, root_host_ready can install xim:bwrap where the domain has no bwrap at all. Making a root there would do the same next, so the check doesn't add a step that wouldn't happen anyway. It never asks; the AppArmor setup stays with prepare_root_host and self doctor --isolation --fix.
  • J51, compatibility. __domain-check on a home's own prefix used to return 0 unconditionally; now it answers whether a root can be entered there. luban only asks for /xlings, the domain_check feature and protocol 1.18 are unchanged, and an older luban reads the same exit codes.
  • J52. The image boot and the machine start share install_monitor_, with the same install_packages call (yes: true) and the same phases. The hint is kept for a failed install. macOS and Windows take the path a machine's start already takes.
  • Tests. Both changes were checked against the failure they fix: the asan lane passes here, and the image test fails on the old host.cpp. Requirements and the en/zh docs are updated.
  • Release. No version bump. Released 2026.10.23.2 behaves correctly, just less economically: the archive cost on such hosts (J51), and a hint instead of an install (J52, marked known in luban-os-ci L6-02 until the next release).

@Sunrisepeak
Sunrisepeak merged commit 8526694 into main Oct 23, 2026
37 checks passed
Sunrisepeak added a commit that referenced this pull request Oct 23, 2026
…); an image boots on the monitor its home installs (J52) (#704)

Version bump to 2026.10.24.1: #702 (J51, J52, the domain check's one sentence for every refusal) and #703 (a test's /proc read race) on top of 2026.10.23.2.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:asan Run the ASan/UBSan unit suite on this PR (xlings-ci-linux unit-asan)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants