Skip to content

Commit 3e778b6

Browse files
committed
fix(windows): correct wasm-tools download URL for Windows
Windows releases of wasm-tools use .zip format, not .tar.gz format. This was causing 404 errors when trying to download wasm-tools on Windows. Changes: - Update wasm-tools.json: Change url_suffix from .tar.gz to .zip for all Windows entries - Update checksums to match actual Windows .zip files: - v1.235.0: ecf9f2064c2096df134c39c2c97af2c025e974cc32e3c76eb2609156c1690a74 (unchanged) - v1.239.0: 039b1eaa170563f762355a23c5ee709790199433e35e5364008521523e9e3398 (updated) - v1.240.0: 81f012832e80fe09d384d86bb961d4779f6372a35fa965cc64efe318001ab27e (updated) - Update _download_wasm_tools() to handle both .zip and .tar.gz archives Fixes: bytecodealliance/wasm-tools Windows download errors in BCR CI
1 parent e7a277e commit 3e778b6

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

checksums/tools/wasm-tools.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"platforms": {
1717
"windows_amd64": {
1818
"sha256": "ecf9f2064c2096df134c39c2c97af2c025e974cc32e3c76eb2609156c1690a74",
19-
"url_suffix": "x86_64-windows.tar.gz"
19+
"url_suffix": "x86_64-windows.zip"
2020
},
2121
"linux_arm64": {
2222
"sha256": "384ca3691502116fb6f48951ad42bd0f01f9bf799111014913ce15f4f4dde5a2",
@@ -77,8 +77,8 @@
7777
"url_suffix": "aarch64-linux.tar.gz"
7878
},
7979
"windows_amd64": {
80-
"sha256": "0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5",
81-
"url_suffix": "x86_64-windows.tar.gz"
80+
"sha256": "039b1eaa170563f762355a23c5ee709790199433e35e5364008521523e9e3398",
81+
"url_suffix": "x86_64-windows.zip"
8282
}
8383
}
8484
},
@@ -102,8 +102,8 @@
102102
"url_suffix": "aarch64-linux.tar.gz"
103103
},
104104
"windows_amd64": {
105-
"sha256": "0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5",
106-
"url_suffix": "x86_64-windows.tar.gz"
105+
"sha256": "81f012832e80fe09d384d86bb961d4779f6372a35fa965cc64efe318001ab27e",
106+
"url_suffix": "x86_64-windows.zip"
107107
}
108108
}
109109
}

toolchains/wasm_toolchain.bzl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,18 @@ def _download_wasm_tools(repository_ctx):
487487
platform_info.url_suffix,
488488
)
489489

490-
# Download and extract tarball, letting Bazel handle the structure
490+
# Determine stripPrefix based on archive format
491+
# Windows uses .zip, others use .tar.gz
492+
if platform_info.url_suffix.endswith(".zip"):
493+
strip_prefix = "wasm-tools-{}-{}".format(version, platform_info.url_suffix.replace(".zip", ""))
494+
else:
495+
strip_prefix = "wasm-tools-{}-{}".format(version, platform_info.url_suffix.replace(".tar.gz", ""))
496+
497+
# Download and extract archive, letting Bazel handle the structure
491498
repository_ctx.download_and_extract(
492499
url = wasm_tools_url,
493500
sha256 = platform_info.sha256,
494-
stripPrefix = "wasm-tools-{}-{}".format(version, platform_info.url_suffix.replace(".tar.gz", "")),
501+
stripPrefix = strip_prefix,
495502
)
496503

497504
def _download_wac(repository_ctx):

0 commit comments

Comments
 (0)