strangelove-ventures / heighliner

Repository of docker images for the node software of Cosmos chains
Apache License 2.0
57 stars 47 forks source link

CosmWasm v2 `go.mod` package syntax should not break `libwasmvm_muslc.a` file download #253

Closed pharr117 closed 2 months ago

pharr117 commented 3 months ago

We provide the wasm vm repo to the build dockerfiles by pulling the wasm version from the chain's go.mod file.

CosmWasm v2 package syntax contains the v2 (which is valid go packaging syntax), see the below link for latest Neutron as an example:

https://github.com/neutron-org/neutron/blob/329dcfed29fbef9a6b9db9920f430eb48b2d5cb1/go.mod#L17C2-L17C38

Heighliner parses thhis and reports the following:

WasmVM from go.mod: repo: github.com/CosmWasm/wasmvm/v2, version: v2.0.0

This is not a valid URL to the CosmWasm repo, the v2 needs to be removed. This leads to failure during dockerfile build like:

 ---> Running in f3e3ce4847a9
+ uname -m
+ export 'ARCH=x86_64'
+ '[' '!' -z 'github.com/CosmWasm/wasmvm/v2 v2.0.0' ]
+ echo github.com/CosmWasm/wasmvm/v2 v2.0.0
+ awk '{print $1}'
+ WASMVM_REPO=github.com/CosmWasm/wasmvm/v2
+ echo github.com/CosmWasm/wasmvm/v2 v2.0.0
+ awk '{print $2}'
+ WASMVM_VERS=v2.0.0
+ uname -m
+ wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/v2/releases/download/v2.0.0/libwasmvm_muslc.x86_64.a
Connecting to github.com (140.82.112.3:443)
wget: server returned error: HTTP/1.1 404 Not Found

We will need to build an alternate CosmWasm v2 URL parser here:

https://github.com/strangelove-ventures/heighliner/blob/b0b2781e574e8c1a0a593848d063963d118ea97c/builder/builder.go#L245-L246