Add arm64 Linux support to prebuilt ripunzip - #22261
Merged
Merged
Conversation
The `ripunzip_archive` repository rule downloaded a prebuilt ripunzip for the host platform, but the Linux branch was hardcoded to the amd64 deb, so on an arm64 Linux host it would fetch an x86 binary. Switch on `repository_ctx.os.arch` (mirroring the macOS branch) to select the arm64 deb, which ripunzip publishes for the pinned version. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c6404a7a-35d7-4294-b3b6-9231ca15ef25
repository_ctx.os.arch reports the lower-cased Java os.arch property, which is "aarch64" on Linux arm64 — same as the macOS branch below. Drop the redundant "arm64" alternative. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c6404a7a-35d7-4294-b3b6-9231ca15ef25
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds Linux ARM64 support to the ripunzip_archive Bazel repository rule so ripunzip can be fetched/extracted on ARM-based Linux hosts.
Changes:
- Detect Linux host architecture and select the appropriate
.debartifact (amd64vsarm64). - Add a new
sha256_linux_armattribute and wire it intoMODULE.bazel.
Show a summary per file
| File | Description |
|---|---|
| misc/ripunzip/ripunzip.bzl | Adds Linux arch detection and switches download URL/SHA based on amd64 vs arm64. |
| MODULE.bazel | Supplies the new ARM Linux SHA256 for the ripunzip dependency. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Low
Rename the sha256 attributes (and matching canonical_ids) to a single scheme across all platforms: <os>_x64 / <os>_arm64. This replaces the inconsistent sha256_linux (no suffix), sha256_macos_intel and sha256_macos_arm. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c6404a7a-35d7-4294-b3b6-9231ca15ef25
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c6404a7a-35d7-4294-b3b6-9231ca15ef25
Contributor
Author
Rerun has been triggered: 3 restarted 🚀 |
mbg
approved these changes
Jul 31, 2026
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.
Overview
The
ripunzip_archiverepository rule inmisc/ripunzip/ripunzip.bzldownloads a prebuiltripunzipfor the host platform at repo-fetch time. The macOS branch already switches onrepository_ctx.os.arch, but the Linux branch was hardcoded to the amd64 deb (ripunzip_%s-1_amd64.deb) — so on an arm64 Linux host it would fetch an x86 binary.This adds a Linux arch switch mirroring the macOS branch. GoogleChrome/ripunzip publishes an arm64 deb for the pinned version (
ripunzip_2.0.4-1_arm64.deb), so no version bump is needed.Part of the Linux arm64 support work for CodeQL.
Changes
misc/ripunzip/ripunzip.bzl: in the Linux branch, mapos.arch→ deb arch (aarch64→arm64, elseamd64), selecting the matching sha and canonical id. Add a mandatorysha256_linux_arm64attribute.canonical_ids) to a single<os>_x64/<os>_arm64scheme:sha256_linux→sha256_linux_x64sha256_linux_arm64(new)sha256_macos_intel→sha256_macos_x64sha256_macos_arm→sha256_macos_arm64sha256_windows→sha256_windows_x64MODULE.bazel: add the arm64 deb sha and rename the existing attributes to match. Version and sha values unchanged (only names).Validation (x86 host)
The arm64 download only triggers on an arm64 host, so this was validated structurally on x86:
bazel build @ripunzip//:ripunzipstill resolves and fetches the amd64 deb (else-branch intact, new mandatory attr wired).bazel mod depsloads cleanly (MODULE.bazel satisfies the renamed attrs).Note on drift
The coupling point is the deb-arch naming (
amd64/arm64) plus bazel'sos.archreporting (amd64/aarch64on Linux). If ripunzip changes its release asset naming, or bazel changes how it reportsos.arch, this mapping needs revisiting.