Skip to content

feat: mcpp self init + ensure_base_init_ok + bootstrap residue cleanup#72

Merged
Sunrisepeak merged 1 commit into
mainfrom
feat/self-init
May 22, 2026
Merged

feat: mcpp self init + ensure_base_init_ok + bootstrap residue cleanup#72
Sunrisepeak merged 1 commit into
mainfrom
feat/self-init

Conversation

@Sunrisepeak
Copy link
Copy Markdown
Member

Summary

  • mcpp self init — repair mode: re-runs bootstrap to fix incomplete state
  • mcpp self init --force — deletes registry + caches, re-bootstraps from scratch (preserves bin/mcpp, config.toml, log/)
  • ensure_base_init_ok() at end of load_or_init() — 4 stat() checks, hints mcpp self init --force on failure
  • Bootstrap residue cleanup — detects half-extracted xpkg dirs from Ctrl+C interrupts

Test plan

  • mcpp self init — outputs "Ready sandbox initialized"
  • mcpp self init --force — resets registry, re-bootstraps patchelf/ninja
  • mcpp toolchain install + build + run works after force reset
  • Bootstrap residue cleanup in ensure_patchelf/ninja
  • CI: Linux, macOS, Windows all pass

1. `mcpp self init` — repair mode: re-runs bootstrap, fixes incomplete state
2. `mcpp self init --force` — reset registry + caches, re-bootstrap from scratch
   (preserves bin/mcpp, config.toml, log/)

3. ensure_base_init_ok() at end of load_or_init():
   - Verifies xlings binary, sandbox marker, patchelf, ninja all present
   - 4 stat() calls, <0.1ms overhead
   - On failure: clear error + hint to run `mcpp self init --force`

4. Bootstrap residue cleanup in ensure_patchelf/ensure_ninja:
   - Detects half-extracted xpkg dirs (exist but binary missing)
   - Removes residue before re-installing (fixes Ctrl+C interrupt issue)
@Sunrisepeak Sunrisepeak merged commit dcbb06a into main May 22, 2026
3 checks passed
@Sunrisepeak Sunrisepeak deleted the feat/self-init branch May 22, 2026 16:30
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.

1 participant