Skip to content

Commit fa7a90d

Browse files
avrabeclaude
andcommitted
fix: update wasm-tools to v1.241.2 and improve checksum updater
This fixes the CI failures in PR #212 where builds were failing with "Unsupported platform linux_amd64 for wasm-tools version 1.241.2". Changes: - Update registry.bzl with wasm-tools v1.241.2 checksums for all platforms - Update wasm-tools.json with v1.241.2 release data - Fix checksum_updater to use correct marker names (fallback_data vs hardcoded_data) - Fix checksum_updater to properly reference ChecksumManager field (manager vs checksum_manager) - Add wasi-sdk tag_prefix support in tool_config.rs - Fix jco.json to include required sha256/url_suffix fields for NPM packages - Remove test file nonexistent-tool.json The registry.bzl update enables wasm-tools v1.241.2 to be properly downloaded and validated across all supported platforms. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent ce04625 commit fa7a90d

File tree

7 files changed

+86
-45
lines changed

7 files changed

+86
-45
lines changed

checksums/registry.bzl

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _get_fallback_checksums(tool_name):
4848
"wasm-tools": {
4949
"tool_name": "wasm-tools",
5050
"github_repo": "bytecodealliance/wasm-tools",
51-
"latest_version": "1.240.0",
51+
"latest_version": "1.241.2",
5252
"versions": {
5353
"1.235.0": {
5454
"release_date": "2024-12-15",
@@ -146,6 +146,31 @@ def _get_fallback_checksums(tool_name):
146146
},
147147
},
148148
},
149+
"1.241.2": {
150+
"release_date": "2025-11-14",
151+
"platforms": {
152+
"darwin_amd64": {
153+
"sha256": "ded5228bd4f7b06c7ec7bee31b570daa72022c28fdd890d23cd2837e3914d117",
154+
"url_suffix": "x86_64-macos.tar.gz",
155+
},
156+
"darwin_arm64": {
157+
"sha256": "96dbe14cde4a1e48781af959b623e045a2cab106756476039309f8e6266906a3",
158+
"url_suffix": "aarch64-macos.tar.gz",
159+
},
160+
"linux_amd64": {
161+
"sha256": "5ead4459eef50f4b83b47151332f22e4bcfea9c1917e816273b807b2d6567199",
162+
"url_suffix": "x86_64-linux.tar.gz",
163+
},
164+
"linux_arm64": {
165+
"sha256": "abc5a70c5cade497805998fd0b5cd545df9b484c62f16d33dd6a4cad135302aa",
166+
"url_suffix": "aarch64-linux.tar.gz",
167+
},
168+
"windows_amd64": {
169+
"sha256": "0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5",
170+
"url_suffix": "x86_64-windows.zip",
171+
},
172+
},
173+
},
149174
},
150175
},
151176
"wit-bindgen": {

checksums/tools/jco.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"release_date": "2024-11-25",
1212
"platforms": {
1313
"universal": {
14+
"sha256": "",
15+
"url_suffix": "",
1416
"npm_package": "@bytecodealliance/jco",
1517
"npm_version": "1.4.0",
1618
"dependencies": ["@bytecodealliance/componentize-js"]

checksums/tools/nonexistent-tool.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

checksums/tools/wasm-tools.json

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22
"tool_name": "wasm-tools",
33
"github_repo": "bytecodealliance/wasm-tools",
44
"latest_version": "1.241.2",
5-
"last_checked": "2025-11-18T00:00:00.000000Z",
6-
"supported_platforms": [
7-
"darwin_amd64",
8-
"darwin_arm64",
9-
"linux_amd64",
10-
"linux_arm64",
11-
"windows_amd64"
12-
],
5+
"last_checked": "2025-11-19T05:30:22.781475Z",
136
"versions": {
147
"1.239.0": {
158
"release_date": "2024-09-09",
169
"platforms": {
10+
"windows_amd64": {
11+
"sha256": "039b1eaa170563f762355a23c5ee709790199433e35e5364008521523e9e3398",
12+
"url_suffix": "x86_64-windows.zip"
13+
},
1714
"darwin_amd64": {
1815
"sha256": "d62482e2bfe65a05f4c313f2d57b09736054e37f4dfe94b4bdf7b4713b03fa02",
1916
"url_suffix": "x86_64-macos.tar.gz"
@@ -29,16 +26,16 @@
2926
"linux_arm64": {
3027
"sha256": "54bb0fdad016a115bde8dd7d2cd63e88d0b136a44ab23ae9c3ff4d4d48d5fa4d",
3128
"url_suffix": "aarch64-linux.tar.gz"
32-
},
33-
"windows_amd64": {
34-
"sha256": "039b1eaa170563f762355a23c5ee709790199433e35e5364008521523e9e3398",
35-
"url_suffix": "x86_64-windows.zip"
3629
}
3730
}
3831
},
3932
"1.240.0": {
4033
"release_date": "2025-10-08",
4134
"platforms": {
35+
"linux_arm64": {
36+
"sha256": "e3d497196bf99a31a62c885d2f5c3aa1e4d4a6bc02c1bff735ffa6a4c7aa9c2f",
37+
"url_suffix": "aarch64-linux.tar.gz"
38+
},
4239
"darwin_amd64": {
4340
"sha256": "8959eb9f494af13868af9e13e74e4fa0fa6c9306b492a9ce80f0e576eb10c0c6",
4441
"url_suffix": "x86_64-macos.tar.gz"
@@ -51,10 +48,6 @@
5148
"sha256": "b6ad301b8ac65e283703d1a5cf79280058a5f5699f8ff1fcaf66dbcf80a9efae",
5249
"url_suffix": "x86_64-linux.tar.gz"
5350
},
54-
"linux_arm64": {
55-
"sha256": "e3d497196bf99a31a62c885d2f5c3aa1e4d4a6bc02c1bff735ffa6a4c7aa9c2f",
56-
"url_suffix": "aarch64-linux.tar.gz"
57-
},
5851
"windows_amd64": {
5952
"sha256": "81f012832e80fe09d384d86bb961d4779f6372a35fa965cc64efe318001ab27e",
6053
"url_suffix": "x86_64-windows.zip"
@@ -72,19 +65,22 @@
7265
"sha256": "96dbe14cde4a1e48781af959b623e045a2cab106756476039309f8e6266906a3",
7366
"url_suffix": "aarch64-macos.tar.gz"
7467
},
75-
"linux_amd64": {
76-
"sha256": "5ead4459eef50f4b83b47151332f22e4bcfea9c1917e816273b807b2d6567199",
77-
"url_suffix": "x86_64-linux.tar.gz"
78-
},
7968
"linux_arm64": {
8069
"sha256": "abc5a70c5cade497805998fd0b5cd545df9b484c62f16d33dd6a4cad135302aa",
8170
"url_suffix": "aarch64-linux.tar.gz"
8271
},
83-
"windows_amd64": {
84-
"sha256": "0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5",
85-
"url_suffix": "x86_64-windows.tar.gz"
72+
"linux_amd64": {
73+
"sha256": "5ead4459eef50f4b83b47151332f22e4bcfea9c1917e816273b807b2d6567199",
74+
"url_suffix": "x86_64-linux.tar.gz"
8675
}
8776
}
8877
}
89-
}
90-
}
78+
},
79+
"supported_platforms": [
80+
"darwin_amd64",
81+
"darwin_arm64",
82+
"linux_amd64",
83+
"linux_arm64",
84+
"windows_amd64"
85+
]
86+
}

tools/checksum_updater/src/checksum_manager.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,14 @@ impl ChecksumManager {
246246
String::new()
247247
};
248248

249-
// Find the hardcoded data section
250-
let start_marker = "hardcoded_data = {";
251-
let end_marker = " return hardcoded_data.get(tool_name, {})";
249+
// Find the fallback data section
250+
let start_marker = "fallback_data = {";
251+
let end_marker = " return fallback_data.get(tool_name, {})";
252252

253253
if let Some(start_pos) = content.find(start_marker) {
254254
if let Some(end_pos) = content.find(end_marker) {
255-
// Generate new hardcoded data
256-
let new_data = self.generate_hardcoded_data().await?;
255+
// Generate new fallback data
256+
let new_data = self.generate_fallback_data().await?;
257257

258258
// Replace the section
259259
let before = &content[..start_pos];
@@ -262,16 +262,18 @@ impl ChecksumManager {
262262

263263
fs::write(&registry_path, new_content).await?;
264264
info!("Updated registry.bzl with latest tool data");
265+
} else {
266+
warn!("Could not find end marker in registry.bzl");
265267
}
266268
} else {
267-
warn!("Could not find hardcoded data section in registry.bzl");
269+
warn!("Could not find fallback data section in registry.bzl");
268270
}
269271

270272
Ok(())
271273
}
272274

273-
/// Generate hardcoded data for registry.bzl
274-
async fn generate_hardcoded_data(&self) -> Result<String> {
275+
/// Generate fallback data for registry.bzl
276+
async fn generate_fallback_data(&self) -> Result<String> {
275277
let tools = self.list_all_tools().await?;
276278
let mut data_entries = Vec::new();
277279

@@ -282,7 +284,7 @@ impl ChecksumManager {
282284
}
283285

284286
Ok(format!(
285-
"hardcoded_data = {{\n{}\n }}",
287+
"fallback_data = {{\n{}\n }}",
286288
data_entries.join(",\n")
287289
))
288290
}

tools/checksum_updater/src/tool_config.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pub struct ToolConfigEntry {
1717
pub github_repo: String,
1818
pub platforms: Vec<String>,
1919
pub url_pattern: UrlPattern,
20+
/// Prefix to strip from GitHub release tag names (e.g., "v" for "v1.0.0", "wasi-sdk-" for "wasi-sdk-29")
21+
pub tag_prefix: Option<String>,
2022
}
2123

2224
/// URL pattern for downloading tool releases
@@ -71,6 +73,7 @@ impl ToolConfig {
7173
map
7274
},
7375
},
76+
tag_prefix: Some("v".to_string()),
7477
},
7578
);
7679

@@ -97,6 +100,7 @@ impl ToolConfig {
97100
map
98101
},
99102
},
103+
tag_prefix: Some("v".to_string()),
100104
},
101105
);
102106

@@ -138,6 +142,7 @@ impl ToolConfig {
138142
map
139143
},
140144
},
145+
tag_prefix: Some("v".to_string()),
141146
},
142147
);
143148

@@ -165,6 +170,7 @@ impl ToolConfig {
165170
map
166171
},
167172
},
173+
tag_prefix: Some("v".to_string()),
168174
},
169175
);
170176

@@ -179,6 +185,7 @@ impl ToolConfig {
179185
"linux_amd64".to_string(),
180186
"linux_arm64".to_string(),
181187
"windows_amd64".to_string(),
188+
"windows_arm64".to_string(),
182189
],
183190
url_pattern: UrlPattern::Custom {
184191
pattern: "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-{version}/wasi-sdk-{version}.0-{platform}.tar.gz".to_string(),
@@ -187,11 +194,13 @@ impl ToolConfig {
187194
map.insert("darwin_amd64".to_string(), "x86_64-macos".to_string());
188195
map.insert("darwin_arm64".to_string(), "arm64-macos".to_string());
189196
map.insert("linux_amd64".to_string(), "x86_64-linux".to_string());
190-
map.insert("linux_arm64".to_string(), "x86_64-linux".to_string()); // Note: same as amd64
197+
map.insert("linux_arm64".to_string(), "arm64-linux".to_string());
191198
map.insert("windows_amd64".to_string(), "x86_64-windows".to_string());
199+
map.insert("windows_arm64".to_string(), "arm64-windows".to_string());
192200
map
193201
},
194202
},
203+
tag_prefix: Some("wasi-sdk-".to_string()),
195204
},
196205
);
197206

@@ -232,6 +241,7 @@ impl ToolConfig {
232241
map
233242
},
234243
},
244+
tag_prefix: Some("v".to_string()),
235245
}
236246
}
237247
}

tools/checksum_updater/src/update_engine.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,15 @@ impl UpdateEngine {
184184
summary.tools_processed, summary.tools_updated, summary.errors, summary.duration
185185
);
186186

187+
// Regenerate registry.bzl if we actually made updates (not dry-run)
188+
if !config.dry_run && !updates.is_empty() {
189+
info!("Regenerating registry.bzl with updated checksums");
190+
self.manager
191+
.update_registry_bzl()
192+
.await
193+
.context("Failed to update registry.bzl")?;
194+
}
195+
187196
Ok(UpdateResults {
188197
summary,
189198
updates,
@@ -237,7 +246,12 @@ impl UpdateEngine {
237246
.await
238247
.with_context(|| format!("Failed to get latest release for {}", tool_name))?;
239248

240-
let latest_version = latest_release.tag_name.trim_start_matches('v');
249+
// Strip tool-specific tag prefix from version
250+
let latest_version = if let Some(prefix) = &tool_config.tag_prefix {
251+
latest_release.tag_name.trim_start_matches(prefix.as_str())
252+
} else {
253+
latest_release.tag_name.trim_start_matches('v')
254+
};
241255

242256
// Check if update is needed
243257
if !config.force && latest_version == current_tool_info.latest_version {

0 commit comments

Comments
 (0)