improvements: Use pre-built binary versions for developer binaries - #326
Merged
SpaceFace02 merged 1 commit intoAug 5, 2026
Merged
Conversation
Reviewer's GuideThis PR updates the Makefile to prefer downloading prebuilt binaries for controller-gen, yq, and kopium based on detected OS/architecture, with go/cargo installation kept as a fallback, and introduces OS/ARCH detection helpers and a simplification to the go-install-tool macro. Flow diagram for developer tool binary installation in Makefileflowchart TD
A[make build-tools / yq / kopium] --> B[detect OS]
B --> C[detect ARCH]
C --> D{tool target}
D -->|controller-gen| E[run curl for controller-gen prebuilt]
D -->|yq| F[run curl for yq prebuilt]
D -->|kopium| G[run curl for kopium prebuilt]
E --> H{curl success?}
F --> I{curl success?}
G --> J{curl success?}
H -->|yes| K[chmod +x controller-gen]
I -->|yes| L[chmod +x yq]
G -->|yes| M[mv kopium into LOCALBIN]
H -->|no| N[go-install-tool]
I -->|no| N
J -->|no| O[cargo-install-tool]
K --> P[tool ready]
L --> P
M --> P
N --> P
O --> P
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The
KOPIUM_RUST_ARCH := $(shell uname -m)logic will producearm64on Apple Silicon, but kopium release artifacts useaarch64-apple-darwin, so the computedKOPIUM_TARGETwill be invalid on macOS ARM; consider normalizingarm64toaarch64there as you did forARCH. - For non-Linux/macOS platforms
KOPIUM_TARGETwill be empty and the curl URL will be malformed; it might be better to fail early with a clear error or skip the prebuilt path whenKOPIUM_TARGETis undefined instead of attempting a broken download.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `KOPIUM_RUST_ARCH := $(shell uname -m)` logic will produce `arm64` on Apple Silicon, but kopium release artifacts use `aarch64-apple-darwin`, so the computed `KOPIUM_TARGET` will be invalid on macOS ARM; consider normalizing `arm64` to `aarch64` there as you did for `ARCH`.
- For non-Linux/macOS platforms `KOPIUM_TARGET` will be empty and the curl URL will be malformed; it might be better to fail early with a clear error or skip the prebuilt path when `KOPIUM_TARGET` is undefined instead of attempting a broken download.
## Individual Comments
### Comment 1
<location path="Makefile" line_range="22-27" />
<code_context>
+# either x86_64/amd64 or aarch64/arm64
+ARCH ?= $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
+
+# Kopium architecture detection: supports only Linux and macOS.
+KOPIUM_RUST_ARCH := $(shell uname -m)
+ifeq ($(OS),linux)
+ KOPIUM_TARGET := $(KOPIUM_RUST_ARCH)-unknown-linux-gnu
+else ifeq ($(OS),darwin)
+ KOPIUM_TARGET := $(KOPIUM_RUST_ARCH)-apple-darwin
+endif
+
</code_context>
<issue_to_address>
**issue (bug_risk):** KOPIUM_TARGET is incorrect for Apple Silicon (arm64) Rust target triples
On Apple Silicon, `uname -m` returns `arm64`, but the Rust target triple is `aarch64-apple-darwin`. This makes `KOPIUM_TARGET := $(KOPIUM_RUST_ARCH)-apple-darwin` resolve to `arm64-apple-darwin`, which is invalid and will break Kopium downloads on macOS ARM.
Please normalize `KOPIUM_RUST_ARCH` (or reuse `ARCH`) so that `arm64` is mapped to `aarch64`, producing `aarch64-apple-darwin` for Apple Silicon.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…hen fallback to go install Signed-off-by: Chirag Rao <crao@redhat.com>
SpaceFace02
force-pushed
the
prebuilt-components
branch
from
August 4, 2026 11:40
c783ce9 to
2571096
Compare
Jakob-Naucke
approved these changes
Aug 4, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Jakob-Naucke, SpaceFace02 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
SpaceFace02
merged commit Aug 5, 2026
1e82f12
into
trusted-execution-clusters:main
11 of 12 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
integration tests run
make crds-rs. We can simplify the makefile to use prebuilt versions of developer tools like yq, kopium and controller-gen, then having go install as fallback, if URLS change.Summary by Sourcery
Use prebuilt, architecture-aware binaries for controller-gen, yq, and kopium in the Makefile, with go/cargo installation as a fallback when downloads fail.
Enhancements: