feat: macOS support + rolling 'latest' release workflow - #4
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 rollinglatestrelease 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— acaffeinate(8)subprocess backend. The wake lock is a spawnedcaffeinatechild whose lifetime is the lock; the guard'sDropkills + reaps it (the macOS analog of closing the logind inhibitor FD /PowerClearRequest), preserving the leak-safe RAII invariant. Newmacos-caffeinatefeature (default-on, no crate dep).platform/— renamedlinux.rs→unix.rs; gated the Unix-socket transport +flocksingleton lock oncfg(unix)so macOS reuses it.paths.rs— macOS runtime dir under$TMPDIR/oxiwake(short, per-user, stays under the socket path limit); broadened the0700chmod tounix.daemon.rs— broadened thesetsiddetach tocfg(unix)(macOS libSystem exportssetsid).doctor.rs— macOS platform string +collect_macosprobes (HOME/TMPDIR, caffeinate presence).model.rs/cli.rs—default_macos()request;build_requestselects it on macOS.2. Rolling
latestrelease (.github/workflows/release.yml)push: [main]+workflow_dispatch(not on PRs).latestrelease+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.--prereleaseso it never shadows a real versioned release.concurrencycancels superseded runs; shipsSHA256SUMS.txt.Verification (local)
cargo check --target x86_64-apple-darwin✅ andaarch64-apple-darwin✅ (macOS now compiles)cargo check,cargo clippy --all-targets -D warnings,cargo fmt --checkall clean;daemon_lifecycle4/4 ✅The release workflow itself will be exercised via
workflow_dispatchon this branch to confirm all 5 builds + publish before merge.