mcpjungle/MCPJungle

Explicitly disable CGO for all binaries

Aperta

#67 aperta il 20 ago 2025

 (0 commenti) (0 reazioni) (0 assegnatari)Go (146 fork)auto 404
good first issue

Metriche repository

Star
 (1162 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Currently, all binaries for mcpjungle are built on my personal laptop (MacOS + apple silicon). So by default, all binaries for windows & linux have CGO_ENABLED=0 and mac binaries have CGO_ENABLED=1 because I have the C toolchain installed on my Mac.

But this won't always be the case. Maybe at some point we'll run all builds on a remote linux server for consistency.

We should explicitly set CGO_ENABLED=0 for all binaries, ie, even for mac binaries as well.

So we should simply remove the override for macos in the .goreleaser.yaml and ensure that CGO_ENABLED=0 is set explicitly for all builds.

This needs to be tested well so that we don't break binaries or any specific functionality in the mac bins. Also check what other popular go projects are doing (eg- github CLI seems to disable cgo for linux explicitly, but what about others?)

Go doc on CGO default behaviour: https://pkg.go.dev/cmd/cgo#hdr-Using_cgo_with_the_go_command

Guida contributor