Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libarchive windows bsdtar 404 #935

Closed
timbess opened this issue Sep 13, 2024 · 1 comment · Fixed by #940
Closed

libarchive windows bsdtar 404 #935

timbess opened this issue Sep 13, 2024 · 1 comment · Fixed by #940

Comments

@timbess
Copy link

timbess commented Sep 13, 2024

Unfortunately it seems like the maintainers of libarchive deleted all their old windows releases, so this link is no longer valid:

"https://github.com/libarchive/libarchive/releases/download/v3.7.4/libarchive-v3.7.4-amd64.zip",

Seems related to this. That's unfortunate, I thought Github releases would be immutable 🙁

@bobzoller
Copy link

In case other folks bit by this don't care about windows and need a quick workaround, here's what I did. We were using version 2.7.9, adjust the commit as necessary:

diff --git a/MODULE.bazel b/MODULE.bazel
index caf1920ee..337c1fdbc 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -28,6 +28,14 @@ bazel_dep(name = "hermetic_cc_toolchain", version = "3.1.0")
 bazel_dep(name = "circl", version = "1.3.8")
 bazel_dep(name = "rules_distroless", version = "0.3.3")
 
+# TODO(bobzoller): delete this once https://github.com/bazel-contrib/bazel-lib/issues/935 is resolved
+git_override(
+    module_name = "aspect_bazel_lib",
+    commit = "cc956d8589c866339f81637037435366c25f582b",  # v2.7.9
+    patches = ["//patches:aspect_bazel_lib-libarchive-workaround.patch"],
+    remote = "https://github.com/bazel-contrib/bazel-lib",
+)
+
 # NOTE:
 # Even though rules_distroless PR#50 enabled Bzlmod and it was released in
 # 0.3.4, the release failed for MacOS, so this git_override is needed until
diff --git a/patches/BUILD.bazel b/patches/BUILD.bazel
new file mode 100644
index 000000000..63a8a72ce
--- /dev/null
+++ b/patches/BUILD.bazel
@@ -0,0 +1 @@
+exports_files(["aspect_bazel_lib-libarchive-workaround.patch"])
diff --git a/patches/aspect_bazel_lib-libarchive-workaround.patch b/patches/aspect_bazel_lib-libarchive-workaround.patch
new file mode 100644
index 000000000..3f9a0b3ed
--- /dev/null
+++ b/patches/aspect_bazel_lib-libarchive-workaround.patch
@@ -0,0 +1,40 @@
+diff --git a/lib/private/tar_toolchain.bzl b/lib/private/tar_toolchain.bzl
+index c27a801..a03c992 100644
+--- lib/private/tar_toolchain.bzl
++++ lib/private/tar_toolchain.bzl
+@@ -25,13 +25,13 @@ BSDTAR_PLATFORMS = {
+             "@platforms//cpu:aarch64",
+         ],
+     ),
+-    "windows_amd64": struct(
+-        release_platform = "win64",
+-        compatible_with = [
+-            "@platforms//os:windows",
+-            "@platforms//cpu:x86_64",
+-        ],
+-    ),
++    # "windows_amd64": struct(
++    #     release_platform = "win64",
++    #     compatible_with = [
++    #         "@platforms//os:windows",
++    #         "@platforms//cpu:x86_64",
++    #     ],
++    # ),
+ }
+ 
+ BSDTAR_PREBUILT = {
+@@ -51,10 +51,10 @@ BSDTAR_PREBUILT = {
+         "https://github.com/aspect-build/bsdtar-prebuilt/releases/download/v3.7.4-2/tar_linux_arm64",
+         "1b4fda1e1274c98557e4ad288e4c80274e770df19141e4c8cdce3ce7533f75ae",
+     ),
+-    "windows_amd64": (
+-        "https://github.com/libarchive/libarchive/releases/download/v3.7.4/libarchive-v3.7.4-amd64.zip",
+-        "7ced6865d5e22e1dab0c3f3d65094d946ae505ec4e8db026f82c9e1c413f3c59",
+-    ),
++    # "windows_amd64": (
++    #     "https://github.com/libarchive/libarchive/releases/download/v3.7.4/libarchive-v3.7.4-amd64.zip",
++    #     "7ced6865d5e22e1dab0c3f3d65094d946ae505ec4e8db026f82c9e1c413f3c59",
++    # ),
+ }
+ 
+ def _bsdtar_binary_repo(rctx):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants