-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disable cgo #353
base: master
Are you sure you want to change the base?
disable cgo #353
Conversation
Signed-off-by: Brooks Newberry <[email protected]>
@@ -1,7 +1,7 @@ | |||
BINARIES = gen_release_notes gen_release_report backport semv rancher_release test_coverage upstream_go_version rke2_release release | |||
ARCHS ?= amd64 arm64 | |||
OSs ?= linux darwin freebsd | |||
GO_COMPILE = GOOS=$${os} GOARCH=$${arch} CGO_ENABLED=1 $(GO) build -tags $(TAGS) -v -ldflags "$(LDFLAGS)" -o $@-$${os}-$${arch} | |||
GO_COMPILE = GOOS=$${os} GOARCH=$${arch} $(GO) build -tags $(TAGS) -v -ldflags "$(LDFLAGS)" -o $@-$${os}-$${arch} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we needed this on since we're using the hardened image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building in the hardened image would also work, but right now builds are being done of the Ubuntu runner vm, not in a container.
The Ubuntu environment would need extra setup, cross compiling for FreeBSD doesn't work with the installed libc, and that issue only cropped up when importing a particular library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see I'm wrong about that. I'll cancel review for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added FreeBSD since I occassionally work from my FreeBSD machine and provides a bulk of MacOS' system but we can drop it entirely. It's not even slightly a requirement.
This PR disables CGO to make it easier to support a range of build environments. The resulting binaries are still statically linked.