Skip to content

Set CGO_ENABLED in build - #3000

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

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

Conversation

@umanwizard

Copy link
Copy Markdown
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.

Comment thread Makefile

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
Copy Markdown
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

2 participants