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

simapp does not support M1 #557

Closed
4 tasks
ulbqb opened this issue Jun 8, 2022 · 3 comments · Fixed by #591
Closed
4 tasks

simapp does not support M1 #557

ulbqb opened this issue Jun 8, 2022 · 3 comments · Fixed by #591

Comments

@ulbqb
Copy link
Member

ulbqb commented Jun 8, 2022

Summary of Bug

I'm developing using M1 mac.
I can't build simapp with docker.

Version

ac918ac

Steps to Reproduce

❯ docker build --no-cache -t simapp .
[+] Building 30.3s (13/14)                                                                                                              
 => [internal] load build definition from Dockerfile                                                                               0.0s
 => => transferring dockerfile: 37B                                                                                                0.0s
 => [internal] load .dockerignore                                                                                                  0.0s
 => => transferring context: 34B                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/alpine:edge                                                                     2.0s
 => [internal] load metadata for docker.io/library/golang:alpine                                                                   0.0s
 => CACHED [build-env 1/5] FROM docker.io/library/golang:alpine                                                                    0.0s
 => [internal] load build context                                                                                                  0.8s
 => => transferring context: 753.83kB                                                                                              0.8s
 => CACHED [stage-1 1/4] FROM docker.io/library/alpine:edge@sha256:c8420124adc6f31031a88c85f53e1e78f419b1ac46b827fd1d4d0fdae2c7e3  0.0s
 => [stage-1 2/4] RUN apk add --update ca-certificates                                                                             1.8s
 => [build-env 2/5] RUN apk add --no-cache curl make git libc-dev bash gcc g++ linux-headers eudev-dev python3                     4.9s
 => [stage-1 3/4] WORKDIR /root                                                                                                    0.0s
 => [build-env 3/5] WORKDIR /go/src/github.com/line/lbm-sdk                                                                        0.0s
 => [build-env 4/5] COPY . .                                                                                                       0.7s
 => ERROR [build-env 5/5] RUN make build-linux                                                                                    22.6s 
------                                                                                                                                  
 > [build-env 5/5] RUN make build-linux:                                                                                                
#13 0.203 GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false make build                                                                       
#13 0.204 make[1]: Entering directory '/go/src/github.com/line/lbm-sdk'                                                                 
#13 0.212 mkdir -p /go/src/github.com/line/lbm-sdk/build/                                                                               
#13 0.214 go build -mod=readonly -tags "netgo goleveldb" -ldflags '-X github.com/line/lbm-sdk/version.Name=sim -X github.com/line/lbm-sdk/version.AppName=simd -X github.com/line/lbm-sdk/version.Version=0.46.0-rc2 -X github.com/line/lbm-sdk/version.Commit=ac918acc77d77d934e4dff134dcc53b9f83e3370 -X github.com/line/lbm-sdk/types.DBBackend=goleveldb -X "github.com/line/lbm-sdk/version.BuildTags=netgo goleveldb," -w -s' -trimpath -o /go/src/github.com/line/lbm-sdk/build/ ./...
#13 3.774 go: downloading github.com/spf13/cobra v1.4.0
#13 3.775 go: downloading github.com/line/ostracon v1.0.5
#13 3.775 go: downloading github.com/spf13/viper v1.11.0
#13 3.777 go: downloading github.com/rakyll/statik v0.1.7
#13 3.819 go: downloading github.com/regen-network/protobuf v1.3.3-alpha.regen.1
#13 3.832 go: downloading github.com/golang/protobuf v1.5.2
#13 3.912 go: downloading github.com/grpc-ecosystem/grpc-gateway v1.16.0
#13 4.055 go: downloading google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac
#13 4.083 go: downloading google.golang.org/grpc v1.33.2
#13 4.249 go: downloading github.com/bgentry/speakeasy v0.1.0
#13 4.250 go: downloading github.com/mattn/go-isatty v0.0.14
#13 4.251 go: downloading github.com/gorilla/mux v1.8.0
#13 4.255 go: downloading github.com/spf13/pflag v1.0.5
#13 4.266 go: downloading github.com/pkg/errors v0.9.1
#13 4.266 go: downloading gopkg.in/yaml.v2 v2.4.0
#13 4.271 go: downloading google.golang.org/protobuf v1.28.0
#13 4.285 go: downloading github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
#13 4.290 go: downloading github.com/tendermint/go-amino v0.16.0
#13 4.290 go: downloading github.com/cosmos/go-bip39 v1.0.0
#13 4.358 go: downloading github.com/btcsuite/btcd v0.22.1
#13 4.371 go: downloading github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3
#13 4.409 go: downloading github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76
#13 4.465 go: downloading golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
#13 4.487 go: downloading github.com/tendermint/btcd v0.1.1
#13 4.522 go: downloading github.com/gogo/gateway v1.1.0
#13 4.626 go: downloading github.com/gorilla/handlers v1.5.1
#13 4.674 go: downloading github.com/rs/zerolog v1.26.1
#13 4.709 go: downloading github.com/improbable-eng/grpc-web v0.15.0
#13 4.757 go: downloading github.com/confio/ics23/go v0.7.0
#13 4.773 go: downloading github.com/regen-network/cosmos-proto v0.3.1
#13 4.795 go: downloading github.com/line/tm-db/v2 v2.0.0-init.1.0.20220121012851-61d2bc1d9486
#13 4.797 go: downloading github.com/spf13/cast v1.5.0
#13 4.820 go: downloading github.com/coinbase/rosetta-sdk-go v0.7.9
#13 4.875 go: downloading github.com/stretchr/testify v1.7.1
#13 4.908 go: downloading github.com/VictoriaMetrics/fastcache v1.10.0
#13 4.910 go: downloading github.com/go-kit/kit v0.12.0
#13 4.923 go: downloading github.com/prometheus/client_golang v1.12.1
#13 4.977 go: downloading github.com/coocood/freecache v1.2.1
#13 4.982 go: downloading github.com/dgraph-io/ristretto v0.1.0
#13 4.982 go: downloading github.com/line/iavl/v2 v2.0.0-init.1.0.20220215225951-cb11c91d8857
#13 4.992 go: downloading github.com/golang/mock v1.6.0
#13 5.004 go: downloading github.com/armon/go-metrics v0.3.11
#13 5.035 go: downloading github.com/prometheus/common v0.34.0
#13 5.045 go: downloading github.com/cosmos/btcutil v1.0.4
#13 5.047 go: downloading github.com/mailru/easyjson v0.7.7
#13 5.084 go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
#13 5.086 go: downloading github.com/line/wasmvm v0.16.3-0.9.0
#13 5.133 go: downloading github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa
#13 5.158 go: downloading github.com/fsnotify/fsnotify v1.5.1
#13 5.188 go: downloading github.com/mitchellh/mapstructure v1.4.3
#13 5.340 go: downloading github.com/spf13/afero v1.8.2
#13 5.341 go: downloading github.com/spf13/jwalterweatherman v1.1.0
#13 5.597 go: downloading golang.org/x/net v0.0.0-20220412020605-290c469a71a5
#13 5.808 go: downloading golang.org/x/sys v0.0.0-20220412211240-33da011f77ad
#13 5.986 go: downloading github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d
#13 6.003 go: downloading github.com/davecgh/go-spew v1.1.1
#13 6.025 go: downloading filippo.io/edwards25519 v1.0.0-rc.1
#13 6.049 go: downloading github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b
#13 6.078 go: downloading github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2
#13 6.105 go: downloading github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c
#13 6.116 go: downloading github.com/mtibben/percent v0.2.1
#13 6.126 go: downloading github.com/go-kit/log v0.2.0
#13 6.145 go: downloading github.com/go-logfmt/logfmt v0.5.1
#13 6.155 go: downloading github.com/gorilla/websocket v1.5.0
#13 6.156 go: downloading github.com/felixge/httpsnoop v1.0.1
#13 6.157 go: downloading github.com/lib/pq v1.10.5
#13 6.160 go: downloading github.com/rs/cors v1.8.2
#13 6.162 go: downloading github.com/cenkalti/backoff/v4 v4.1.1
#13 6.173 go: downloading github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f
#13 6.179 go: downloading github.com/cenkalti/backoff v2.2.1+incompatible
#13 6.179 go: downloading nhooyr.io/websocket v1.8.6
#13 6.179 go: downloading github.com/google/btree v1.0.0
#13 6.186 go: downloading github.com/cespare/xxhash/v2 v2.1.2
#13 6.189 go: downloading github.com/golang/snappy v0.0.4
#13 6.193 go: downloading github.com/beorn7/perks v1.0.1
#13 6.193 go: downloading github.com/prometheus/client_model v0.2.0
#13 6.199 go: downloading github.com/cespare/xxhash v1.1.0
#13 6.203 go: downloading github.com/prometheus/procfs v0.7.3
#13 6.207 go: downloading github.com/hashicorp/go-immutable-radix v1.3.1
#13 6.208 go: downloading github.com/josharian/intern v1.0.0
#13 6.209 go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
#13 6.213 go: downloading github.com/subosito/gotenv v1.2.0
#13 6.223 go: downloading github.com/hashicorp/hcl v1.0.0
#13 6.230 go: downloading gopkg.in/ini.v1 v1.66.4
#13 6.232 go: downloading github.com/magiconair/properties v1.8.6
#13 6.252 go: downloading github.com/pelletier/go-toml v1.9.4
#13 6.257 go: downloading golang.org/x/text v0.3.7
#13 6.261 go: downloading github.com/herumi/bls-eth-go-binary v0.0.0-20200923072303-32b29e5d8cbf
#13 6.261 go: downloading github.com/gtank/merlin v0.1.1
#13 6.277 go: downloading github.com/libp2p/go-buffer-pool v0.0.2
#13 6.292 go: downloading github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
#13 6.365 go: downloading github.com/gtank/ristretto255 v0.1.2
#13 6.377 go: downloading golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
#13 6.463 go: downloading github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
#13 6.647 go: downloading github.com/Workiva/go-datastructures v1.0.52
#13 6.647 go: downloading github.com/minio/highwayhash v1.0.2
#13 6.718 go: downloading github.com/google/orderedcode v0.0.1
#13 6.735 go: downloading github.com/pmezard/go-difflib v1.0.0
#13 6.748 go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
#13 6.750 go: downloading github.com/klauspost/compress v1.13.6
#13 6.771 go: downloading github.com/dustin/go-humanize v1.0.0
#13 6.786 go: downloading github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
#13 6.798 go: downloading github.com/r2ishiguro/vrf v0.0.0-20180716233122-192de52975eb
#13 6.863 go: downloading github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
#13 6.877 go: downloading github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643
#13 8.408 # github.com/herumi/bls-eth-go-binary/bls
#13 8.408 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:9:28: undefined: SecretKey
#13 8.408 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:9:40: undefined: Fr
#13 8.408 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:13:26: undefined: Fr
#13 8.408 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:13:31: undefined: SecretKey
#13 8.408 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:19:28: undefined: PublicKey
#13 8.408 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:19:40: undefined: G1
#13 8.408 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:23:26: undefined: G1
#13 8.408 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:23:31: undefined: PublicKey
#13 8.408 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:23: undefined: Sign
#13 8.408 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:30: undefined: G2
#13 8.408 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:30: too many errors
#13 22.49 make[1]: *** [Makefile:120: build] Error 2
#13 22.49 make: *** [Makefile:117: build-linux] Error 2
#13 22.49 make[1]: Leaving directory '/go/src/github.com/line/lbm-sdk'
------
executor failed running [/bin/sh -c make build-linux]: exit code: 2

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ulbqb
Copy link
Member Author

ulbqb commented Jun 8, 2022

Duplicate of #524 ?

@ulbqb
Copy link
Member Author

ulbqb commented Jun 8, 2022

Now I am running simapp with M1 with the following changes.

diff --git a/Dockerfile b/Dockerfile
index b35e290fb..6bc3a0c2c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -30,7 +30,7 @@ RUN make build-linux
 FROM alpine:edge
 
 # Install ca-certificates
-RUN apk add --update ca-certificates
+RUN apk add --update ca-certificates libstdc++ 
 WORKDIR /root
 
 # Copy over binaries from the build-env
diff --git a/Makefile b/Makefile
index fe874d60e..eaffb177d 100644
--- a/Makefile
+++ b/Makefile
@@ -114,7 +114,7 @@ BUILD_TARGETS := build install
 
 build: BUILD_ARGS=-o $(BUILDDIR)/
 build-linux:
-       GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false $(MAKE) build
+       GOOS=linux GOARCH=arm64 LEDGER_ENABLED=false $(MAKE) build
 
 $(BUILD_TARGETS): go.sum $(BUILDDIR)/
        go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./...
diff --git a/go.mod b/go.mod
index 796e5ecda..54c57edda 100644
--- a/go.mod
+++ b/go.mod
@@ -62,5 +62,6 @@ require (
 replace (
        github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76
        github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
+       github.com/herumi/bls-eth-go-binary => github.com/herumi/bls-eth-go-binary v0.0.0-20220509081320-2d8ab06de53c
        google.golang.org/grpc => google.golang.org/grpc v1.33.2
 )
diff --git a/go.sum b/go.sum
index 16af642a2..652db8a7c 100644
--- a/go.sum
+++ b/go.sum
@@ -598,8 +598,8 @@ github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpT
 github.com/hdevalence/ed25519consensus v0.0.0-20200813231810-1694d75e712a/go.mod h1:V0zo781scjlo5OzNQb2GI8wMt6CD4vs7y1beXtxZEhM=
 github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU=
 github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE=
-github.com/herumi/bls-eth-go-binary v0.0.0-20200923072303-32b29e5d8cbf h1:Lw7EOMVxu3O+7Ro5bqn9M20a7GwuCqZQsmdXNzmcKE4=
-github.com/herumi/bls-eth-go-binary v0.0.0-20200923072303-32b29e5d8cbf/go.mod h1:luAnRm3OsMQeokhGzpYmc0ZKwawY7o87PUEP11Z7r7U=
+github.com/herumi/bls-eth-go-binary v0.0.0-20220509081320-2d8ab06de53c h1:ppGSVyhAFh8VAGyDuNeLEGMYRJR5iDI92QgDNrMIqK0=
+github.com/herumi/bls-eth-go-binary v0.0.0-20220509081320-2d8ab06de53c/go.mod h1:luAnRm3OsMQeokhGzpYmc0ZKwawY7o87PUEP11Z7r7U=
 github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
 github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=

@ulbqb
Copy link
Member Author

ulbqb commented Jun 20, 2022

If you want to build lbm-sdk for amd64 on M1 mac, you need to fix and run as follows.

diff

diff --git a/Dockerfile b/Dockerfile
index b35e290fb..6bc3a0c2c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -30,7 +30,7 @@ RUN make build-linux
 FROM alpine:edge
 
 # Install ca-certificates
-RUN apk add --update ca-certificates
+RUN apk add --update ca-certificates libstdc++ 
 WORKDIR /root
 
 # Copy over binaries from the build-env
diff --git a/go.mod b/go.mod
index 796e5ecda..54c57edda 100644
--- a/go.mod
+++ b/go.mod
@@ -62,5 +62,6 @@ require (
 replace (
        github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76
        github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
+       github.com/herumi/bls-eth-go-binary => github.com/herumi/bls-eth-go-binary v0.0.0-20220509081320-2d8ab06de53c
        google.golang.org/grpc => google.golang.org/grpc v1.33.2
 )
diff --git a/go.sum b/go.sum
index 16af642a2..652db8a7c 100644
--- a/go.sum
+++ b/go.sum
@@ -598,8 +598,8 @@ github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpT
 github.com/hdevalence/ed25519consensus v0.0.0-20200813231810-1694d75e712a/go.mod h1:V0zo781scjlo5OzNQb2GI8wMt6CD4vs7y1beXtxZEhM=
 github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU=
 github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE=
-github.com/herumi/bls-eth-go-binary v0.0.0-20200923072303-32b29e5d8cbf h1:Lw7EOMVxu3O+7Ro5bqn9M20a7GwuCqZQsmdXNzmcKE4=
-github.com/herumi/bls-eth-go-binary v0.0.0-20200923072303-32b29e5d8cbf/go.mod h1:luAnRm3OsMQeokhGzpYmc0ZKwawY7o87PUEP11Z7r7U=
+github.com/herumi/bls-eth-go-binary v0.0.0-20220509081320-2d8ab06de53c h1:ppGSVyhAFh8VAGyDuNeLEGMYRJR5iDI92QgDNrMIqK0=
+github.com/herumi/bls-eth-go-binary v0.0.0-20220509081320-2d8ab06de53c/go.mod h1:luAnRm3OsMQeokhGzpYmc0ZKwawY7o87PUEP11Z7r7U=
 github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
 github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=

build

$ docker build --platform="linux/amd64" --no-cache -t simapp .

run

$ docker run --platform="linux/amd64" -it simapp sh

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

Successfully merging a pull request may close this issue.

1 participant