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

FIX: Error building linux releases #4360

Closed
RaulBernal opened this issue Sep 16, 2024 · 8 comments
Closed

FIX: Error building linux releases #4360

RaulBernal opened this issue Sep 16, 2024 · 8 comments
Labels
type:bug Something isn't working

Comments

@RaulBernal
Copy link
Contributor

Building a linux:amd64 or linux:arm64 releases I get this error:

Error while running command go build -o /var/folders/mj/q70cn61527993k8jyp54h0qr0000gn/T/2824382528/bcnad -mod readonly -tags  -ldflags -X github.com/cosmos/cosmos-sdk/version.Name=Bcna -X github.com/cosmos/cosmos-sdk/version.AppName=bcnad -X github.com/cosmos/cosmos-sdk/version.Version=4.0.0-rc3 -X github.com/cosmos/cosmos-sdk/version.Commit=7ddd08a48759a2837a5d1b05247d172c7a6ca38e -X github.com/cosmos/cosmos-sdk/version.BuildTags= -X github.com/BitCannaGlobal/bcna/cmd/bcnad/cmd.ChainID=bcna .: # github.com/CosmWasm/wasmd/x/wasm/keeper
/Users/raul/go/pkg/mod/github.com/!cosm!wasm/wasmd@v0.53.0/x/wasm/keeper/test_common.go:386:3: cannot use runtime.NewKVStoreService(keys[types.StoreKey]) (value of type "cosmossdk.io/core/store".KVStoreService) as "cosmossdk.io/store/types".StoreKey value in argument to NewKeeper: "cosmossdk.io/core/store".KVStoreService does not implement "cosmossdk.io/store/types".StoreKey (missing method Name)                                                                                                                                               
/Users/raul/go/pkg/mod/github.com/!cosm!wasm/wasmd@v0.53.0/x/wasm/keeper/test_common.go:400:3: cannot use availableCapabilities (variable of type []string) as string value in argument to NewKeeper                                                                                                                                                                                                                                                                                                                                                          
: exit status 1   

If I replace the arch by my own computer it success:
image

The error we're facing is due to a type conflict between two dependencies of the Cosmos SDK, specifically between cosmossdk.io/core/store and cosmossdk.io/store/types. It seems that there are changes in the KVStoreService API that are not compatible with the code we're using.

Context:

This happened me when I scaffold a v0.50 chain with last version of Ignite, add WASM module (I didn't try without it) and try to build the linux/amd64 release.
I'm running a darwin/arm64 computer (M1)

Describe the Bug:

Ignite build command doesn't produce a linux release from a darwin/arm64 arch.

Steps to Reproduce:

  1. Scaffold a demo chain
  2. Add wasm module
  3. Run: ignite chain build --release -t amd:arm64 from an Apple M1 computer

Environment Details:

  • **OS:**M1 Darwin Kernel Version 23.4.0
  • Ignite Version: v28.5.1
  • Go Version: go version go1.23.1 darwin/arm64

Notes:

@RaulBernal RaulBernal added the type:bug Something isn't working label Sep 16, 2024
@RaulBernal
Copy link
Contributor Author

This is the output from a Linux/AMD64 arch running Ignite v28.3.0

CLI version:               v28.3.0
Ignite CLI build date:          2024-03-20T15:31:07Z
Ignite CLI source hash:         159abdca88605ed82cb4aabd52618db91069b7af
Ignite CLI config version:      v1
Cosmos SDK version:             v0.50.5
Your OS:                        linux
Your arch:                      amd64
Your Node.js version:           v18.17.1
Your go version:                go version go1.23.1 linux/amd64
Your uname -a:                  Linux daemon 5.15.0-119-generic #129-Ubuntu SMP Fri Aug 2 19:25:20 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • Building releases for darwin:arm64
ignite chain build --release -t linux:amd64 -t darwin:arm64
Cosmos SDK's version is: v0.50.10Error while running command go build -o /tmp/341455175/bcnad -mod readonly -tags  -ldflags -X github.com/cosmos/cosmos-sdk/version.Name=Bcna -X github.com/cosmos/cosmos-sdk/version.AppName=bcnad -X github.com/cosmos/cosmos-sdk/version.Version=4.0.0-rc3-547d65c0 -X github.com/cosmos/cosmos-sdk/version.Commit=547d65c08feb679caecd70f148fdfdf234afa96d -X github.com/cosmos/cosmos-sdk/version.BuildTags= -X github.com/BitCannaGlobal/bcna/cmd/bcnad/cmd.ChainID=bcna .: # github.com/CosmWasm/wasmd/x/wasm/keeper
/home/linux/go/pkg/mod/github.com/!cosm!wasm/wasmd@v0.53.0/x/wasm/keeper/test_common.go:386:3: cannot use runtime.NewKVStoreService(keys[types.StoreKey]) (value of type "cosmossdk.io/core/store".KVStoreService) as "cosmossdk.io/store/types".StoreKey value in argument to NewKeeper: "cosmossdk.io/core/store".KVStoreService does not implement "cosmossdk.io/store/types".StoreKey (missing method Name)                                                                                                           
/home/linux/go/pkg/mod/github.com/!cosm!wasm/wasmd@v0.53.0/x/wasm/keeper/test_common.go:400:3: cannot use availableCapabilities (variable of type []string) as string value in argument to NewKeeper                                                                                                                                                                                                                                                                                                                      
: exit status 1  

@RaulBernal
Copy link
Contributor Author

For more context, if I only build a release for the same arch, in this sample for Linux/AMD64 the action works. So the problem is related with the cross compilation IMO.

With Ignite v28.3.0 in Linux AMD64

ignite chain build --release -t linux:amd64
Cosmos SDK's version is: v0.50.10

🗃  Release created: /home/linux/SDK/bcnad_v47/bcna/release

@RaulBernal
Copy link
Contributor Author

💡 As a new feature for include in the future, the ignite chain build --release ..... could include a flag for to link statically the Cosmwasm Libs for each architecture

@faddat
Copy link
Contributor

faddat commented Oct 1, 2024

I bet that the release binaries are cross compiled.

@julienrbrt
Copy link
Member

Could you try without wasm?

@RaulBernal
Copy link
Contributor Author

Could you try without wasm?

Tested, it works

ignite chain build --release -t linux:amd64 -t darwin:amd64 -t darwin:arm64
Cosmos SDK's version is: v0.50.3

Release created: /Users/xxxx/SDK/v0.50/bcna/release

And it produces 3 files:

ca2c75ff2d5f431e679d0841b3cc094ca7c7f906c9378b929d6153848c2f29cd  bcna_darwin_amd64.tar.gz
204da9fbbb9483d07eda446fa48755008b76443b22f3807a3b7ae035754dc94f  bcna_darwin_arm64.tar.gz
2a566aaadf348a123970ea3ac76a692467db2aaf38ad32956e49656a772b2237  bcna_linux_amd64.tar.gz

The issue may be related with WasmVM libs for each arch?
https://github.com/CosmWasm/wasmvm/releases/

@julienrbrt
Copy link
Member

Yes, you should contact them about that, as it isn't due to ignite (which just does a go build)

@julienrbrt julienrbrt closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2024
@RaulBernal
Copy link
Contributor Author

Yes, you should contact them about that, as it isn't due to ignite (which just does a go build)

Hi @julienrbrt
You're right, but this could be a nice feature to add via an Ignite reward perhaps.

For the history, I've solved using Dockerfile + updated Makefile + GitHub Actions here: https://github.com/BitCannaGlobal/bcna/pull/444/files
cc: @faddat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants