Skip to content

feat(shipyard): configure through shipyard-cmake; add the canonical msc.sh - #33

Open
schmonz wants to merge 1 commit into
mainfrom
shipyard-cmake-flagday
Open

schmonz wants to merge 1 commit into
mainfrom
shipyard-cmake-flagday

Conversation

@schmonz

@schmonz schmonz commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Do not merge until shipyard has landed bc3082a.

After the cutover the CMake user package registry is neither written nor read; only shipyard-cmake (from the shipyard pkg, at /usr/local/bin/) may configure against shipyard.

What changed

12 cmake/ctest calls in the two workflowsshipyard-cmake / shipyard-ctest. container-tools configures three separate CMake projects — the root (--preset cross, --preset iso), updater/, and menubar/ — each with its own find_package(MavericksShipyard REQUIRED). Those three find_package calls stay; they now resolve from shipyard-cmake's own prefix.

cmake/package_pkg.sh was the repo's only shell-level shipyard locator — $SHIPYARD_SCRIPTS with a --msc-scripts flag and no fallback. It now sources msc.sh, guarded so --msc-scripts still wins and skips the ~2 s probe:

if [ -z "$SHIPYARD" ]; then
  . "$(dirname "$0")/../msc.sh"
fi

msc.sh at the repo root, byte-identical to shipyard's scripts/templates/msc.sh (blob 43c2af0, mode 100644, cmp clean). Root rather than build/: container-tools has no tracked build/, and .gitignore blanket-ignores build*/ (this repo writes build/updater, build/menubar, build-cross, build-iso), so a build/msc.sh would need git add -f and would live inside a directory every build writes into. Check 17 accepts either.

Seven sites no gate reports, converted because they would have shipped wrong:

  • three printed (cmake --build <dir>) recipes — cmake/demo_osinit_guard.sh, tests/compat_guard_test.sh, tests/sdk_coverage_test.sh (check 18 deliberately treats a bare ( as not command position)
  • four comments handing a reader a plain cmake recipe — CMakeLists.txt ×2, menubar/CMakeLists.txt, updater/CMakeLists.txt

No workflow step was added: install@v1's default mode already puts shipyard-cmake on PATH.

Four tests that could no longer fail — fixed, not just renamed

The repo asserts its own workflows by grepping them:

grep -q 'cmake --preset iso' "$W"  || { echo "missing configure preset" >&2; exit 1; }

shipyard-cmake --preset iso contains cmake --preset iso, so this change is what would have turned four falsifiable assertions into four that pass either way. Renaming the needle to shipyard-cmake … is better only by degree — a comment mentioning the command satisfies it while the run: line says plain cmake, and an existence check structurally cannot see a plain call added beside the converted one.

All four now anchor the command position, and each workflow gains a negative assertion that no line runs a plain cmake/ctest/cpack:

grep -qE '^[[:space:]]*shipyard-cmake --preset iso[[:space:]]*$' "$W" || { echo "missing configure preset" >&2; exit 1; }
…
if grep -qE '^[[:space:]]*(cmake|ctest|cpack)([[:space:]]|$)' "$W"; then
  echo "boot2docker.yml runs a plain cmake/ctest/cpack (only shipyard-cmake configures against shipyard)" >&2
  exit 1
fi

Mutation-checked — six mutants, every one caught by its own message rather than the catch-all. Baseline: both suites exit 0.

# mutant test exit message restored
1 boot2docker.yml:34cmake --preset iso boot2docker_ci_test.sh 1 missing configure preset 0
2 boot2docker.yml:35cmake --build --preset iso boot2docker_ci_test.sh 1 missing build preset 0
3 boot2docker.yml:36ctest --preset iso … boot2docker_ci_test.sh 1 missing test preset 0
4 release.yml:158cmake -S menubar … docker_menubar_test.sh 1 release.yml must build the menubar app with shipyard-cmake 0
5 plain cmake --preset iso added beside the converted lines boot2docker_ci_test.sh 1 boot2docker.yml runs a plain cmake/ctest/cpack … 0
6 plain cmake -S menubar … added beside the converted line docker_menubar_test.sh 1 release.yml configures menubar with a plain cmake … 0

Mutants 5 and 6 exist because 1–4 alone would leave the new negative assertions themselves untested. All six fail on exit status, not merely on printed output, and the tree was byte-identical to HEAD after each restore.

Verification

check-family-conventions.sh (from shipyard-cmake-collapsed): 12 failures → ok, exit 0. check-shell-portability.sh ok; check-comments.sh exit 0; sh -n on every tracked *.sh and on msc.sh (plus bash -n on the two edited tests); all four workflows parse as YAML. All 16 runnable tests in tests/ exit 0.

Whole-tree sweeps (git ls-files -z | xargs -0 command grep, since .gitignore hides build*/ from a bare grep): no cmake/ctest/cpack left at command position, no .cmake/packages or .local/share/cmake read anywhere, and the one remaining bare-paren hit is (ctest code 77) — prose about an exit code.

msc.sh proven on four paths, sourced from the same if-body shape package_pkg.sh uses: $SHIPYARD_SCRIPTS set → straight through; no shipyard at all → exits 1 with msc.sh's message under both /bin/sh and bash 3.2 (the set -e propagation through a sourced return 1 holds); --msc-scripts given → no probe; and against a stub shipyard-cmake that answers the probe → the helper resolves, which is the tier that replaces the registry.

CI on this PR will fail until shipyard lands bc3082a — shipyard-cmake exists on no runner yet. Expected, not a defect in this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GTxFde2TJMmp5p64DhvDSK

…sc.sh

The shipyard pkg's postinstall no longer writes the CMake user package registry, and
MavericksShipyardConfig.cmake refuses any cmake but shipyard-cmake. Two consequences here.

Every cmake/ctest at command position becomes shipyard-cmake/shipyard-ctest: all three
separately-configured projects (the root preset builds, updater/, menubar/) plus the iso
preset build in both workflows. The three find_package(MavericksShipyard REQUIRED) calls
stay -- they now resolve from shipyard-cmake's own prefix.

cmake/package_pkg.sh had the repo's only shell-level shipyard locator: $SHIPYARD_SCRIPTS
with a --msc-scripts flag and no fallback, so off CI it had nothing to fall back to once
the registry went away. It now sources the canonical msc.sh, which asks shipyard-cmake
where find_package lands. --msc-scripts still wins when given, and skips the probe.

msc.sh goes at the repo root, not build/: container-tools has no tracked build/ and
.gitignore blanket-ignores build*/ (the repo writes build/updater, build/menubar,
build-cross and build-iso). A root copy tracks without git add -f. Check 17 accepts both.

Eleven more sites the conventions gate cannot see were converted too: three printed
`(cmake --build <dir>)` recipes, four comments handing a reader a plain cmake recipe, and
four test assertions that grepped for the bare command name.

Those four assertions needed more than a rename. `grep -q 'cmake --preset iso'` is
satisfied by `shipyard-cmake --preset iso` -- the substring -- so this change is what
would have made them unfalsifiable, and `grep -q 'shipyard-cmake --preset iso'` is only
better by degree: a comment mentioning the command satisfies it while the run: line says
plain cmake. All four now anchor the command position with an ERE, and each workflow
additionally asserts that NO line runs a plain cmake/ctest/cpack -- the case an existence
check structurally cannot see, where a plain call is ADDED beside the converted one.

Mutation-checked, six mutants, every one caught by its own message, not the catch-all:
reverting each of the four lines to plain cmake/ctest fails its own assertion (exit 1),
and adding a plain call beside each converted one fails the negative (exit 1). All six
pass again on restore.

BREAKING CHANGE: requires the shipyard pkg (it provides shipyard-cmake) on PATH.
Do not merge until shipyard has landed bc3082a.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTxFde2TJMmp5p64DhvDSK
@schmonz
schmonz force-pushed the shipyard-cmake-flagday branch from 0b7cdc1 to 1572c98 Compare September 14, 2026 02:13
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