Skip to content

refactor(pack): two-axis mode model, clearer names, system mode; 0.0.56#134

Merged
Sunrisepeak merged 1 commit into
mainfrom
refactor/pack-mode-redesign
Jun 18, 2026
Merged

refactor(pack): two-axis mode model, clearer names, system mode; 0.0.56#134
Sunrisepeak merged 1 commit into
mainfrom
refactor/pack-mode-redesign

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Carries the 0.0.56 version bump. Stacks logically after #133 (independent files; either merge order works). The 0.0.56 release includes both this and #133.

Why

mcpp pack's modes mixed two orthogonal axes into one flat set:

  • libc / static is really a build-target property (--target …-gnu vs …-musl).
  • bundling depth (nothing / third-party / everything) is the pack property.

Static named the libc axis while BundleProject/BundleAll named the depth axis — you couldn't tell from the names that static also bundles everything. And there was no mode that depends on the OS for every .so (third-party included), which .deb/.rpm packaging and same-distro deployment need.

What

  • Rename --mode values to idiomatic, self-documenting names, with the old names kept as permanent aliases:
    new old (alias)
    vendored (default) bundle-project
    self-contained bundle-all
    static
  • New system mode (Mode::None): bundles nothing, repoints PT_INTERP to the LSB loader. For distro packages / same-distro fleets.
  • Wire-format safety: split mode_name() into mode_cli_name() (display) and mode_tarball_suffix() (frozen), so the rename can't change release tarball names. install.sh and download URLs are unaffected (30_pack_modes.sh asserts the exact tarball strings).
  • Two-axis model documented in docs/02-pack-and-release.md: libc via --target, depth via --mode.

Version

Bumps to 0.0.56 (mcpp.toml + MCPP_VERSION in fingerprint.cppm) + CHANGELOG.

Tests

  • tests/unit/test_pack_modes.cpp — canonical names + old-name aliases + system.
  • tests/e2e/30_pack_modes.shsystem mode (empty lib/, LSB interp, runs) + alias parse.
  • Verified: build green, --version → 0.0.56, unit 19/19, e2e 30 PASS.

Design: .agents/docs/2026-06-19-pack-mode-redesign.md.

Pack distribution has two orthogonal axes: libc/static (a build-target
property via --target gnu/musl) and bundling depth (the --mode axis). The
old modes mixed those frames (Static named libc; Bundle* named depth) and
had no 'depend on OS for everything' mode.

- Rename --mode values to idiomatic, self-documenting names; keep old names
  as PERMANENT aliases: bundle-project=vendored (default),
  bundle-all=self-contained. static unchanged.
- Add 'system' mode (Mode::None): bundle nothing, repoint PT_INTERP to the
  LSB loader — for .deb/.rpm packaging and same-distro fleet deploy.
- Split mode_name() into mode_cli_name() (display) and mode_tarball_suffix()
  (FROZEN wire format) so renaming cannot change release artifact names
  (guarded by 30_pack_modes.sh tarball-name asserts).
- Bump version to 0.0.56 (mcpp.toml + MCPP_VERSION) + CHANGELOG. This release
  also carries the run/test/build loader-env launch fix (#133).

tests/unit/test_pack_modes.cpp + 30_pack_modes.sh system-mode coverage.
@Sunrisepeak Sunrisepeak merged commit 6a5e2f3 into main Jun 18, 2026
3 checks passed
@Sunrisepeak Sunrisepeak deleted the refactor/pack-mode-redesign branch June 18, 2026 20:33
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