-
Notifications
You must be signed in to change notification settings - Fork 2
fix(install): Respect TARGETARCH env var for cross-compilation #12
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
Conversation
The install script now checks for TARGETARCH (set by Docker buildx) or ARCH environment variables before falling back to `uname -m`. This fixes cross-compilation scenarios where `uname -m` returns the build host architecture instead of the target architecture, causing the wrong binary to be downloaded. Example usage in Dockerfile: ```dockerfile ARG TARGETARCH RUN wget -O- .../install.sh | sh ``` Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
📝 WalkthroughWalkthroughThe installation script's architecture detection mechanism was enhanced to support a layered environment variable override pattern ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @lexfrei, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request enhances the install.sh script to support cross-compilation for different architectures, which is particularly useful for docker buildx. The changes correctly prioritize TARGETARCH and ARCH environment variables over uname -m for architecture detection. The documentation in the script's help message has also been updated accordingly. I've provided one suggestion to simplify the architecture detection logic using a more concise and idiomatic shell scripting pattern. The overall implementation is sound and effectively addresses the problem.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Aleksei Sviridkin <3811295@gmail.com>
Note
Merge after #13
Summary
Enable ARM64 cross-compilation support by respecting
TARGETARCHenvironment variable in the install script.Problem
When building Docker images with
docker buildxfor a different architecture (e.g., buildinglinux/arm64on anamd64host),uname -mreturns the build host architecture, not the target architecture.This causes the install script to download the wrong binary during cross-compilation.
Solution
Check for
TARGETARCH(automatically set by Docker buildx) orARCHenvironment variables before falling back touname -m:Usage
Works automatically with Docker buildx:
Or manually:
Related