mirror of
https://github.com/github/codeql.git
synced 2026-07-31 07:22:56 +02:00
Add arm64 Linux support to prebuilt ripunzip
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
This commit is contained in:
@@ -327,6 +327,7 @@ ripunzip_archive = use_repo_rule("//misc/ripunzip:ripunzip.bzl", "ripunzip_archi
|
||||
ripunzip_archive(
|
||||
name = "ripunzip",
|
||||
sha256_linux = "71482d7a7e4ea9176d5596161c49250c34b136b157c45f632b1111323fbfc0de",
|
||||
sha256_linux_arm = "a282740ef376ff8dc0de3c589b7457598db15cc045b7daa688f15531612e0bbe",
|
||||
sha256_macos_arm = "604194ab13f0aba3972995d995f11002b8fc285c8170401fcd46655065df20c9",
|
||||
sha256_macos_intel = "65367b94fd579d93d46f2d2595cc4c9a60cfcf497e3c824f9d1a7b80fa8bd38a",
|
||||
sha256_windows = "ac3874075def2b9e5074a3b5945005ab082cc6e689e1de658da8965bc23e643e",
|
||||
|
||||
@@ -3,12 +3,22 @@ def _ripunzip_archive_impl(repository_ctx):
|
||||
url_prefix = "https://github.com/GoogleChrome/ripunzip/releases/download/v%s" % version
|
||||
build_file = Label("//misc/ripunzip:BUILD.ripunzip.bazel")
|
||||
if "linux" in repository_ctx.os.name:
|
||||
arch = repository_ctx.os.arch
|
||||
if arch in ("aarch64", "arm64"):
|
||||
deb_arch = "arm64"
|
||||
sha256 = repository_ctx.attr.sha256_linux_arm
|
||||
canonical_id = "ripunzip-linux-arm"
|
||||
else:
|
||||
deb_arch = "amd64"
|
||||
sha256 = repository_ctx.attr.sha256_linux
|
||||
canonical_id = "ripunzip-linux"
|
||||
|
||||
# ripunzip only provides a deb package for Linux: we fish the binary out of it
|
||||
# a deb archive contains a data.tar.xz one which contains the files to be installed under usr/bin
|
||||
repository_ctx.download_and_extract(
|
||||
url = "%s/ripunzip_%s-1_amd64.deb" % (url_prefix, version),
|
||||
sha256 = repository_ctx.attr.sha256_linux,
|
||||
canonical_id = "ripunzip-linux",
|
||||
url = "%s/ripunzip_%s-1_%s.deb" % (url_prefix, version, deb_arch),
|
||||
sha256 = sha256,
|
||||
canonical_id = canonical_id,
|
||||
output = "deb",
|
||||
)
|
||||
repository_ctx.extract(
|
||||
@@ -52,6 +62,7 @@ ripunzip_archive = repository_rule(
|
||||
attrs = {
|
||||
"version": attr.string(mandatory = True),
|
||||
"sha256_linux": attr.string(mandatory = True),
|
||||
"sha256_linux_arm": attr.string(mandatory = True),
|
||||
"sha256_windows": attr.string(mandatory = True),
|
||||
"sha256_macos_intel": attr.string(mandatory = True),
|
||||
"sha256_macos_arm": attr.string(mandatory = True),
|
||||
|
||||
Reference in New Issue
Block a user