Skip to content

Commit 3af77b8

Browse files
authored
fix file reads; bump version to v0.3.2 (#49)
Reading from files via e.g. `os.ReadFile` was broken due to a bug in the `wasi_snapshot_preview1` adapter _and_ another bug in my patched version of Go. The following PR and commit fix those issues: - bytecodealliance/wasmtime#13111 - dicej/go@1f14282 I've updated the adapter using a build from bytecodealliance/wasmtime@d60f178 and pointed the Go URL to the new release URL. I've also updated the download directory to force a new download for users which may already have the old version. Finally, I've updated the Go wrapper to point to the `v0.3.2` release (which doesn't exist yet, but will soon). Previously, we were pointing to the `canary` release on the `main` branch, but it's annoying to switch back and forth when tagging releases, so let's just leave it set to whatever the latest release is for now.
1 parent 28105f4 commit 3af77b8

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ reqwest = { version = "0.13.1", features = ["blocking"] }
1919
tar = "0.4"
2020

2121
[workspace.package]
22-
version = "0.3.1"
22+
version = "0.3.2"
2323
edition = "2024"
2424

2525
[workspace.lints.clippy]

main.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ import (
2424
// Although `componentize-go` is written in Rust, we can use this wrapper to
2525
// make it available using e.g. `go install` and/or `go tool`.
2626
func main() {
27-
// This is hard-coded to point to the latest canary release, which is
28-
// appropriate for the `main` branch, but should be changed to the tag
29-
// name for each tagged release.
30-
//
31-
// TODO: Can we automate updating this for each release?
32-
release := "canary"
27+
release := "v0.3.2"
3328

3429
directories := userdirs.ForApp(
3530
"componentize-go",

src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ pub fn pick_go(resolve: &Resolve, world: WorldId, go_path: Option<&Path>) -> Res
420420
bad_arch => panic!("ARCH not supported: {bad_arch}"),
421421
};
422422

423-
let cache_dir = &cache_dir.join("componentize-go");
423+
let cache_dir = &cache_dir.join("componentize-go").join("v2");
424424
let name = &format!("go-{os}-{arch}-bootstrap");
425425
let dir = cache_dir.join(name);
426426
let bin = dir.join("bin").join("go");
@@ -433,7 +433,7 @@ pub fn pick_go(resolve: &Resolve, world: WorldId, go_path: Option<&Path>) -> Res
433433

434434
if !bin.exists() {
435435
let url = format!(
436-
"https://github.com/dicej/go/releases/download/go1.25.5-wasi-on-idle/{name}.tbz"
436+
"https://github.com/dicej/go/releases/download/go1.25.5-wasi-on-idle-v2/{name}.tbz"
437437
);
438438

439439
eprintln!("Downloading patched Go from {url}.");

src/wasi_snapshot_preview1.reactor.wasm

100644100755
2.27 KB
Binary file not shown.

0 commit comments

Comments
 (0)