From ddee385f371ab5b00d69ed3b251b9c24f2cf80fe Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Tue, 18 Nov 2025 17:18:05 +0100 Subject: [PATCH 1/5] Ripunzip: use releases from github This uses the ripunzip releases from github instead of building them ourselves. --- .gitattributes | 3 - .github/workflows/build-ripunzip.yml | 169 ------------------------- MODULE.bazel | 26 ++-- misc/ripunzip/BUILD.bazel | 2 +- misc/ripunzip/BUILD.ripunzip.bazel | 2 +- misc/ripunzip/ripunzip-Linux.tar.zst | 3 - misc/ripunzip/ripunzip-Windows.tar.zst | 3 - misc/ripunzip/ripunzip-macOS.tar.zst | 3 - misc/ripunzip/ripunzip.bzl | 51 ++++++++ 9 files changed, 62 insertions(+), 200 deletions(-) delete mode 100644 .github/workflows/build-ripunzip.yml delete mode 100644 misc/ripunzip/ripunzip-Linux.tar.zst delete mode 100644 misc/ripunzip/ripunzip-Windows.tar.zst delete mode 100644 misc/ripunzip/ripunzip-macOS.tar.zst create mode 100644 misc/ripunzip/ripunzip.bzl diff --git a/.gitattributes b/.gitattributes index df5bed028be1..610342ef78b1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -82,9 +82,6 @@ /csharp/paket.main.bzl linguist-generated=true /csharp/paket.main_extension.bzl linguist-generated=true -# ripunzip tool -/misc/ripunzip/ripunzip-* filter=lfs diff=lfs merge=lfs -text - # swift prebuilt resources /swift/third_party/resources/*.zip filter=lfs diff=lfs merge=lfs -text /swift/third_party/resources/*.tar.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/build-ripunzip.yml b/.github/workflows/build-ripunzip.yml deleted file mode 100644 index 041d34bd0467..000000000000 --- a/.github/workflows/build-ripunzip.yml +++ /dev/null @@ -1,169 +0,0 @@ -name: Build ripunzip - -on: - workflow_dispatch: - inputs: - ripunzip-version: - description: What reference to checkout from google/ripunzip. Latest by default - required: false - openssl-version: - description: What reference to checkout from openssl/openssl for Linux. Latest by default - required: false - open-pr: - description: Open a pull request updating the ripunzip versions committed to lfs - required: false - default: true # will be false on PRs - pull_request: - paths: - - .github/workflows/build-ripunzip.yml - -permissions: {} - -jobs: - versions: - runs-on: ubuntu-slim - outputs: - ripunzip-version: ${{ inputs.ripunzip-version || steps.fetch-ripunzip-version.outputs.version }} - openssl-version: ${{ inputs.openssl-version || steps.fetch-openssl-version.outputs.version }} - steps: - - name: Fetch latest ripunzip version - id: fetch-ripunzip-version - if: "!inputs.ripunzip-version" - run: &fetch-version - echo "version=$(gh release view --repo $REPO --json tagName --jq .tagName)" | tee -a $GITHUB_OUTPUT - env: - REPO: "google/ripunzip" - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Fetch latest openssl version - id: fetch-openssl-version - if: "!inputs.openssl-version" - run: *fetch-version - env: - REPO: "openssl/openssl" - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - build: - needs: versions - strategy: - fail-fast: false - matrix: - os: - - ubuntu-22.04 # keep at lowest supported ubuntu version for broader glibc compatibility - - macos-15 - - windows-2025 - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v5 - with: - repository: google/ripunzip - ref: ${{ needs.versions.outputs.ripunzip-version }} - # we need to avoid ripunzip dynamically linking into libssl - # see https://github.com/sfackler/rust-openssl/issues/183 - - if: runner.os == 'Linux' - name: checkout openssl - uses: actions/checkout@v5 - with: - repository: openssl/openssl - path: openssl - ref: ${{ needs.versions.outputs.openssl-version }} - - if: runner.os == 'Linux' - name: build and install openssl with fPIC - shell: bash - working-directory: openssl - run: | - ./config -fPIC --prefix=$HOME/.local --openssldir=$HOME/.local/ssl - make -j $(nproc) - make install_sw -j $(nproc) - - if: runner.os == 'Linux' - name: build (linux) - shell: bash - run: | - env OPENSSL_LIB_DIR=$HOME/.local/lib64 OPENSSL_INCLUDE_DIR=$HOME/.local/include OPENSSL_STATIC=yes cargo build --release - mv target/release/ripunzip ripunzip-linux - - if: runner.os == 'Windows' - name: build (windows) - shell: bash - run: | - cargo build --release - mv target/release/ripunzip ripunzip-windows - - name: build (macOS) - if: runner.os == 'macOS' - shell: bash - run: | - rustup target install x86_64-apple-darwin - rustup target install aarch64-apple-darwin - cargo build --target x86_64-apple-darwin --release - cargo build --target aarch64-apple-darwin --release - lipo -create -output ripunzip-macos \ - -arch x86_64 target/x86_64-apple-darwin/release/ripunzip \ - -arch arm64 target/aarch64-apple-darwin/release/ripunzip - - name: Archive - shell: bash - run: | - tar acf ripunzip-$RUNNER_OS.tar.zst ripunzip-$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]') - - name: Upload built binary - uses: actions/upload-artifact@v4 - with: - name: ripunzip-${{ runner.os }} - path: ripunzip-${{ runner.os }}.tar.zst - retention-days: 5 - compression: 0 - - name: Check built binary - shell: bash - run: | - rm -f ripunzip-*.tar.zst - ./ripunzip-* --version - publish: - needs: [versions, build] - if: inputs.open-pr == 'true' - permissions: - contents: write - pull-requests: write - runs-on: ubuntu-slim - steps: - # workaround for git-lfs not being installed yet on ubuntu-slim runners - - name: Ensure git-lfs is installed - shell: bash - run: | - if which git-lfs &>/dev/null; then - echo "git-lfs is already installed" - exit 0 - fi - cd $TMP - gh release download --repo git-lfs/git-lfs --pattern "git-lfs-linux-amd64-*.tar.gz" --clobber - tar xzf git-lfs-linux-amd64-*.tar.gz - rm git-lfs-linux-amd64-*.tar.gz - cd git-lfs-* - pwd | tee -a $GITHUB_PATH - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v5 - with: - sparse-checkout: | - .github - misc/ripunzip - lfs: true - - name: Download built binaries - uses: actions/download-artifact@v4 - with: - merge-multiple: true - path: misc/ripunzip - - name: Open PR - shell: bash - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git switch -c update-ripunzip - git add misc/ripunzip - git commit -m "Update ripunzip binaries to version $VERSION" - git push --set-upstream origin update-ripunzip --force - TITLE="Update ripunzip binaries to version $VERSION" - gh pr create \ - --draft \ - --title "$TITLE" \ - --body "Automated update of ripunzip binaries." \ - --assignee "$ACTOR" || - (gh pr edit --title "$TITLE" --add-assignee "$ACTOR" && gh pr ready --undo) - env: - ACTOR: ${{ github.actor }} - VERSION: ${{ needs.versions.outputs.ripunzip-version }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/MODULE.bazel b/MODULE.bazel index dfd2c469a5ea..a17d0bd36c4b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -269,24 +269,16 @@ go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") go_deps.from_file(go_mod = "//go/extractor:go.mod") use_repo(go_deps, "org_golang_x_mod", "org_golang_x_tools") -lfs_archive = use_repo_rule("//misc/bazel:lfs.bzl", "lfs_archive") +ripunzip_archive = use_repo_rule("//misc/ripunzip:ripunzip.bzl", "ripunzip_archive") -lfs_archive( - name = "ripunzip-linux", - src = "//misc/ripunzip:ripunzip-Linux.tar.zst", - build_file = "//misc/ripunzip:BUILD.ripunzip.bazel", -) - -lfs_archive( - name = "ripunzip-windows", - src = "//misc/ripunzip:ripunzip-Windows.tar.zst", - build_file = "//misc/ripunzip:BUILD.ripunzip.bazel", -) - -lfs_archive( - name = "ripunzip-macos", - src = "//misc/ripunzip:ripunzip-macOS.tar.zst", - build_file = "//misc/ripunzip:BUILD.ripunzip.bazel", +# go to https://github.com/GoogleChrome/ripunzip/releases to find latest version and corresponding sha256s +ripunzip_archive( + name = "ripunzip", + version = "2.0.3", + sha256_linux = "ee0e8a957687a5dc3a66b2a4b25883bf762df4c9c07f0651af527a32a405054b", + sha256_windows = "66d0c1375301bf5ab815348048f43b110631d3fa7200acd50d50a8ed8655ca62", + sha256_macos_intel = "4457a18bfcc5feabe09f5ea3d1157128e07b4873392cb404a870e611924abf64", + sha256_macos_arm = "8a88eea54eac232d162a72a42065e0429b82dbf4f05e9642915dff9d7a81f846", ) register_toolchains( diff --git a/misc/ripunzip/BUILD.bazel b/misc/ripunzip/BUILD.bazel index fb33124f3b28..abd9c0828873 100644 --- a/misc/ripunzip/BUILD.bazel +++ b/misc/ripunzip/BUILD.bazel @@ -2,7 +2,7 @@ load("@rules_shell//shell:sh_binary.bzl", "sh_binary") alias( name = "ripunzip", - actual = select({"@platforms//os:" + os: "@ripunzip-%s//:ripunzip" % os for os in ("linux", "windows", "macos")}), + actual = "@ripunzip", visibility = ["//visibility:public"], ) diff --git a/misc/ripunzip/BUILD.ripunzip.bazel b/misc/ripunzip/BUILD.ripunzip.bazel index e2832d1e2758..582138dd3e1c 100644 --- a/misc/ripunzip/BUILD.ripunzip.bazel +++ b/misc/ripunzip/BUILD.ripunzip.bazel @@ -2,7 +2,7 @@ load("@bazel_skylib//rules:native_binary.bzl", "native_binary") native_binary( name = "ripunzip", - src = glob(["ripunzip-*"])[0], + src = glob(["bin/ripunzip*"])[0], out = "ripunzip" + select({ "@platforms//os:windows": ".exe", "//conditions:default": "", diff --git a/misc/ripunzip/ripunzip-Linux.tar.zst b/misc/ripunzip/ripunzip-Linux.tar.zst deleted file mode 100644 index c9a5ff1e5901..000000000000 --- a/misc/ripunzip/ripunzip-Linux.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:252a54114fde9932d2bf3e7a1592bc6767611682a913519585402b9c51d6e2c7 -size 4707184 diff --git a/misc/ripunzip/ripunzip-Windows.tar.zst b/misc/ripunzip/ripunzip-Windows.tar.zst deleted file mode 100644 index 80e41538135c..000000000000 --- a/misc/ripunzip/ripunzip-Windows.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3a4388816c72e0bc8c30741aaae05dc91b46174db406133cad40c783acf4fad6 -size 1765498 diff --git a/misc/ripunzip/ripunzip-macOS.tar.zst b/misc/ripunzip/ripunzip-macOS.tar.zst deleted file mode 100644 index 3ff3253ca5dc..000000000000 --- a/misc/ripunzip/ripunzip-macOS.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5a5d8ca7ed78b0da3a572b91556fbf03431c99770072060743c63e2d581d8580 -size 3796231 diff --git a/misc/ripunzip/ripunzip.bzl b/misc/ripunzip/ripunzip.bzl new file mode 100644 index 000000000000..ce2dfbba785d --- /dev/null +++ b/misc/ripunzip/ripunzip.bzl @@ -0,0 +1,51 @@ +def _impl(repository_ctx): + version = repository_ctx.attr.version + url_prefix = "https://github.com/GoogleChrome/ripunzip/releases/download/v%s" % version + build_file = Label("//misc/ripunzip:BUILD.ripunzip.bazel") + if repository_ctx.os.name == "linux": + repository_ctx.download_and_extract( + url="%s/ripunzip_%s-1_amd64.deb" % (url_prefix, version), + sha256=repository_ctx.attr.sha256_linux, + canonical_id="ripunzip-deb", + output="deb", + ) + repository_ctx.extract( + "deb/data.tar.xz", + strip_prefix="usr", + ) + elif repository_ctx.os.name == "windows": + repository_ctx.download_and_extract( + url="%s/ripunzip_v%s-x86_64-pc-windows-msvc.zip" % (url_prefix, version), + sha256=repository_ctx.attr.sha256_windows, + output="bin", + ) + elif repository_ctx.os.name == "macos": + arch = repository_ctx.os.arch + if arch == "x86_64": + suffix = "x86_64-apple-darwin" + sha256 = repository_ctx.attr.sha256_macos_intel + elif arch == "aarch64": + suffix = "aarch64-apple-darwin" + sha256 = repository_ctx.attr.sha256_macos_arm + else: + fail("Unsupported macOS architecture: %s" % arch) + repository_ctx.download_and_extract( + url="%s/ripunzip_v%s-%s.tar.gz" % (url_prefix, version, suffix), + sha256=sha256, + output="bin", + ) + else: + fail("Unsupported OS: %s" % repository_ctx.os.name) + repository_ctx.file("WORKSPACE.bazel") + repository_ctx.symlink(build_file, "BUILD.bazel") + +ripunzip_archive = repository_rule( + implementation=_impl, + attrs={ + "version": attr.string(mandatory=True), + "sha256_linux": attr.string(mandatory=True), + "sha256_windows": attr.string(mandatory=True), + "sha256_macos_intel": attr.string(mandatory=True), + "sha256_macos_arm": attr.string(mandatory=True), + }, +) From 702d1bbbeacb4e3999f0d4ee516d6be9b851a5e0 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 19 Nov 2025 08:05:17 +0100 Subject: [PATCH 2/5] Ripunzip: fix mac os string --- misc/ripunzip/ripunzip.bzl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/misc/ripunzip/ripunzip.bzl b/misc/ripunzip/ripunzip.bzl index ce2dfbba785d..f9046af95a0b 100644 --- a/misc/ripunzip/ripunzip.bzl +++ b/misc/ripunzip/ripunzip.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): repository_ctx.download_and_extract( url="%s/ripunzip_%s-1_amd64.deb" % (url_prefix, version), sha256=repository_ctx.attr.sha256_linux, - canonical_id="ripunzip-deb", + canonical_id="ripunzip-linux", output="deb", ) repository_ctx.extract( @@ -16,22 +16,26 @@ def _impl(repository_ctx): elif repository_ctx.os.name == "windows": repository_ctx.download_and_extract( url="%s/ripunzip_v%s-x86_64-pc-windows-msvc.zip" % (url_prefix, version), + canonical_id="ripunzip-windows", sha256=repository_ctx.attr.sha256_windows, output="bin", ) - elif repository_ctx.os.name == "macos": + elif repository_ctx.os.name == "mac os x": arch = repository_ctx.os.arch if arch == "x86_64": suffix = "x86_64-apple-darwin" sha256 = repository_ctx.attr.sha256_macos_intel + canonical_id = "ripunzip-macos-intel" elif arch == "aarch64": suffix = "aarch64-apple-darwin" sha256 = repository_ctx.attr.sha256_macos_arm + canonical_id = "ripunzip-macos-arm" else: fail("Unsupported macOS architecture: %s" % arch) repository_ctx.download_and_extract( url="%s/ripunzip_v%s-%s.tar.gz" % (url_prefix, version, suffix), sha256=sha256, + canonical_id=canonical_id, output="bin", ) else: From f1afe5cd9d3a30af59cba095858b535d577ac3c9 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 19 Nov 2025 08:06:17 +0100 Subject: [PATCH 3/5] Bazel: format --- MODULE.bazel | 6 +++--- misc/ripunzip/ripunzip.bzl | 40 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index a17d0bd36c4b..fc6acfc1137f 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -274,11 +274,11 @@ ripunzip_archive = use_repo_rule("//misc/ripunzip:ripunzip.bzl", "ripunzip_archi # go to https://github.com/GoogleChrome/ripunzip/releases to find latest version and corresponding sha256s ripunzip_archive( name = "ripunzip", - version = "2.0.3", sha256_linux = "ee0e8a957687a5dc3a66b2a4b25883bf762df4c9c07f0651af527a32a405054b", - sha256_windows = "66d0c1375301bf5ab815348048f43b110631d3fa7200acd50d50a8ed8655ca62", - sha256_macos_intel = "4457a18bfcc5feabe09f5ea3d1157128e07b4873392cb404a870e611924abf64", sha256_macos_arm = "8a88eea54eac232d162a72a42065e0429b82dbf4f05e9642915dff9d7a81f846", + sha256_macos_intel = "4457a18bfcc5feabe09f5ea3d1157128e07b4873392cb404a870e611924abf64", + sha256_windows = "66d0c1375301bf5ab815348048f43b110631d3fa7200acd50d50a8ed8655ca62", + version = "2.0.3", ) register_toolchains( diff --git a/misc/ripunzip/ripunzip.bzl b/misc/ripunzip/ripunzip.bzl index f9046af95a0b..b843cdff76bf 100644 --- a/misc/ripunzip/ripunzip.bzl +++ b/misc/ripunzip/ripunzip.bzl @@ -4,21 +4,21 @@ def _impl(repository_ctx): build_file = Label("//misc/ripunzip:BUILD.ripunzip.bazel") if repository_ctx.os.name == "linux": 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", - output="deb", + url = "%s/ripunzip_%s-1_amd64.deb" % (url_prefix, version), + sha256 = repository_ctx.attr.sha256_linux, + canonical_id = "ripunzip-linux", + output = "deb", ) repository_ctx.extract( "deb/data.tar.xz", - strip_prefix="usr", + strip_prefix = "usr", ) elif repository_ctx.os.name == "windows": repository_ctx.download_and_extract( - url="%s/ripunzip_v%s-x86_64-pc-windows-msvc.zip" % (url_prefix, version), - canonical_id="ripunzip-windows", - sha256=repository_ctx.attr.sha256_windows, - output="bin", + url = "%s/ripunzip_v%s-x86_64-pc-windows-msvc.zip" % (url_prefix, version), + canonical_id = "ripunzip-windows", + sha256 = repository_ctx.attr.sha256_windows, + output = "bin", ) elif repository_ctx.os.name == "mac os x": arch = repository_ctx.os.arch @@ -33,10 +33,10 @@ def _impl(repository_ctx): else: fail("Unsupported macOS architecture: %s" % arch) repository_ctx.download_and_extract( - url="%s/ripunzip_v%s-%s.tar.gz" % (url_prefix, version, suffix), - sha256=sha256, - canonical_id=canonical_id, - output="bin", + url = "%s/ripunzip_v%s-%s.tar.gz" % (url_prefix, version, suffix), + sha256 = sha256, + canonical_id = canonical_id, + output = "bin", ) else: fail("Unsupported OS: %s" % repository_ctx.os.name) @@ -44,12 +44,12 @@ def _impl(repository_ctx): repository_ctx.symlink(build_file, "BUILD.bazel") ripunzip_archive = repository_rule( - implementation=_impl, - attrs={ - "version": attr.string(mandatory=True), - "sha256_linux": attr.string(mandatory=True), - "sha256_windows": attr.string(mandatory=True), - "sha256_macos_intel": attr.string(mandatory=True), - "sha256_macos_arm": attr.string(mandatory=True), + implementation = _impl, + attrs = { + "version": attr.string(mandatory = True), + "sha256_linux": attr.string(mandatory = True), + "sha256_windows": attr.string(mandatory = True), + "sha256_macos_intel": attr.string(mandatory = True), + "sha256_macos_arm": attr.string(mandatory = True), }, ) From 69ee9cdb9f91fdbc10f51db052dad976f7e09ce1 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 19 Nov 2025 08:12:07 +0100 Subject: [PATCH 4/5] Ripunzip: fix mac os and windows URLs --- misc/ripunzip/ripunzip.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/ripunzip/ripunzip.bzl b/misc/ripunzip/ripunzip.bzl index b843cdff76bf..823b563b60d8 100644 --- a/misc/ripunzip/ripunzip.bzl +++ b/misc/ripunzip/ripunzip.bzl @@ -15,7 +15,7 @@ def _impl(repository_ctx): ) elif repository_ctx.os.name == "windows": repository_ctx.download_and_extract( - url = "%s/ripunzip_v%s-x86_64-pc-windows-msvc.zip" % (url_prefix, version), + url = "%s/ripunzip_v%s_x86_64-pc-windows-msvc.zip" % (url_prefix, version), canonical_id = "ripunzip-windows", sha256 = repository_ctx.attr.sha256_windows, output = "bin", @@ -33,7 +33,7 @@ def _impl(repository_ctx): else: fail("Unsupported macOS architecture: %s" % arch) repository_ctx.download_and_extract( - url = "%s/ripunzip_v%s-%s.tar.gz" % (url_prefix, version, suffix), + url = "%s/ripunzip_v%s_%s.tar.gz" % (url_prefix, version, suffix), sha256 = sha256, canonical_id = canonical_id, output = "bin", From 3be8591370b2018506e96473d2a36ad86352c1e5 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 19 Nov 2025 08:56:06 +0100 Subject: [PATCH 5/5] Ripunzip: fix windows os check, add comments --- misc/ripunzip/ripunzip.bzl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/misc/ripunzip/ripunzip.bzl b/misc/ripunzip/ripunzip.bzl index 823b563b60d8..2e707c267e24 100644 --- a/misc/ripunzip/ripunzip.bzl +++ b/misc/ripunzip/ripunzip.bzl @@ -1,8 +1,10 @@ -def _impl(repository_ctx): +def _ripunzip_archive_impl(repository_ctx): version = repository_ctx.attr.version url_prefix = "https://github.com/GoogleChrome/ripunzip/releases/download/v%s" % version build_file = Label("//misc/ripunzip:BUILD.ripunzip.bazel") - if repository_ctx.os.name == "linux": + if "linux" in repository_ctx.os.name: + # 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, @@ -11,16 +13,17 @@ def _impl(repository_ctx): ) repository_ctx.extract( "deb/data.tar.xz", - strip_prefix = "usr", + strip_prefix = "usr/bin", + output = "bin", ) - elif repository_ctx.os.name == "windows": + elif "windows" in repository_ctx.os.name: repository_ctx.download_and_extract( url = "%s/ripunzip_v%s_x86_64-pc-windows-msvc.zip" % (url_prefix, version), canonical_id = "ripunzip-windows", sha256 = repository_ctx.attr.sha256_windows, output = "bin", ) - elif repository_ctx.os.name == "mac os x": + elif "mac os" in repository_ctx.os.name: arch = repository_ctx.os.arch if arch == "x86_64": suffix = "x86_64-apple-darwin" @@ -44,7 +47,8 @@ def _impl(repository_ctx): repository_ctx.symlink(build_file, "BUILD.bazel") ripunzip_archive = repository_rule( - implementation = _impl, + implementation = _ripunzip_archive_impl, + doc = "Downloads a prebuilt ripunzip binary for the host platform from https://github.com/GoogleChrome/ripunzip/releases", attrs = { "version": attr.string(mandatory = True), "sha256_linux": attr.string(mandatory = True),