Skip to content

Commit d450952

Browse files
2xburntclaude
andcommitted
fix(build): parse wasmvm version from go.mod instead of go list -m
The wasmvm download hook used `go list -m` to resolve the version, but this requires a populated Go module cache. When Docker layer cache is invalidated (e.g., by changes to goreleaser before hooks), the fresh build layer has no module cache, causing `go list -m` to fail silently and the wasmvm .a to never be downloaded. Replace with direct go.mod parsing via grep+cut which has no external dependencies and works reliably in all contexts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 211a1a0 commit d450952

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.goreleaser/build.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ builds:
3434
- cmd: mkdir -p {{ .Env.LIB_PATH }}
3535
# barretenberg-go v0.2.0+ includes lib/ directory in the module, so no download needed.
3636
# Download pre-built libwasmvm from CosmWasm releases.
37-
- cmd: sh -c '[ "{{ .Os }}" = "windows" ] || grep "github.com/CosmWasm/wasmvm" go.mod | cut -d " " -f 1 | xargs -I {} go list -m {} | cut -d " " -f 2 | xargs -I {} wget https://github.com/CosmWasm/wasmvm/releases/download/{}/{{ .Env.WASM_LIB }} -O {{ .Env.LIB_PATH }}/{{ .Env.WASM_LIB}}'
37+
# Parse wasmvm version directly from go.mod (avoids go list -m which
38+
# needs a populated module cache and fails in fresh Docker layers).
39+
- cmd: sh -c '[ "{{ .Os }}" = "windows" ] || WASMVM_VERSION=$(grep "github.com/CosmWasm/wasmvm" go.mod | cut -d " " -f 2) && wget -q https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/{{ .Env.WASM_LIB }} -O {{ .Env.LIB_PATH }}/{{ .Env.WASM_LIB }}'
3840
- cmd: echo Starting build...
3941
ldflags:
4042
- -X main.Date={{ .CommitDate }}

0 commit comments

Comments
 (0)