Skip to content

Set CGO_ENABLED in build#3000

Open
umanwizard wants to merge 1 commit intoparca-dev:mainfrom
umanwizard:force_cgo
Open

Set CGO_ENABLED in build#3000
umanwizard wants to merge 1 commit intoparca-dev:mainfrom
umanwizard:force_cgo

Conversation

@umanwizard
Copy link
Contributor

Without this flag, Go will silently determine whether to enable Cgo or not based on whether a program called "gcc" exists in the PATH. This is a bad default that leads to very difficult-to-understand error messages when it's not available.


build:
go build -o parca-agent -buildvcs=false -ldflags="-extldflags=-static" -tags osusergo,netgo
CGO_ENABLED=1 go build -o parca-agent -buildvcs=false -ldflags="-extldflags=-static" -tags osusergo,netgo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just export CGO_ENABLED = 1 higher up?

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.

2 participants