feat: make the goofys CLI embeddable and fix macOS builds#3
Merged
Conversation
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
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 does this PR do?
Prepares the fork for being imported into
pwas a multi-call binary (parallelworks/core#2454):main.gointo an exportedcli.Run(args, versionHash) int(git mv, so history follows). The rootmain.gois now a thin wrapper; goofys's own flag parsing and mount(8) daemonization handshake are unchanged.massageArg0keeps an absolute argv[0] unresolved: the go-daemon re-exec runs argv[0], and a multi-call symlink (/usr/bin/goofys→pw) 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.gopsutil(used for available-memory buffer sizing andTgid) from a 2019 snapshot to v4: the old pin doesn't compile on modern macOS at all, and v3 segfaults at startup ingo-m1cpucgo init. With v4 the full tree builds and runs on darwin — required becausepwships on macOS. Go directive bumped to 1.24 accordingly.main.Versionwith the tag;VersionNumberbumped to 0.25.0.Testing
go build ./...on darwin (previously broken), plusCGO_ENABLED=0 GOOS=linuxamd64+arm64 builds.go test ./api/...passes (the SAS config suite from feat: support sas_token in azure config for wasb mounts #1).