Skip to content

feat: apple is a rootstock plugin, orchd-rootstock-apple - #78

Merged
adiled merged 1 commit into
mainfrom
rootstock-apple
Nov 9, 2026
Merged

adiled merged 1 commit into
mainfrom
rootstock-apple

Conversation

@adiled

@adiled adiled commented Nov 9, 2026

Copy link
Copy Markdown
Owner

orchd's core no longer has built-in rootstocks. bare, apple and applz are all contract-1 plugins beside orchd.

orchd-rootstock-apple (was orchd-apple)

  • Contract verbs: contract, check, prepare, exec-set. ORCHD_APPLE_MODE picks the mode:
    • xpc (default): the binary drives Apple's container daemon over XPC with its own run, wait, stop and delete.
    • cli: container command lines.
    • osx: points at applz.
  • A host service runs as it would bare.
  • The cli exec set and the mode logic moved here from orchd's core, along with their tests.
  • zig-clap is gone, so orchd has no third-party dependencies left.

orchd

  • rootstock.zig is just the contract-1 plugin, found beside orchd or on PATH. The apple union and the apple code are gone.
  • just, release.sh, the hook and the docs follow the rename. ORCHARD.md now says every rootstock is a plugin.

Live against Apple's container 1.1.0 on this Mac
orchd grow --rootstock apple on orchdi, with an alpine service whose command is sh -c "echo hello from $GREETING; sleep 600". Getting xpc mode to run took four fixes, all bugs older than this PR that the exec-set tests never exercised:

  1. zig-clap rejected --spec, so no xpc run ever started. Fixed by parsing argv plainly.
  2. alpine:3.20 wasn't matched to the daemon's docker.io/library/alpine:3.20. References are normalized now.
  3. The init image was pinned to vminit:0.31.0, which this daemon doesn't hold, so create hung. It now uses the newest vminit the daemon has, falling back to the pin.
  4. Since daemon 1.0, stop wants its signal as a string. Before this fix, fell waited 30 s for the keeper to kill the tree. It now sends "SIGTERM" and retries with 15 for older daemons.

cmd was also split on spaces, which broke the quoted sh -c command. It now splits like a shell.

Result:

  • xpc: the container runs as ap-hello, its log reads hello from apple, the keeper shows it running, and fell removes it in 6 s.
  • cli: same.

Tests: orchd 58, apple 17, applz 6, bare 3.

orchd-apple becomes orchd-rootstock-apple and speaks contract 1, carrying
both of its modes: xpc drives Apple's container daemon through its own run,
wait, stop and delete; cli writes container command lines. orchd's core has
no built-in rootstocks left.

Running it live against container 1.1.0 found four things the old exec-set
tests never ran: zig-clap refused --spec, so xpc runs never started (clap is
gone, argv is plain); image references were matched unnormalized; the init
image was pinned to a vminit the daemon no longer ships (the newest it holds
is used); and stop's signal is a string since daemon 1.0 (the number is kept
for older daemons). cmd now splits into words like a shell.
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