Skip to content

Add arm64 Linux support to prebuilt ripunzip - #22261

Merged
redsun82 merged 4 commits into
mainfrom
redsun82-arm64-linux-ripunzip
Jul 31, 2026
Merged

Add arm64 Linux support to prebuilt ripunzip#22261
redsun82 merged 4 commits into
mainfrom
redsun82-arm64-linux-ripunzip

Conversation

@redsun82

@redsun82redsun82 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Overview

The ripunzip_archive repository rule in misc/ripunzip/ripunzip.bzl downloads a prebuilt ripunzip for the host platform at repo-fetch time. The macOS branch already switches on repository_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, map os.arch → deb arch (aarch64arm64, else amd64), selecting the matching sha and canonical id. Add a mandatory sha256_linux_arm64 attribute.
  • Consistent arch naming: standardized all sha attributes (and their canonical_ids) to a single <os>_x64 / <os>_arm64 scheme:
    • sha256_linuxsha256_linux_x64
    • sha256_linux_arm64 (new)
    • sha256_macos_intelsha256_macos_x64
    • sha256_macos_armsha256_macos_arm64
    • sha256_windowssha256_windows_x64
  • MODULE.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//:ripunzip still resolves and fetches the amd64 deb (else-branch intact, new mandatory attr wired).
  • bazel mod deps loads cleanly (MODULE.bazel satisfies the renamed attrs).
  • buildifier reports no formatting changes.

Note on drift

The coupling point is the deb-arch naming (amd64/arm64) plus bazel's os.arch reporting (amd64/aarch64 on Linux). If ripunzip changes its release asset naming, or bazel changes how it reports os.arch, this mapping needs revisiting.

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
@redsun82
redsun82 requested a review from a team as a code ownerJuly 30, 2026 16:24
CopilotAI review requested due to automatic review settings July 30, 2026 16:24
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

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .deb artifact (amd64 vs arm64).
  • Add a new sha256_linux_arm attribute and wire it into MODULE.bazel.
Show a summary per file
FileDescription
misc/ripunzip/ripunzip.bzlAdds Linux arch detection and switches download URL/SHA based on amd64 vs arm64.
MODULE.bazelSupplies the new ARM Linux SHA256 for the ripunzip dependency.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment threadmisc/ripunzip/ripunzip.bzl Outdated
Comment threadmisc/ripunzip/ripunzip.bzl Outdated
Comment threadmisc/ripunzip/ripunzip.bzl Outdated
redsun82and others added 2 commits July 30, 2026 18:27
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
@redsun82

redsun82 commented Jul 31, 2026

Copy link
Copy Markdown
ContributorAuthor

mbg
mbg approved these changes Jul 31, 2026
@redsun82
redsun82 merged commit 1c0ae0f into mainJul 31, 2026
80 checks passed
@redsun82
redsun82 deleted the redsun82-arm64-linux-ripunzip branch July 31, 2026 13:31
Sign up for freeto 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

@redsun82@mbg