From 678be6afa8d5cb04976d32d409403900acfe20fc Mon Sep 17 00:00:00 2001 From: Nikolas-LFDesigns Date: Wed, 13 Aug 2025 10:49:58 +0200 Subject: [PATCH] Move Shellcheck binary source to the Shellcheck author's repo vscode-shellcheck is archived as of august 4th, possibly ceasing updates on shellcheck binaries. Fixes #42 --- deps.bzl | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/deps.bzl b/deps.bzl index 3805ca3..0c1ad53 100644 --- a/deps.bzl +++ b/deps.bzl @@ -7,33 +7,53 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def _urls(arch, version): - url = "https://github.com/vscode-shellcheck/shellcheck-binaries/releases/download/{version}/shellcheck-{version}.{arch}.tar.gz".format( + archive_template_name = { + "darwin_aarch64": "shellcheck-{version}.{arch}.tar.xz", + "darwin_x86_64": "shellcheck-{version}.{arch}.tar.xz", + "linux_aarch64": "shellcheck-{version}.{arch}.tar.xz", + "linux_armv6hf": "shellcheck-{version}.{arch}.tar.xz", + "linux_x86_64": "shellcheck-{version}.{arch}.tar.xz", + "windows_x86_64": "shellcheck-{version}.zip", + } + url = "https://github.com/koalaman/shellcheck/releases/download/{version}/{archive}".format( version = version, - arch = arch.replace("_", ".", 1), + archive = archive_template_name[arch].format( + version = version, + arch = arch.replace("_", ".", 1), + ) ) return [ - url.replace("https://", "https://mirror.bazel.build/"), url, ] def shellcheck_dependencies(): - version = "v0.9.0" + version = "v0.11.0" sha256 = { - "darwin_aarch64": "a75b912015aaa5b2a48698b63f3619783d90abda4d32a31362209315e6c1cdf6", - "darwin_x86_64": "d1244da2aa5d0c2874f3a4a680c6ac79a488ff6dbf9928e12dc80ff3fdc294db", - "linux_aarch64": "b5633bd195cfe61a310bd8dcff2514855afefea908942a0fd4d01fa6451cb4e6", - "linux_armv6hf": "4791d36d84a626c4366746d14ad68daf2c07f502da09319c45fa6c5c0a847aa9", - "linux_x86_64": "0ab5711861e6fcafad5aa21587ee75bbd2b16505d56f41c9ba1191a83d314074", - "windows_x86_64": "a0f021057b6d6a69a22f6b0db0187bcaca3f5195385e92a7555ad63a6e39ee15", + "darwin_aarch64": "56affdd8de5527894dca6dc3d7e0a99a873b0f004d7aabc30ae407d3f48b0a79", + "darwin_x86_64": "3c89db4edcab7cf1c27bff178882e0f6f27f7afdf54e859fa041fca10febe4c6", + "linux_aarch64": "12b331c1d2db6b9eb13cfca64306b1b157a86eb69db83023e261eaa7e7c14588", + "linux_armv6hf": "8afc50b302d5feeac9381ea114d563f0150d061520042b254d6eb715797c8223", + "linux_x86_64": "8c3be12b05d5c177a04c29e3c78ce89ac86f1595681cab149b65b97c4e227198", } for arch, sha256 in sha256.items(): maybe( http_archive, name = "shellcheck_{arch}".format(arch = arch), + strip_prefix = "shellcheck-{version}".format(version = version), build_file_content = """exports_files(["shellcheck"]) """, sha256 = sha256, urls = _urls(arch = arch, version = version), ) + + # Special case, as it is a zip archive with no prefix to strip. + maybe( + http_archive, + name = "shellcheck_windows_x86_64", + build_file_content = """exports_files(["shellcheck"]) +""", + sha256 = "8a4e35ab0b331c85d73567b12f2a444df187f483e5079ceffa6bda1faa2e740e", + urls = _urls(arch = "windows_x86_64", version = version), + )