mcpjungle/MCPJungle

Explicitly disable CGO for all binaries

Open

#67 opened on Aug 20, 2025

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Go (146 forks)auto 404
good first issue

Repository metrics

Stars
 (1,162 stars)
PR merge metrics
 (PR metrics pending)

Description

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

Contributor guide