Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provenance and cosmwasm v2.1.0 #258

Open
PFC-developer opened this issue Jul 23, 2024 · 4 comments
Open

provenance and cosmwasm v2.1.0 #258

PFC-developer opened this issue Jul 23, 2024 · 4 comments

Comments

@PFC-developer
Copy link
Contributor

for the following chain data

# Provenance
- name: provenance
  github-organization: provenance-io
  github-repo: provenance
  dockerfile: cosmos
  build-target: make install
  binaries:
    - /go/bin/provenanced
  build-env:
    - WITH_LEDGER=false
    - WITH_CLEVELDB=false
    - BUILD_TAGS=muslc musl dynamic

and building via

./heighliner build --no-cache --no-build-cache --chain provenance --git-ref v1.19.0

it's go.mod contains

github.com/CosmWasm/wasmvm/v2 v2.1.0
which should generate a wget to
https://github.com/CosmWasm/wasmvm/releases/download/v2.1.0/libwasmvm_muslc.x86_64.a
but instead generates
https://github.com/CosmWasm/wasmvm/v2/releases/download/v2.1.0/libwasmvm_muslc.x86_64.a

I'm not raising a PR here, as I don't think this is the correct thing to do (but it appears to work)

diff --git a/builder/builder.go b/builder/builder.go
index c6b66e9..e7aebaa 100644
--- a/builder/builder.go
+++ b/builder/builder.go
@@ -255,6 +255,10 @@ func getWasmvmVersion(modFile *modfile.File) string {
                        wasmvmVersion = item.Syntax.Token[len(item.Syntax.Token)-1]
                }
        }
+       if (wasmvmVersion == "v2.1.0") {
+               fmt.Printf("WasmVM from go.mod: 2.1 hack applied\n")
+               wasmvmRepo = defaultWasmvmRepo
+       }

        fmt.Printf("WasmVM from go.mod: repo: %s, version: %s\n", wasmvmRepo, wasmvmVersion)

allows it to pass the download stage

@PFC-developer
Copy link
Contributor Author

for the 2nd part it needed the following modifications

diff --git a/dockerfile/cosmos/native.Dockerfile b/dockerfile/cosmos/native.Dockerfile
index 96c1f26..aa7f08e 100644
--- a/dockerfile/cosmos/native.Dockerfile
+++ b/dockerfile/cosmos/native.Dockerfile
@@ -42,6 +42,9 @@ RUN set -eux;\
       WASMVM_REPO=$(echo $WASMVM_VERSION | awk '{print $1}');\
       WASMVM_VERS=$(echo $WASMVM_VERSION | awk '{print $2}');\
       wget -O /lib/libwasmvm_muslc.a https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/libwasmvm_muslc.$(uname -m).a;\
+      wget -O /lib/libwasmvm.so https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/libwasmvm.$(uname -m).so;\
+      wget -O /lib/libwasmvm_muslc.$(uname -m).a https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/libwasmvm_muslc.$(uname -m).a;\
+      wget -O /lib/libwasmvm.$(uname -m).so https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/libwasmvm.$(uname -m).so;\
     fi;\
     export CGO_ENABLED=1 LDFLAGS='-linkmode external -extldflags "-static"';\
     if [ ! -z "$PRE_BUILD" ]; then sh -c "${PRE_BUILD}"; fi;\

@ash-burnt
Copy link

The v2 issue should be solved, with v1.6.3

@PFC-developer
Copy link
Contributor Author

hi @ash-burnt .. this fix in #259 solves the first issue (which file to download).
but what we have found is that it attempting to link to the x86_64.a file, not the generic 'a' one.

@PFC-developer
Copy link
Contributor Author

I believe this also affects xion chain (as well as provenance) and can be reproduced quite easily by attempting to build either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants