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

Cross build golang in CI #433

Merged
merged 3 commits into from
Jan 7, 2025
Merged

Conversation

cbgbt
Copy link
Contributor

@cbgbt cbgbt commented Jan 4, 2025

Description of changes:
cargo-cross builds of krane-static were failing. This:

  • Explicitly enables CGO when building golang sources
  • Attempts to detect the cross build environment and configure the cross-compiler when building krane-static
  • Runs cargo-cross for PRs to twoliter to catch such errors ahead of time in the future.

Testing done:

  • Successfully cross-built twoliter for aarch64 on an x86_64 machine.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@cbgbt cbgbt force-pushed the cross-build-golang branch from 927f5d6 to 5447964 Compare January 4, 2025 01:43
cbgbt added 2 commits January 4, 2025 01:57
The go compiler needs CGO enabled and a reference to the cross
compiler toolchain in order to cross-build.
@cbgbt cbgbt force-pushed the cross-build-golang branch from 5447964 to 6f0facc Compare January 4, 2025 01:57
@cbgbt cbgbt changed the title Cross build golang Cross build golang in CI Jan 4, 2025
@cbgbt
Copy link
Contributor Author

cbgbt commented Jan 6, 2025

Provide additional CFLAGS suggested by @jpculp

@cbgbt cbgbt force-pushed the cross-build-golang branch from 52c4d21 to c9b0442 Compare January 6, 2025 23:15
@cbgbt cbgbt merged commit b0347e6 into bottlerocket-os:develop Jan 7, 2025
3 checks passed
@cbgbt cbgbt deleted the cross-build-golang branch January 7, 2025 01:20
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.

3 participants