status-im / status-go

The Status module that consumes go-ethereum
https://status.im
Mozilla Public License 2.0
728 stars 245 forks source link

Build staus-go on Ubuntu failed #4778

Closed kaichaosun closed 7 months ago

kaichaosun commented 7 months ago

Description: Build status-go failed on Ubuntu.

OS version:

NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Golang version: go version go1.20.13 linux/amd64

Steps to reproduce:

Error info:

go build -mod=vendor -v \
        -tags 'gowaku_no_rln' -ldflags=' -X github.com/status-im/status-go/params.Version=0.175.1 -X github.com/status-im/status-go/params.GitCommit=f2180423c -X github.com/status-im/status-go/params.IpfsGatewayURL=https://ipfs.status.im/ -X github.com/status-im/status-go/vendor/github.com/ethereum/go-ethereum/metrics.EnabledStr=true' \
        -o ./build/bin/statusd ./cmd/statusd
github.com/status-im/status-go/api/multiformat
github.com/status-im/status-go/protocol/identity
# github.com/status-im/status-go/protocol/identity
protocol/identity/utils.go:72:19: undefined: secp256k1.CompressPubkey
github.com/status-im/status-go/eth-node/crypto
# github.com/status-im/status-go/api/multiformat
api/multiformat/utils.go:134:19: undefined: secp256k1.CompressPubkey
api/multiformat/utils.go:186:20: undefined: secp256k1.DecompressPubkey
github.com/status-im/status-go/sqlite
# github.com/status-im/status-go/sqlite
sqlite/sqlite.go:171:22: conn.Exec undefined (type *sqlite3.SQLiteConn has no field or method Exec)
sqlite/sqlite.go:175:22: conn.Exec undefined (type *sqlite3.SQLiteConn has no field or method Exec)
sqlite/sqlite.go:183:22: conn.Exec undefined (type *sqlite3.SQLiteConn has no field or method Exec)
sqlite/sqlite.go:187:22: conn.Exec undefined (type *sqlite3.SQLiteConn has no field or method Exec)
sqlite/sqlite.go:192:22: conn.Exec undefined (type *sqlite3.SQLiteConn has no field or method Exec)
sqlite/sqlite.go:197:22: conn.Exec undefined (type *sqlite3.SQLiteConn has no field or method Exec)
sqlite/sqlite.go:202:22: conn.Exec undefined (type *sqlite3.SQLiteConn has no field or method Exec)
sqlite/sqlite.go:207:22: conn.Exec undefined (type *sqlite3.SQLiteConn has no field or method Exec)
# github.com/status-im/status-go/eth-node/crypto
eth-node/crypto/gethcrypto.go:206:19: undefined: secp256k1.RecoverPubkey
eth-node/crypto/gethcrypto.go:222:20: undefined: secp256k1.DecompressPubkey
eth-node/crypto/gethcrypto.go:231:19: undefined: secp256k1.CompressPubkey
github.com/waku-org/go-waku/waku/v2/protocol/relay
# github.com/waku-org/go-waku/waku/v2/protocol/relay
vendor/github.com/waku-org/go-waku/waku/v2/protocol/relay/validators.go:125:20: undefined: secp256k1.VerifySignature
vendor/github.com/waku-org/go-waku/waku/v2/protocol/relay/validators.go:132:25: undefined: secp256k1.Sign
make: *** [Makefile:92: build/bin/statusd] Error 1
kaichaosun commented 7 months ago

Temporary fix:

go env -w CGO_ENABLED=1
apt-get install build-essential