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

Build CGO_ENABLED binaries for supported platforms in the release job #527

Merged
merged 5 commits into from
Dec 13, 2024

Conversation

andrew-farries
Copy link
Collaborator

@andrew-farries andrew-farries commented Dec 11, 2024

Make the release job run in a goreleaser/goreleaser-cross container so that we can build binaries for all supported architectures.

See the PR description for #525 for details of why we need a cross-compilation toolchain as a result of taking a dependency on pg_query_go and how the the goreleaser-cross image is used.

The addition of the -static LDFLAG for the linux/amd64 and linux/arm64 builds is necessary to statically link in order for the resulting pgroll binaries to run in the FROM scratch image that Goreleaser uses to build docker images.

Also, revert #515 to re-add the pgroll sql command now that pgroll can be built for all platforms when the dependency on pg_query_go is included in the build.

@andrew-farries andrew-farries force-pushed the cross-build-in-release-job branch 4 times, most recently from 37df9c7 to 097d705 Compare December 11, 2024 21:04
@andrew-farries andrew-farries force-pushed the cross-build-in-release-job branch from 097d705 to 7f8da80 Compare December 12, 2024 07:11
@andrew-farries andrew-farries marked this pull request as ready for review December 12, 2024 07:26
cmd/sql.go Show resolved Hide resolved
@andrew-farries andrew-farries merged commit cde22df into main Dec 13, 2024
28 checks passed
@andrew-farries andrew-farries deleted the cross-build-in-release-job branch December 13, 2024 22:17
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