Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

disable cgo #353

wants to merge 1 commit into from

Conversation

brooksn
Copy link
Contributor

@brooksn brooksn commented Jan 30, 2024

This PR disables CGO to make it easier to support a range of build environments. The resulting binaries are still statically linked.

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}
Copy link
Contributor

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?

Copy link
Contributor Author

@brooksn brooksn Jan 30, 2024

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

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