Skip to content

[v0.2] Support macOS on Intel and Apple Silicon - #34

Merged
Lingbou merged 1 commit into
mainfrom
feat/macos-support
Sep 30, 2026
Merged

Lingbou merged 1 commit into
mainfrom
feat/macos-support

Conversation

@Lingbou

@Lingbou Lingbou commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Parent: #1

Closes #29

What changed

  • The platform seam now expresses the shared POSIX behavior as trait defaults, so each platform states only what differs. Linux and macOS differ in exactly one place today: discovering a running child's descendants (/proc/<pid>/task/<pid>/children vs libc::proc_listchildpids). The child-tree kill itself is shared, leaves-first, unchanged.
  • src/platform.rs gains MacPlatform; current() selects it by target_os. Everything else — config root ($HOME/.line), ssh/ssh-keygen discovery, /etc/ssh/ssh_config policy, null device, file modes, child signal reset, and the interrupt guard — is the same implementation the Linux path already used, now shared rather than duplicated.
  • The compile gate allows Linux and macOS; anything else still fails loudly.
  • CI gets a macos matrix over macos-15 (arm64) and macos-15-intel (x86_64) running fmt, clippy, tests, and a release build.
  • The release pipeline gains a macOS leg: builds both Apple targets on an arm64 runner, merges them with lipo, asserts both slices are present, smoke-tests --version/--help, and publishes line-v<version>-universal2-apple-darwin.tar.gz through the same packaging/make-tarball.sh the Linux tarballs use.
  • ADR-0001 records the macOS decisions: system OpenSSH, one universal2 artifact, and Homebrew as a follow-up with the same entry criteria as the AUR. Both READMEs document the tarball install path.

Why Homebrew is not in this PR

A formula needs a tap repository that a maintainer owns, and the AUR decision in ADR-0001 set the precedent: a package-manager channel lands when it can be smoke-tested automatically rather than hand-maintained. The tarball is the v0.2 macOS path, and the ADR says so explicitly instead of implying Homebrew support.

Verification

  • Both Apple targets type-check and lint locally before CI: cargo check --target aarch64-apple-darwin --all-targets --locked and the same for x86_64-apple-darwin, plus cargo clippy --target aarch64-apple-darwin --all-targets --all-features -- -D warnings.
  • Linux side unchanged: cargo test --all-targets --locked (including the seven containerized ProxyJump scenarios), cargo clippy --all-targets --all-features --locked -- -D warnings, cargo fmt --check.
  • The new macOS CI legs are the real runtime evidence and run on this PR.

The platform seam keeps its shared POSIX behavior as trait defaults and
gains a macOS implementation that differs only in how a child's
descendants are discovered (libproc instead of /proc). CI runs the test
suite on both Apple runners, and the release pipeline merges both slices
into one universal2 tarball.

Refs #29

Signed-off-by: Xingqiu Xu <hilbertanjou83@gmail.com>
@Lingbou
Lingbou merged commit 6c60bde into main Sep 30, 2026
13 checks passed
@Lingbou
Lingbou deleted the feat/macos-support branch September 30, 2026 15:29
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.

[v0.2] Support macOS on Intel and Apple Silicon

1 participant