Cross-compile into ./bin for the usual platforms
build.sh produced one binary for the machine it ran on. It now builds darwin/arm64, darwin/amd64, linux/amd64 and linux/arm64 into ./bin, all from the single version that run bumped, so the four never disagree about what they are. PLATFORMS="linux/amd64" ./build.sh narrows it. bin/mgsh is a symlink to the host's build, so there is still one stable path to "the binary for this machine". The old ./mgsh in the repo root is no longer written, and the script deletes it once if it finds it -- a stale binary on a path people have in their fingers is worse than a missing one. CGO_ENABLED=0 throughout: the cross builds then need no toolchain per target and the binaries are static. That is only safe because os/user still resolves the current user without cgo, which mgsh needs for the "[user@host]" stamp on every commit -- checked on darwin before relying on it. Windows is left out on purpose: mgsh shells out to stty and /bin/sh, so it would compile there and then not work. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,4 +8,5 @@
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
mgsh
|
||||
bin/
|
||||
.mgshrc
|
||||
|
||||
Reference in New Issue
Block a user