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

support arm64 golang on M1 mac #380

Closed
4 tasks
zemyblue opened this issue Mar 4, 2022 · 8 comments
Closed
4 tasks

support arm64 golang on M1 mac #380

zemyblue opened this issue Mar 4, 2022 · 8 comments
Assignees
Labels
C: enhancement Classification: New feature or its request, or improvement in maintainability of code Stale For github bot

Comments

@zemyblue
Copy link
Member

zemyblue commented Mar 4, 2022

Summary

The latest Ostracon version(v1.0.4) doesn't support arm64 build on M1 mac.
I found the problem is github.com/herumi/bls-eth-go-binary libray doesn't support.
Need to update the library at least 1.20+. (I think current bls-eth-go-binary version seems 1.12.)

Problem Definition

Proposal


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@torao torao added the C: enhancement Classification: New feature or its request, or improvement in maintainability of code label Mar 7, 2022
@tnasu
Copy link
Member

tnasu commented Mar 7, 2022

Thanks for your contribution.

The latest Ostracon version(v1.0.4) doesn't support arm64 build on M1 mac.

Please give us more information.

  • How to build? (What's the command?)
  • Are you fixed with upgrading bls-eth-go-binary in your local environment?

We've built the below for the arm64:

@zemyblue
Copy link
Member Author

zemyblue commented Mar 8, 2022

Thanks for your contribution.

The latest Ostracon version(v1.0.4) doesn't support arm64 build on M1 mac.

Please give us more information.

  • How to build? (What's the command?)
  • Are you fixed with upgrading bls-eth-go-binary in your local environment?

We've built the below for the arm64:

When I build docker image in lbm-sdk, the building is failed.
The build command and the result is below.

$ docker build -t line/lbm-simapp .
[+] Building 42.3s (15/16)                                                                                                                                           
 => [internal] load build definition from Dockerfile                                                                                                            0.0s
 => => transferring dockerfile: 1.45kB                                                                                                                          0.0s
 => [internal] load .dockerignore                                                                                                                               0.0s
 => => transferring context: 84B                                                                                                                                0.0s
 => [internal] load metadata for docker.io/library/alpine:edge                                                                                                  2.2s
 => [internal] load metadata for docker.io/library/golang:alpine                                                                                                2.2s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                                                   0.0s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                                                                   0.0s
 => [build-env 1/5] FROM docker.io/library/golang:alpine@sha256:b35984144ec2c2dfd6200e112a9b8ecec4a8fd9eff0babaff330f1f82f14cb2a                                0.0s
 => [stage-1 1/4] FROM docker.io/library/alpine:edge@sha256:1a4c2018cfbab67566904e18fde9bf6a5c190605bf7da0e1d181b26746a15188                                    0.0s
 => [internal] load build context                                                                                                                              14.1s
 => => transferring context: 521.75MB                                                                                                                          14.1s
 => CACHED [stage-1 2/4] RUN apk add --update ca-certificates                                                                                                   0.0s
 => CACHED [stage-1 3/4] WORKDIR /root                                                                                                                          0.0s
 => CACHED [build-env 2/5] RUN apk add --no-cache curl make git libc-dev bash gcc linux-headers eudev-dev python3                                               0.0s
 => CACHED [build-env 3/5] WORKDIR /go/src/github.com/line/lbm-sdk                                                                                              0.0s
 => [build-env 4/5] COPY . .                                                                                                                                    1.1s
 => ERROR [build-env 5/5] RUN make build-linux                                                                                                                 24.8s
------
 > [build-env 5/5] RUN make build-linux:
#14 0.195 GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false make build
#14 0.195 make[1]: Entering directory '/go/src/github.com/line/lbm-sdk'
#14 0.209 mkdir -p /go/src/github.com/line/lbm-sdk/build/
#14 0.210 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.45.0-rc0-1-g2ce2faa0b -X github.com/line/lbm-sdk/version.Commit=2ce2faa0be8194d860837ae9eff5a91edee8c354 -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/ ./...
#14 6.702 go: downloading github.com/line/ostracon v1.0.3
#14 6.702 go: downloading github.com/spf13/cobra v1.3.0
#14 6.705 go: downloading github.com/spf13/viper v1.10.1
#14 6.734 go: downloading github.com/rakyll/statik v0.1.7
#14 6.785 go: downloading github.com/regen-network/protobuf v1.3.3-alpha.regen.1
#14 7.063 go: downloading github.com/golang/protobuf v1.5.2
#14 7.095 go: downloading github.com/grpc-ecosystem/grpc-gateway v1.16.0
#14 7.178 go: downloading google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
#14 7.178 go: downloading google.golang.org/grpc v1.33.2
#14 7.328 go: downloading github.com/bgentry/speakeasy v0.1.0
#14 7.339 go: downloading github.com/mattn/go-isatty v0.0.14
#14 7.341 go: downloading github.com/pkg/errors v0.9.1
#14 7.341 go: downloading github.com/spf13/pflag v1.0.5
#14 7.351 go: downloading gopkg.in/yaml.v2 v2.4.0
#14 7.364 go: downloading github.com/gorilla/mux v1.8.0
#14 7.371 go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
#14 7.400 go: downloading github.com/line/iavl/v2 v2.0.0-init.1.0.20220215225951-cb11c91d8857
#14 7.400 go: downloading github.com/line/tm-db/v2 v2.0.0-init.1.0.20220121012851-61d2bc1d9486
#14 7.444 go: downloading google.golang.org/protobuf v1.27.1
#14 7.538 go: downloading github.com/tendermint/go-amino v0.16.0
#14 7.547 go: downloading github.com/cosmos/go-bip39 v1.0.0
#14 7.569 go: downloading github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
#14 7.633 go: downloading github.com/btcsuite/btcd v0.22.0-beta
#14 7.645 go: downloading github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76
#14 7.855 go: downloading golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e
#14 7.906 go: downloading github.com/tendermint/btcd v0.1.1
#14 8.136 go: downloading github.com/gogo/gateway v1.1.0
#14 8.234 go: downloading github.com/rs/zerolog v1.26.1
#14 8.271 go: downloading github.com/gorilla/handlers v1.5.1
#14 8.313 go: downloading github.com/spf13/cast v1.4.1
#14 8.319 go: downloading github.com/VictoriaMetrics/fastcache v1.9.0
#14 8.323 go: downloading github.com/go-kit/kit v0.10.0
#14 8.470 go: downloading github.com/prometheus/client_golang v1.12.1
#14 8.472 go: downloading github.com/stretchr/testify v1.7.0
#14 8.474 go: downloading github.com/confio/ics23/go v0.6.6
#14 8.493 go: downloading github.com/coocood/freecache v1.2.0
#14 8.549 go: downloading github.com/dgraph-io/ristretto v0.1.0
#14 8.567 go: downloading github.com/armon/go-metrics v0.3.10
#14 8.634 go: downloading github.com/prometheus/common v0.32.1
#14 8.651 go: downloading github.com/golang/mock v1.6.0
#14 8.651 go: downloading github.com/cosmos/btcutil v1.0.4
#14 8.666 go: downloading github.com/mailru/easyjson v0.7.7
#14 8.689 go: downloading github.com/regen-network/cosmos-proto v0.3.1
#14 8.751 go: downloading github.com/line/wasmvm v0.16.3-0.9.0
#14 8.760 go: downloading github.com/google/gofuzz v1.2.0
#14 8.792 go: downloading github.com/fsnotify/fsnotify v1.5.1
#14 8.805 go: downloading github.com/magiconair/properties v1.8.5
#14 8.820 go: downloading github.com/mitchellh/mapstructure v1.4.3
#14 8.992 go: downloading github.com/spf13/afero v1.6.0
#14 9.037 go: downloading github.com/spf13/jwalterweatherman v1.1.0
#14 9.052 go: downloading github.com/subosito/gotenv v1.2.0
#14 9.058 go: downloading gopkg.in/ini.v1 v1.66.2
#14 9.074 go: downloading golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d
#14 9.256 go: downloading github.com/go-logfmt/logfmt v0.5.0
#14 9.257 go: downloading golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a
#14 9.275 go: downloading github.com/davecgh/go-spew v1.1.1
#14 9.277 go: downloading github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d
#14 9.283 go: downloading github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b
#14 9.335 go: downloading github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2
#14 9.339 go: downloading github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c
#14 9.349 go: downloading github.com/mtibben/percent v0.2.1
#14 9.368 go: downloading github.com/felixge/httpsnoop v1.0.1
#14 9.380 go: downloading github.com/gorilla/websocket v1.4.2
#14 9.384 go: downloading github.com/rs/cors v1.7.0
#14 9.402 go: downloading github.com/cespare/xxhash/v2 v2.1.2
#14 9.407 go: downloading github.com/golang/snappy v0.0.4
#14 9.412 go: downloading github.com/cespare/xxhash v1.1.0
#14 9.424 go: downloading github.com/google/btree v1.0.0
#14 9.426 go: downloading github.com/beorn7/perks v1.0.1
#14 9.428 go: downloading github.com/prometheus/client_model v0.2.0
#14 9.435 go: downloading github.com/prometheus/procfs v0.7.3
#14 9.441 go: downloading github.com/hashicorp/go-immutable-radix v1.3.1
#14 9.443 go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
#14 9.450 go: downloading github.com/josharian/intern v1.0.0
#14 9.462 go: downloading github.com/hashicorp/hcl v1.0.0
#14 9.479 go: downloading github.com/pelletier/go-toml v1.9.4
#14 9.489 go: downloading golang.org/x/text v0.3.7
#14 9.503 go: downloading github.com/herumi/bls-eth-go-binary v0.0.0-20200923072303-32b29e5d8cbf
#14 9.661 go: downloading github.com/gtank/merlin v0.1.1
#14 9.748 go: downloading github.com/libp2p/go-buffer-pool v0.0.2
#14 9.875 go: downloading github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
#14 9.975 go: downloading github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca
#14 10.12 go: downloading github.com/gtank/ristretto255 v0.1.2
#14 10.14 go: downloading golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
#14 10.22 go: downloading github.com/Workiva/go-datastructures v1.0.52
#14 10.34 go: downloading github.com/minio/highwayhash v1.0.1
#14 10.40 go: downloading github.com/google/orderedcode v0.0.1
#14 10.43 go: downloading github.com/pmezard/go-difflib v1.0.0
#14 10.44 go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
#14 10.45 go: downloading github.com/dustin/go-humanize v1.0.0
#14 10.46 go: downloading github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
#14 10.47 go: downloading github.com/r2ishiguro/vrf v0.0.0-20180716233122-192de52975eb
#14 10.47 go: downloading github.com/hashicorp/golang-lru v0.5.4
#14 10.48 go: downloading github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643
#14 12.13 # github.com/herumi/bls-eth-go-binary/bls
#14 12.13 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:9:28: undefined: SecretKey
#14 12.13 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:9:40: undefined: Fr
#14 12.13 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:13:26: undefined: Fr
#14 12.13 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:13:31: undefined: SecretKey
#14 12.13 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:19:28: undefined: PublicKey
#14 12.13 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:19:40: undefined: G1
#14 12.13 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:23:26: undefined: G1
#14 12.13 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:23:31: undefined: PublicKey
#14 12.13 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:23: undefined: Sign
#14 12.13 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:30: undefined: G2
#14 12.13 /go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:30: too many errors
#14 24.70 make[1]: Leaving directory '/go/src/github.com/line/lbm-sdk'
#14 24.70 make[1]: *** [Makefile:120: build] Error 2
#14 24.70 make: *** [Makefile:117: build-linux] Error 2
------
executor failed running [/bin/sh -c make build-linux]: exit code: 2

The system specification is macOs v12.2.1 and CPU is Apple M1 Pro.

@tnasu
Copy link
Member

tnasu commented Mar 8, 2022

I got the same error on m1 mac as you did.

And I confirmed that I failed to build Docker in another environment, Catalina Mac.

$ docker build -t line/lbm-simapp .

[+] Building 46.4s (13/14)                                                                                                                            
 => [internal] load build definition from Dockerfile                                                                                             0.0s
 => => transferring dockerfile: 1.45kB                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                                0.0s
 => => transferring context: 84B                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/alpine:edge                                                                                   2.7s
 => [internal] load metadata for docker.io/library/golang:alpine                                                                                 2.7s
 => [internal] load build context                                                                                                                4.6s
 => => transferring context: 137.19MB                                                                                                            4.2s
 => [build-env 1/5] FROM docker.io/library/golang:alpine@sha256:b35984144ec2c2dfd6200e112a9b8ecec4a8fd9eff0babaff330f1f82f14cb2a                 9.9s
 => => resolve docker.io/library/golang:alpine@sha256:b35984144ec2c2dfd6200e112a9b8ecec4a8fd9eff0babaff330f1f82f14cb2a                           0.0s
 => => sha256:e2e68a9cdd5da82458652fdac3908a3a270686b38039f2829855398e2e06019d 1.36kB / 1.36kB                                                   0.0s
 => => sha256:16b6bb19f17415f87ee888b28c87b43ed3a13606fdaceed15b92e7080e813584 5.17kB / 5.17kB                                                   0.0s
 => => sha256:666ba61612fd7c93393f9a5bc1751d8a9929e32d51501dba691da9e8232bc87b 282.16kB / 282.16kB                                               0.2s
 => => sha256:8ed8ca4862056a130f714accb3538decfa0663fec84e635d8b5a0a3305353dee 155B / 155B                                                       0.4s
 => => sha256:b35984144ec2c2dfd6200e112a9b8ecec4a8fd9eff0babaff330f1f82f14cb2a 1.65kB / 1.65kB                                                   0.0s
 => => extracting sha256:666ba61612fd7c93393f9a5bc1751d8a9929e32d51501dba691da9e8232bc87b                                                        0.2s
 => => sha256:141c1ce2f203145a20c1b4550c662f943266dc7dbf7e15ee911b06456e2326da 110.19MB / 110.19MB                                               4.9s
 => => sha256:ee4c7319106ffbcda864c88220ef7a19e3da3b571fa08e0be968efe7fbd9465f 156B / 156B                                                       0.8s
 => => extracting sha256:8ed8ca4862056a130f714accb3538decfa0663fec84e635d8b5a0a3305353dee                                                        0.0s
 => => extracting sha256:141c1ce2f203145a20c1b4550c662f943266dc7dbf7e15ee911b06456e2326da                                                        4.4s
 => => extracting sha256:ee4c7319106ffbcda864c88220ef7a19e3da3b571fa08e0be968efe7fbd9465f                                                        0.0s
 => [stage-1 1/4] FROM docker.io/library/alpine:edge@sha256:1a4c2018cfbab67566904e18fde9bf6a5c190605bf7da0e1d181b26746a15188                     1.0s
 => => resolve docker.io/library/alpine:edge@sha256:1a4c2018cfbab67566904e18fde9bf6a5c190605bf7da0e1d181b26746a15188                             0.0s
 => => sha256:1a4c2018cfbab67566904e18fde9bf6a5c190605bf7da0e1d181b26746a15188 1.85kB / 1.85kB                                                   0.0s
 => => sha256:0119f88f395766eb52f9b817c3d23576bf31935dc8e94abe14bae9a083ce4639 528B / 528B                                                       0.0s
 => => sha256:4e873038b87b454ce65890597a96fa12772164123b4d266f1278366241eca60d 1.47kB / 1.47kB                                                   0.0s
 => => sha256:41dcc117e123342ad8ade3073ce46b505baa04b6a19e2fed7758f086a102fa7b 2.81MB / 2.81MB                                                   0.4s
 => => extracting sha256:41dcc117e123342ad8ade3073ce46b505baa04b6a19e2fed7758f086a102fa7b                                                        0.5s
 => [stage-1 2/4] RUN apk add --update ca-certificates                                                                                           3.6s 
 => [stage-1 3/4] WORKDIR /root                                                                                                                  0.1s 
 => [build-env 2/5] RUN apk add --no-cache curl make git libc-dev bash gcc linux-headers eudev-dev python3                                       3.8s 
 => [build-env 3/5] WORKDIR /go/src/github.com/line/lbm-sdk                                                                                      0.0s 
 => [build-env 4/5] COPY . .                                                                                                                     0.6s 
 => ERROR [build-env 5/5] RUN make build-linux                                                                                                  29.4s 
------                                                                                                                                                
 > [build-env 5/5] RUN make build-linux:                                                                                                              
#13 0.267 GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false make build                                                                                     
#13 0.269 make[1]: Entering directory '/go/src/github.com/line/lbm-sdk'                                                                               
#13 0.323 mkdir -p /go/src/github.com/line/lbm-sdk/build/                                                                                             
#13 0.325 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=goz-phase-1-2961-g2d18824ab -X github.com/line/lbm-sdk/version.Commit=2d18824abcdcdc157fe1a563ef15a557f7ee3c5d -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 2.256 go: downloading github.com/line/ostracon v1.0.3
#13 2.256 go: downloading github.com/spf13/viper v1.10.1
#13 2.257 go: downloading github.com/spf13/cobra v1.3.0
#13 2.259 go: downloading github.com/regen-network/protobuf v1.3.3-alpha.regen.1
#13 2.280 go: downloading github.com/golang/protobuf v1.5.2
#13 2.310 go: downloading github.com/grpc-ecosystem/grpc-gateway v1.16.0
#13 2.451 go: downloading google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
#13 2.453 go: downloading google.golang.org/grpc v1.33.2
#13 2.682 go: downloading github.com/bgentry/speakeasy v0.1.0
#13 2.689 go: downloading github.com/mattn/go-isatty v0.0.14
#13 2.695 go: downloading github.com/rakyll/statik v0.1.7
#13 2.714 go: downloading github.com/gorilla/mux v1.8.0
#13 2.730 go: downloading github.com/spf13/pflag v1.0.5
#13 2.733 go: downloading github.com/pkg/errors v0.9.1
#13 2.735 go: downloading gopkg.in/yaml.v2 v2.4.0
#13 2.757 go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
#13 2.777 go: downloading github.com/line/iavl/v2 v2.0.0-init.1.0.20220215225951-cb11c91d8857
#13 2.810 go: downloading github.com/line/tm-db/v2 v2.0.0-init.1.0.20220121012851-61d2bc1d9486
#13 2.833 go: downloading github.com/tendermint/go-amino v0.16.0
#13 2.834 go: downloading github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
#13 2.838 go: downloading google.golang.org/protobuf v1.27.1
#13 2.980 go: downloading github.com/btcsuite/btcd v0.22.0-beta
#13 3.015 go: downloading github.com/cosmos/go-bip39 v1.0.0
#13 3.135 go: downloading github.com/tendermint/btcd v0.1.1
#13 3.217 go: downloading golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e
#13 3.258 go: downloading github.com/gogo/gateway v1.1.0
#13 3.316 go: downloading github.com/gorilla/handlers v1.5.1
#13 3.751 go: downloading github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76
#13 3.759 go: downloading github.com/rs/zerolog v1.26.1
#13 3.932 go: downloading github.com/spf13/cast v1.4.1
#13 3.933 go: downloading github.com/VictoriaMetrics/fastcache v1.9.0
#13 3.938 go: downloading github.com/go-kit/kit v0.10.0
#13 4.012 go: downloading github.com/prometheus/client_golang v1.12.1
#13 4.054 go: downloading github.com/confio/ics23/go v0.6.6
#13 4.058 go: downloading github.com/coocood/freecache v1.2.0
#13 4.058 go: downloading github.com/dgraph-io/ristretto v0.1.0
#13 4.073 go: downloading github.com/armon/go-metrics v0.3.10
#13 4.085 go: downloading github.com/prometheus/common v0.32.1
#13 4.096 go: downloading github.com/stretchr/testify v1.7.0
#13 4.106 go: downloading github.com/golang/mock v1.6.0
#13 4.121 go: downloading github.com/cosmos/btcutil v1.0.4
#13 4.123 go: downloading github.com/regen-network/cosmos-proto v0.3.1
#13 4.124 go: downloading github.com/mailru/easyjson v0.7.7
#13 4.149 go: downloading github.com/fsnotify/fsnotify v1.5.1
#13 4.149 go: downloading github.com/magiconair/properties v1.8.5
#13 4.149 go: downloading github.com/mitchellh/mapstructure v1.4.3
#13 4.161 go: downloading github.com/spf13/afero v1.6.0
#13 4.163 go: downloading github.com/spf13/jwalterweatherman v1.1.0
#13 4.165 go: downloading github.com/subosito/gotenv v1.2.0
#13 4.171 go: downloading gopkg.in/ini.v1 v1.66.2
#13 4.184 go: downloading golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d
#13 4.238 go: downloading golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a
#13 4.402 go: downloading github.com/go-logfmt/logfmt v0.5.0
#13 4.411 go: downloading github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d
#13 4.439 go: downloading github.com/davecgh/go-spew v1.1.1
#13 4.451 go: downloading github.com/gorilla/websocket v1.4.2
#13 4.468 go: downloading github.com/felixge/httpsnoop v1.0.1
#13 4.474 go: downloading github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b
#13 4.483 go: downloading github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2
#13 4.499 go: downloading github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c
#13 4.507 go: downloading github.com/mtibben/percent v0.2.1
#13 4.513 go: downloading github.com/line/wasmvm v0.16.3-0.9.0
#13 5.110 go: downloading github.com/google/gofuzz v1.2.0
#13 5.195 go: downloading github.com/rs/cors v1.7.0
#13 5.197 go: downloading github.com/cespare/xxhash/v2 v2.1.2
#13 5.198 go: downloading github.com/golang/snappy v0.0.4
#13 5.199 go: downloading github.com/beorn7/perks v1.0.1
#13 5.206 go: downloading github.com/prometheus/client_model v0.2.0
#13 5.207 go: downloading github.com/cespare/xxhash v1.1.0
#13 5.210 go: downloading github.com/prometheus/procfs v0.7.3
#13 5.214 go: downloading github.com/google/btree v1.0.0
#13 5.217 go: downloading github.com/hashicorp/go-immutable-radix v1.3.1
#13 5.223 go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
#13 5.229 go: downloading github.com/josharian/intern v1.0.0
#13 5.239 go: downloading github.com/hashicorp/hcl v1.0.0
#13 5.239 go: downloading github.com/pelletier/go-toml v1.9.4
#13 5.286 go: downloading golang.org/x/text v0.3.7
#13 5.291 go: downloading github.com/gtank/merlin v0.1.1
#13 5.292 go: downloading github.com/libp2p/go-buffer-pool v0.0.2
#13 5.292 go: downloading github.com/herumi/bls-eth-go-binary v0.0.0-20200923072303-32b29e5d8cbf
#13 5.293 go: downloading github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
#13 5.316 go: downloading github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca
#13 5.460 go: downloading github.com/gtank/ristretto255 v0.1.2
#13 5.460 go: downloading golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
#13 5.465 go: downloading github.com/minio/highwayhash v1.0.1
#13 5.526 go: downloading github.com/google/orderedcode v0.0.1
#13 5.553 go: downloading github.com/Workiva/go-datastructures v1.0.52
#13 5.616 go: downloading github.com/dustin/go-humanize v1.0.0
#13 5.664 go: downloading github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
#13 5.698 go: downloading github.com/pmezard/go-difflib v1.0.0
#13 5.709 go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
#13 5.711 go: downloading github.com/hashicorp/golang-lru v0.5.4
#13 5.723 go: downloading github.com/r2ishiguro/vrf v0.0.0-20180716233122-192de52975eb
#13 5.736 go: downloading github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643
#13 21.82 # github.com/herumi/bls-eth-go-binary/bls
#13 21.82 /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lstdc++
#13 21.82 collect2: error: ld returned 1 exit status
#13 29.29 make[1]: *** [Makefile:120: build] Error 2
#13 29.29 make[1]: Leaving directory '/go/src/github.com/line/lbm-sdk'
#13 29.29 make: *** [Makefile:117: build-linux] Error 2
------
executor failed running [/bin/sh -c make build-linux]: exit code: 2

@tnasu
Copy link
Member

tnasu commented Mar 8, 2022

But I got success to build Ostracon. So I think lbm-sdk should improve docker build

$  make build-linux-docker
docker build --label=ostracon --tag="ostracon/ostracon" -f ./DOCKER/Dockerfile .
[+] Building 68.0s (14/14) FINISHED                                                                                                                   
 => [internal] load build definition from Dockerfile                                                                                             0.0s
 => => transferring dockerfile: 1.91kB                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                                0.0s
 => => transferring context: 103B                                                                                                                0.0s
 => [internal] load metadata for docker.io/library/golang:1.15-alpine                                                                            2.5s
 => [builder 1/5] FROM docker.io/library/golang:1.15-alpine@sha256:b58c367d52e46cdedc25ec9cd74cadb14ad65e8db75b25e5ec117cdb227aa264             17.1s
 => => resolve docker.io/library/golang:1.15-alpine@sha256:b58c367d52e46cdedc25ec9cd74cadb14ad65e8db75b25e5ec117cdb227aa264                      0.0s
 => => sha256:e4bc8fc554c31c0fb115880309eafbbdfcbeaa5259281e59b26346027eb06831 281.50kB / 281.50kB                                               0.4s
 => => sha256:803daa35ea4774c1839c77f23e37057a576d5cce3a041b2e2b5f700cf3f036b9 155B / 155B                                                       0.6s
 => => sha256:b58c367d52e46cdedc25ec9cd74cadb14ad65e8db75b25e5ec117cdb227aa264 1.65kB / 1.65kB                                                   0.0s
 => => sha256:dc5787428863f5e2f832b52bf7405c191c575a9b38a19ae4d0cc641079242e63 1.36kB / 1.36kB                                                   0.0s
 => => sha256:1403af3b6d4ae3d0021f289a714d4df962b6be59a7fdecf4c6363c9b0f47c340 5.13kB / 5.13kB                                                   0.0s
 => => sha256:29291e31a76a7e560b9b7ad3cada56e8c18d50a96cca8a2573e4f4689d7aca77 2.81MB / 2.81MB                                                   0.4s
 => => extracting sha256:29291e31a76a7e560b9b7ad3cada56e8c18d50a96cca8a2573e4f4689d7aca77                                                        0.5s
 => => sha256:38284154e39640e51f13a639dd8dd9a8d68a41aa82f4891bac56a3a0e49f1290 106.92MB / 106.92MB                                               7.0s
 => => sha256:a66f7597198af53100c7f92e143ffd3b724c17363091713fad62997b3bc06a5a 155B / 155B                                                       0.8s
 => => extracting sha256:e4bc8fc554c31c0fb115880309eafbbdfcbeaa5259281e59b26346027eb06831                                                        0.5s
 => => extracting sha256:803daa35ea4774c1839c77f23e37057a576d5cce3a041b2e2b5f700cf3f036b9                                                        0.0s
 => => extracting sha256:38284154e39640e51f13a639dd8dd9a8d68a41aa82f4891bac56a3a0e49f1290                                                        9.4s
 => => extracting sha256:a66f7597198af53100c7f92e143ffd3b724c17363091713fad62997b3bc06a5a                                                        0.0s
 => [internal] load build context                                                                                                               16.9s
 => => transferring context: 613.37MB                                                                                                           16.6s
 => [builder 2/5] RUN apk update &&     apk upgrade &&     apk add --no-cache git make gcc libc-dev build-base curl jq bash file gmp-dev clang  10.3s
 => [stage-1 2/5] RUN apk update &&     apk upgrade &&     apk add --no-cache git make gcc libc-dev build-base curl jq bash file gmp-dev clang  10.4s
 => [builder 3/5] COPY / /ostracon                                                                                                               3.2s
 => [stage-1 3/5] WORKDIR /ostracon                                                                                                              0.0s
 => [builder 4/5] WORKDIR /ostracon                                                                                                              0.0s 
 => [builder 5/5] RUN make build-linux                                                                                                          31.1s 
 => [stage-1 4/5] COPY --from=builder /ostracon/build/ostracon /usr/bin/ostracon                                                                 0.1s 
 => [stage-1 5/5] COPY ./DOCKER/docker-entrypoint.sh /usr/local/bin/                                                                             0.0s 
 => exporting to image                                                                                                                           3.4s 
 => => exporting layers                                                                                                                          3.4s 
 => => writing image sha256:8a158c82c5a383cbfa1898be7f1bd24de21602152ec386e3ed8b0c44239807ff                                                     0.0s 
 => => naming to docker.io/ostracon/ostracon                                                                                                     0.0s 
                                                                                                                                                      
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them  

@tnasu
Copy link
Member

tnasu commented Mar 11, 2022

@zemyblue I've built docker on lbm-sdk(docker build -t line/lbm-simapp .) with the below patch:

$ git diff
diff --git a/Dockerfile b/Dockerfile
index 72349483b..ac2960014 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,7 +13,7 @@
 FROM golang:alpine AS build-env
 
 # Install minimum necessary dependencies,
-ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3
+ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 build-base file gmp-dev clang libtool autoconf automake
 RUN apk add --no-cache $PACKAGES
 
 # Set working directory for the build

It's a success.

$ docker build -t line/lbm-simapp .
[+] Building 74.5s (15/15) FINISHED                                                                                                                                                   
 => [internal] load build definition from Dockerfile                                                                                                                             0.1s
 => => transferring dockerfile: 1.51kB                                                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                                                                0.1s
 => => transferring context: 84B                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/alpine:edge                                                                                                                   2.8s
 => [internal] load metadata for docker.io/library/golang:alpine                                                                                                                 2.7s
 => [build-env 1/5] FROM docker.io/library/golang:alpine@sha256:b35984144ec2c2dfd6200e112a9b8ecec4a8fd9eff0babaff330f1f82f14cb2a                                                10.3s
 => => resolve docker.io/library/golang:alpine@sha256:b35984144ec2c2dfd6200e112a9b8ecec4a8fd9eff0babaff330f1f82f14cb2a                                                           0.0s
 => => sha256:59bf1c3509f33515622619af21ed55bbe26d24913cedbca106468a5fb37a50c3 2.82MB / 2.82MB                                                                                   0.4s
 => => sha256:666ba61612fd7c93393f9a5bc1751d8a9929e32d51501dba691da9e8232bc87b 282.16kB / 282.16kB                                                                               0.4s
 => => sha256:8ed8ca4862056a130f714accb3538decfa0663fec84e635d8b5a0a3305353dee 155B / 155B                                                                                       0.6s
 => => sha256:b35984144ec2c2dfd6200e112a9b8ecec4a8fd9eff0babaff330f1f82f14cb2a 1.65kB / 1.65kB                                                                                   0.0s
 => => sha256:e2e68a9cdd5da82458652fdac3908a3a270686b38039f2829855398e2e06019d 1.36kB / 1.36kB                                                                                   0.0s
 => => sha256:16b6bb19f17415f87ee888b28c87b43ed3a13606fdaceed15b92e7080e813584 5.17kB / 5.17kB                                                                                   0.0s
 => => extracting sha256:59bf1c3509f33515622619af21ed55bbe26d24913cedbca106468a5fb37a50c3                                                                                        0.3s
 => => sha256:ee4c7319106ffbcda864c88220ef7a19e3da3b571fa08e0be968efe7fbd9465f 156B / 156B                                                                                       0.8s
 => => sha256:141c1ce2f203145a20c1b4550c662f943266dc7dbf7e15ee911b06456e2326da 110.19MB / 110.19MB                                                                               5.4s
 => => extracting sha256:666ba61612fd7c93393f9a5bc1751d8a9929e32d51501dba691da9e8232bc87b                                                                                        0.3s
 => => extracting sha256:8ed8ca4862056a130f714accb3538decfa0663fec84e635d8b5a0a3305353dee                                                                                        0.0s
 => => extracting sha256:141c1ce2f203145a20c1b4550c662f943266dc7dbf7e15ee911b06456e2326da                                                                                        4.5s
 => => extracting sha256:ee4c7319106ffbcda864c88220ef7a19e3da3b571fa08e0be968efe7fbd9465f                                                                                        0.0s
 => [stage-1 1/4] FROM docker.io/library/alpine:edge@sha256:1a4c2018cfbab67566904e18fde9bf6a5c190605bf7da0e1d181b26746a15188                                                     2.0s
 => => resolve docker.io/library/alpine:edge@sha256:1a4c2018cfbab67566904e18fde9bf6a5c190605bf7da0e1d181b26746a15188                                                             0.0s
 => => sha256:1a4c2018cfbab67566904e18fde9bf6a5c190605bf7da0e1d181b26746a15188 1.85kB / 1.85kB                                                                                   0.0s
 => => sha256:0119f88f395766eb52f9b817c3d23576bf31935dc8e94abe14bae9a083ce4639 528B / 528B                                                                                       0.0s
 => => sha256:4e873038b87b454ce65890597a96fa12772164123b4d266f1278366241eca60d 1.47kB / 1.47kB                                                                                   0.0s
 => => sha256:41dcc117e123342ad8ade3073ce46b505baa04b6a19e2fed7758f086a102fa7b 2.81MB / 2.81MB                                                                                   1.3s
 => => extracting sha256:41dcc117e123342ad8ade3073ce46b505baa04b6a19e2fed7758f086a102fa7b                                                                                        0.6s
 => [internal] load build context                                                                                                                                                4.5s
 => => transferring context: 137.17MB                                                                                                                                            4.4s
 => [stage-1 2/4] RUN apk add --update ca-certificates                                                                                                                           3.3s
 => [stage-1 3/4] WORKDIR /root                                                                                                                                                  0.0s
 => [build-env 2/5] RUN apk add --no-cache curl make git libc-dev bash gcc linux-headers eudev-dev python3 build-base file gmp-dev clang libtool autoconf automake               7.8s
 => [build-env 3/5] WORKDIR /go/src/github.com/line/lbm-sdk                                                                                                                      0.0s
 => [build-env 4/5] COPY . .                                                                                                                                                     0.9s
 => [build-env 5/5] RUN make build-linux                                                                                                                                        52.2s
 => [stage-1 4/4] COPY --from=build-env /go/src/github.com/line/lbm-sdk/build/simd /usr/bin/simd                                                                                 0.1s
 => exporting to image                                                                                                                                                           0.2s
 => => exporting layers                                                                                                                                                          0.2s
 => => writing image sha256:3056de7b79cefafde6cc0f1865c5e553ac5ef2b504d0d8f16c6eca34a93e5e1f                                                                                     0.0s
 => => naming to docker.io/line/lbm-simapp                                                                                                                                       0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them

Anyway, would you change the issues' title? It doesn't depend on arm64 golang on M1 mac.

Thanks.

@github-actions github-actions bot added the Stale For github bot label Mar 25, 2022
@zemyblue
Copy link
Member Author

zemyblue commented Apr 5, 2022

I still don't compile.

@github-actions github-actions bot removed the Stale For github bot label Apr 6, 2022
@tnasu
Copy link
Member

tnasu commented Apr 7, 2022

@zemyblue I've checked and confirmed the success with the latest version lbm-sdk with more of the below patch:

diff --git a/Makefile b/Makefile
index fe874d60e..f9d36cf1f 100644
--- a/Makefile
+++ b/Makefile
@@ -112,9 +112,10 @@ include contrib/devtools/Makefile
 
 BUILD_TARGETS := build install
 
+TARGET_ARCH ?= $(shell go env GOARCH)
 build: BUILD_ARGS=-o $(BUILDDIR)/
 build-linux:
-       GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false $(MAKE) build
+       GOOS=linux GOARCH=$(TARGET_ARCH) LEDGER_ENABLED=false $(MAKE) build

Thanks

@github-actions github-actions bot added the Stale For github bot label Apr 18, 2022
@github-actions github-actions bot removed the Stale For github bot label Jun 21, 2022
@github-actions github-actions bot added the Stale For github bot label Jul 1, 2022
@github-actions github-actions bot removed the Stale For github bot label Jul 28, 2022
@github-actions github-actions bot added the Stale For github bot label Aug 7, 2022
@tnasu tnasu closed this as completed Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: enhancement Classification: New feature or its request, or improvement in maintainability of code Stale For github bot
Projects
None yet
Development

No branches or pull requests

3 participants