Skip to content

feat: make the goofys CLI embeddable and fix macOS builds#3

Merged
giraffesyo merged 1 commit into
masterfrom
feat/embeddable-cli
Jul 13, 2026
Merged

feat: make the goofys CLI embeddable and fix macOS builds#3
giraffesyo merged 1 commit into
masterfrom
feat/embeddable-cli

Conversation

@giraffesyo

@giraffesyo giraffesyo commented Jul 12, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Prepares the fork for being imported into pw as a multi-call binary (parallelworks/core#2454):

  • Moves the entire command line from main.go into an exported cli.Run(args, versionHash) int (git mv, so history follows). The root main.go is now a thin wrapper; goofys's own flag parsing and mount(8) daemonization handshake are unchanged.
  • massageArg0 keeps an absolute argv[0] unresolved: the go-daemon re-exec runs argv[0], and a multi-call symlink (/usr/bin/goofyspw) must survive into the child so it dispatches back to goofys. fstab always invokes with an absolute path; relative invocations still resolve via osext as before.
  • Bumps gopsutil (used for available-memory buffer sizing and Tgid) from a 2019 snapshot to v4: the old pin doesn't compile on modern macOS at all, and v3 segfaults at startup in go-m1cpu cgo init. With v4 the full tree builds and runs on darwin — required because pw ships on macOS. Go directive bumped to 1.24 accordingly.
  • Release builds now stamp main.Version with the tag; VersionNumber bumped to 0.25.0.

Testing

Move the command line entrypoint into an exported cli.Run so multi-call
binaries can embed goofys and dispatch to it. Keep an absolute argv[0]
unresolved across the daemon re-exec so a multi-call symlink like
/usr/bin/goofys dispatches the same way in the re-executed child. Bump
gopsutil to v4: the pinned 2019 snapshot did not compile on modern
macOS and v3 crashed at startup in go-m1cpu cgo initialization. Stamp
main.Version in release builds.

Claude-Session: https://claude.ai/code/session_0191kNQ9ZxzwEng9QfcfBKe6
@giraffesyo giraffesyo changed the title Make the goofys CLI embeddable and fix macOS builds feat: make the goofys CLI embeddable and fix macOS builds Jul 13, 2026
@giraffesyo
giraffesyo merged commit f93d5db into master Jul 13, 2026
1 check passed
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