Skip to content

feat: macOS support + rolling 'latest' release workflow - #4

Merged
hmziqagent merged 2 commits into
mainfrom
ci/rolling-latest-release
Jul 29, 2026
Merged

feat: macOS support + rolling 'latest' release workflow#4
hmziqagent merged 2 commits into
mainfrom
ci/rolling-latest-release

Conversation

@hmziqagent

Copy link
Copy Markdown
Collaborator

What

Two related pieces, per request: (1) make macOS a first-class build target, and (2) a GitHub Action that, on every push to main, builds release binaries for 5 targets and publishes them to a rolling latest release that overwrites the previous one.

1. macOS support

macOS previously did not compile (no backend, no IPC transport, no state paths). Added:

  • backend/macos.rs — a caffeinate(8) subprocess backend. The wake lock is a spawned caffeinate child whose lifetime is the lock; the guard's Drop kills + reaps it (the macOS analog of closing the logind inhibitor FD / PowerClearRequest), preserving the leak-safe RAII invariant. New macos-caffeinate feature (default-on, no crate dep).
  • platform/ — renamed linux.rsunix.rs; gated the Unix-socket transport + flock singleton lock on cfg(unix) so macOS reuses it.
  • paths.rs — macOS runtime dir under $TMPDIR/oxiwake (short, per-user, stays under the socket path limit); broadened the 0700 chmod to unix.
  • daemon.rs — broadened the setsid detach to cfg(unix) (macOS libSystem exports setsid).
  • doctor.rs — macOS platform string + collect_macos probes (HOME/TMPDIR, caffeinate presence).
  • model.rs / cli.rsdefault_macos() request; build_request selects it on macOS.

2. Rolling latest release (.github/workflows/release.yml)

  • Triggers on push: [main] + workflow_dispatch (not on PRs).
  • Matrix: Linux x86_64 + aarch64, Windows x86_64 + aarch64 (MSVC), universal macOS.
  • Publish job deletes the previous latest release+tag (gh release delete latest --cleanup-tag) then creates a fresh one at the current commit. Delete-first is the key trick — GitHub's API will not move an existing tag, so a plain create/append would not override.
  • Marked --prerelease so it never shadows a real versioned release.
  • concurrency cancels superseded runs; ships SHA256SUMS.txt.

Note: the repo's default branch is main (no master); the workflow targets main.

Verification (local)

  • cargo check --target x86_64-apple-darwin ✅ and aarch64-apple-darwin ✅ (macOS now compiles)
  • Linux: cargo check, cargo clippy --all-targets -D warnings, cargo fmt --check all clean; daemon_lifecycle 4/4 ✅
  • Release workflow: YAML validated; built from verified (researched + adversarially checked) 2026 setups for the Windows-ARM64 and macOS-universal cases.

The release workflow itself will be exercised via workflow_dispatch on this branch to confirm all 5 builds + publish before merge.

macOS did not compile at all (no backend, no IPC transport, no state
paths). Add first-class macOS support:

- backend/macos.rs: a `caffeinate(8)` subprocess backend. The wake lock is
  a spawned caffeinate child whose lifetime IS the lock; the guard's Drop
  kills + reaps it — the macOS analog of closing the logind inhibitor FD /
  PowerClearRequest, preserving the leak-safe RAII invariant. New
  `macos-caffeinate` feature (default-on, no crate dep).
- platform: rename linux.rs -> unix.rs and gate the Unix-domain-socket
  transport + flock singleton lock on cfg(unix) so macOS reuses it.
- paths: macOS runtime dir under $TMPDIR/oxiwake (short, per-user, stays
  under the ~104-byte socket path limit); broaden the 0700 chmod to unix.
- daemon: broaden the setsid detach to cfg(unix) (macOS libSystem exports
  setsid).
- doctor: macOS platform string + collect_macos probes (HOME/TMPDIR,
  caffeinate presence); env_kv now compiled on macOS too.
- model/cli: default_macos() request; build_request selects it on macOS.

Verified locally: cargo check green for x86_64-apple-darwin and
aarch64-apple-darwin; Linux still builds, clippy --all-targets clean,
fmt clean, daemon_lifecycle 4/4.
On every push to main (and via workflow_dispatch), build release binaries
for Linux x86_64 + aarch64, Windows x86_64 + aarch64 (MSVC), and a
universal macOS binary, then publish them to a GitHub Release tagged
`latest` that fully replaces the previous one each run.

- gh release delete latest --cleanup-tag, then gh release create at the
  current commit. Delete-first is required: GitHub's API will not move an
  already-existing tag, so a plain create/append would not override.
- Marked --prerelease so it never shadows a real versioned release.
- concurrency cancels superseded in-flight runs (one `latest` tag).
- SHA256SUMS.txt generated from the archives.

aarch64-linux cross-compiles with gcc-aarch64-linux-gnu (zbus is pure
Rust — no sysroot). windows aarch64-MSVC is a zero-config cross-compile on
windows-latest. macOS universal via lipo on an Apple-Silicon runner.
@hmziqagent
hmziqagent merged commit 94dfaab into main Jul 29, 2026
4 checks passed
@hmziqagent
hmziqagent deleted the ci/rolling-latest-release branch July 29, 2026 18:31
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