Repository navigation
feat: macOS as a developer platform in preview, Homebrew, arm64 Linux (ADR-0054) - #225
Merged
Merged
Conversation
This was referenced Oct 23, 2026
7schmiede
marked this pull request as ready for review
October 23, 2026 08:47
…a module per OS unix.rs was Linux in practice: it read /proc and cgroups, and on any other Unix its process lists came back empty (ADR-0054 point 6). It is now: - posix.rs: signals, process groups, the shim and its keeper thread, restart cleanup, rlimit, statvfs; the backend that owns process trees on Unix, with the same functions as windows.rs. - linux.rs: /proc (start time, group scan, per-process CPU and RSS), PR_SET_PDEATHSIG, cgroup v2 (a Cgroup type), MemTotal/MemAvailable and /proc/stat. - macos.rs: the same functions, answering "cannot tell" as before; its Cgroup is an uninhabited type (macOS has no cgroups). lib.rs routes through `backend` (windows or posix) and `sys` (windows, linux or macos) instead of cfg(not(any(windows, linux))) fallbacks; the Windows code that lived in lib.rs moved to windows.rs. builds.rs keeps the public types and has one `imp` module per backend. Another OS fails to build (compile_error!). No behaviour changes on Windows or Linux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g system
The desktop integration was spread over ten files in three crates, each with
a Windows branch and a `cfg(not(windows))` branch that meant Linux. It now
lives in `crates/devstack-desktop` (ADR-0054 point 6): `windows.rs`,
`linux.rs` and `macos.rs` implement the same functions, `lib.rs` names them
once, and an operating system without a module fails to build.
What moved:
- the hub at logon and the `devstack://` link (`devstack/integration.rs`)
- the notification sinks (`devstack-hub/notify/{windows,linux}.rs`): the
hub keeps what notifies and when, the desktop only shows (`Note`), and
tells the hub through hooks what failed
- the folder dialog (`devstack-hub/dialog.rs`), the foreground
(`devstack-hub/foreground.rs`), `no_window`
- opening a browser (`devstack/hubcmd.rs`), the dashboard on a click
(`devstack-hub/lib.rs`), the user's programs' finding and starting
(`devstack-hub/open.rs`; the fixed list stays in the hub)
- starting Docker (`devstack-compose/engine.rs`)
- how devstack was installed (`update.rs`, `selfcmd.rs`, `integration.rs`)
and the platform parts of `devstack self uninstall`
Behaviour does not change: `macos.rs` does what the `not(windows)` and
fallback branches did on a Mac until now. It also ends the dead-code errors
the macOS build had in the hub.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macOS got empty process lists from the Linux code: stop never escalated to SIGKILL, the shim did not notice the daemon dying, the restart cleanup found nothing and every usage was zero (ADR-0054 point 2). macos.rs now implements the OS functions the POSIX backend uses: - process groups through libproc: proc_listpids(PROC_PGRP_ONLY) with proc_pidinfo(PROC_PIDTBSDINFO) to drop zombies and processes that left; - start times from proc_pid_rusage (ri_proc_start_abstime): Mach absolute time since boot, which like Linux's ticks since boot only grows within a boot and restarts at a reboot, so the cleanup compares the same way; - CPU time and resident set from PROC_PIDTASKINFO, the times scaled from Mach units with mach_timebase_info; - the shim's parent death: a thread polls getppid() every 500 ms and raises the same SIGUSR2 that PR_SET_PDEATHSIG delivers on Linux; - hw.memsize, host_statistics64(HOST_VM_INFO64) (total less app, wired and compressed memory, as Activity Monitor counts it: the closest to MemAvailable) and host_statistics(HOST_CPU_LOAD_INFO). The build job without a cgroup (macOS, and Linux where the daemon's cgroup is not delegated or for `devstack build`) now knows the process group of each build it started, with its leader's start time: usage and pids walk those groups, and dropping the job kills them, so build servers end with the job as they do with a cgroup or a job object. Before, Linux without a cgroup reported nothing and left the servers to their idle timeouts. The process tests get a macOS path (ps for liveness; the build job's servers end with it everywhere), the cleanup unit test runs on every Unix, and macos.rs has unit tests for the metrics, the group listing and the scaling of CPU time. New dependency on macOS: mach2 (MIT/Apache/BSD), for mach_host_self and mach_timebase_info, which libc deprecates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`macos.rs` replaces what the Linux branches did on a Mac: - the hub at logon: a LaunchAgent of devstack's own (`~/Library/LaunchAgents/it.nuetzliche.devstack.hub.plist`, `hub start` once at load like the Windows and Linux entries, `AbandonProcessGroup`, the installing shell's PATH plus Homebrew's), loaded with `launchctl bootstrap gui/<uid>` and removed with `launchctl bootout` - the folder dialog: `osascript` `choose folder`; cancel is cancel - the dashboard and browsers: `open`, `open -a "Google Chrome"` and the other known names - the user's programs (ADR-0046): Finder, Terminal, editors and agents by the schemes LaunchServices knows, GitHub Desktop, Orca - Docker: `open -g -a Docker`, or OrbStack without Docker Desktop - notifications and the `devstack://` link say "not on macOS yet"; the hub's session tells the dashboard, which offers `devstack hub start` instead of its "Start hub" link while the hub is down A copy Homebrew installed (macOS, and Linux) is updated by `brew upgrade nuetzliches/tap/devstack` (a pinned `--version` is refused), uninstalled by `brew uninstall`, and started again (LaunchAgent, autostart, the hub after an update, the hub's own `up`/`update`) by `<prefix>/bin/devstack`, never by the versioned path under `Cellar/`. `devstack doctor` names the LaunchAgent and what the macOS preview leaves out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R-0054) - release.yml: aarch64/x86_64-apple-darwin (macos-14, deployment target 11.0) and aarch64-unknown-linux-musl (ubuntu-24.04-arm); artifacts named bin-<target>. Job `homebrew` installs and tests the formula from the archives just built (local tap, file:// URLs) on macOS and Linux x86_64 and arm64; on a tag, `homebrew-tap` pushes it to nuetzliches/homebrew-tap (secret HOMEBREW_TAP_TOKEN, a dry run without). - packaging/homebrew: the formula (no `service` block) and render.sh. - ci.yml: macos-14 in check and integration (no Docker there). - install.sh: macOS (Rosetta takes the native build) and arm64 Linux, shasum fallback, a version compare without `sort -V`, refuses to overwrite a Homebrew copy. - update.rs: the release archive per target triple. - watch.rs: FSEvents' real paths are taken back under the repository. - port_in_use: on macOS a listener on *:port is found by a connect. - README, landing page, AGENTS.md, CHANGELOG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/private/var); docs/macos.md, the tester checklist; CI runs every test binary Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…report is dropped (FSEvents) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ough Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 23, 2026
Closed
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.
Implements ADR-0054 (accepted 2026-10-23, #224). Refs #66.
Commits, in order:
refactor(proc):devstack-procsplit intoposix.rs,linux.rs,macos.rs(stub),windows.rs; any other OS is acompile_error!. No behaviour change.refactor(desktop): new cratedevstack-desktop, one module per OS: autostart, link, notification sinks, folder picker, browsers, ADR-0046 programs, Docker start, install channel, self-uninstall bits. No behaviour change (fixes the hub's dead-code errors on macOS).feat(proc): macOS backend with libproc process groups,proc_pid_rusagestart time, task info CPU/RSS,getppidpolling in the shim,hw.memsize/host_statistics64/HOST_CPU_LOAD_INFO, and build-job usage without cgroups. Linux too: a build job without a cgroup now tracks its process groups (usage, and its servers end with the job), like Windows and the cgroup case.feat(desktop): macOS LaunchAgent,osascriptfolder picker,open/open -a, Docker/OrbStack start,brew upgradehand-over, stable<prefix>/bin/devstackfor a Homebrew copy, doctor's "macOS preview" section. Notifications anddevstack://are off with "not on macOS yet".feat: release builds foraarch64/x86_64-apple-darwinandaarch64-unknown-linux-musl, a Homebrew formula and render script, jobshomebrew(install + test from a local tap on macOS, Linux x86_64 and arm64) andhomebrew-tap(on a tag, push tonuetzliches/homebrew-tapwithHOMEBREW_TAP_TOKEN),macos-14in CI check and integration,install.shfor macOS and arm64 Linux, FSEvents real paths in the watcher, a connect probe for*:portlisteners on macOS, and README, landing page, AGENTS.md and CHANGELOG.fix(cli): a worktree is found under its real path too. macOS keeps temporary directories under/var, which links to/private/var, and the lane was not recognised.docs/macos.mdholds the tester checklist (linked from README), and CI runs every test binary (--no-fail-fast).ci: Spotlight is turned off on the macOS runners. Its indexing took most of the three cores, so a node test found no free CPU to offer (measured withtop; devstack's own CPU reading matched it).CI on this branch: all green on Windows, Linux and macOS,
integration (macos-14)included. Release dry run: all five builds and the Homebrew install and test on macOS, Linux x86_64 and Linux arm64 are green.The release workflow's dry run on these changes was green (run 39853182468): all five builds, plus
brew style/install/teston macOS, Linux x86_64 and Linux arm64.Needs from the owner before the first release with it: the repository
nuetzliches/homebrew-tapand the secretHOMEBREW_TAP_TOKEN.🤖 Generated with Claude Code