-
Notifications
You must be signed in to change notification settings - Fork 35
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
fix(ci): fix multiplatform build #460
fix(ci): fix multiplatform build #460
Conversation
WalkthroughThis pull request enhances multi-platform building support by modifying the GitHub Actions workflow to include steps for setting up QEMU and Docker Buildx, along with the declaration of a new environment variable for target platforms. Additionally, the Dockerfile and build scripts have been updated to replace hardcoded architecture values with dynamic detection using Changes
Sequence Diagram(s)sequenceDiagram
participant CI as GitHub Actions Workflow
participant QEMU as docker/setup-qemu-action@v3
participant Buildx as docker/setup-buildx-action@v3
participant Build as Build/Package Scripts
CI->>QEMU: Execute QEMU setup step
QEMU-->>CI: QEMU installed
CI->>Buildx: Execute Docker Buildx setup step
Buildx-->>CI: Buildx ready
CI->>Build: Run build job with TARGET_PLATFORMS env variable
sequenceDiagram
participant Script as Build Script
participant System as Machine (uname -m)
Script->>System: Query architecture via uname -m
System-->>Script: Return architecture (e.g., amd64 or arm64)
Script->>Script: Assign value to ARCHS/BUILDERARCH and proceed with build
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/build.yml
(2 hunks)Dockerfile.dapper
(1 hunks)scripts/build
(1 hunks)scripts/package
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Build binaries
- GitHub Check: Summary
🔇 Additional comments (4)
scripts/build (1)
23-38
: LGTM! Dynamic architecture detection looks good.The implementation properly handles both environment variable override and runtime detection for supported architectures.
scripts/package (1)
30-40
: LGTM! Architecture detection for Docker builds looks good.The implementation properly handles architecture detection and integration with Docker buildx for multi-platform builds.
Dockerfile.dapper (1)
1-1
:✅ Verification successful
Verify golang version.
The base image specifies golang 1.23 which doesn't exist yet. The latest stable version is 1.22.
🌐 Web query:
What is the latest version of golang?
💡 Result:
The latest stable version of Go (Golang) as of February 2025 is Go 1.23, with its most recent minor revision being Go 1.23.6 released on February 4, 2025[5]. This release includes security fixes and bug patches across various components like the compiler and
crypto/elliptic
package[5].Key details about recent releases:
- Go 1.23 was initially released on August 13, 2024[2][4]
- Subsequent minor updates addressed security vulnerabilities and bugs in:
- Cryptographic packages (
crypto/elliptic
,crypto/x509
)[5]- Network components (
net/http
)[5]- Toolchain improvements[5]
For installation, use:
go install golang.org/x/tools/gopls@latestto get the latest language server tools compatible with Go 1.23[1]. The current release maintains compatibility with projects using Go versions back to at least Go 1.21 through automatic toolchain upgrades[1][3].
Citations:
- 1: https://github.com/golang/tools/releases
- 2: https://go.dev/blog/go1.23
- 3: http://forum.exercism.org/t/update-go-version-to-the-latest-one/9326
- 4: https://tip.golang.org/doc/go1.23
- 5: https://go.dev/doc/devel/release
- 6: https://tip.golang.org/doc/go1.22
- 7: https://go.dev/dl/
- 8: https://go.dev/doc/install
Rewritten Review Comment
The Dockerfile now correctly references the latest stable Go version (1.23) as of February 2025, so there’s no issue with the base image. Additionally, exposing ARCHS to the build environment is properly implemented.
.github/workflows/build.yml (1)
75-93
: LGTM! Multi-platform build setup looks good.The implementation properly sets up QEMU and Docker buildx for multi-platform builds, targeting both amd64 and arm64 architectures.
Signed-off-by: Raphanus Lo <[email protected]>
90810b6
to
1f865d3
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
scripts/build (1)
23-38
: Enhance error handling and documentation.While the architecture detection logic is correct, consider these improvements:
- Add a comment documenting the supported architectures and expected format of
ARCHS
.- Make the error message more helpful by listing supported architectures.
Apply this diff to improve the error message:
- echo "$(uname -m): unsupported architecture" + echo "Error: $(uname -m) is not supported. Supported architectures: x86_64 (amd64), aarch64/arm64"
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/build.yml
(2 hunks)Dockerfile.dapper
(1 hunks)scripts/build
(1 hunks)scripts/package
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- .github/workflows/build.yml
- Dockerfile.dapper
- scripts/package
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Build binaries
- GitHub Check: Summary
🔇 Additional comments (1)
scripts/build (1)
39-41
: LGTM! Build loop implementation is correct.The build loop correctly:
- Uses the new
ARCHS
variable- Sets appropriate GOARCH for each architecture
- Maintains all necessary build flags
Fix multiplatform build