etcd-io / etcd

Distributed reliable key-value store for the most critical data of a distributed system
https://etcd.io
Apache License 2.0
47.37k stars 9.72k forks source link

s390x: etcd (master?) does not builds: duplicated definition of symbol runtime.exit #12496

Closed ptabor closed 3 years ago

ptabor commented 3 years ago
GOARCH="s390x" ./build      

% 'gofail' 'disable' 'server/etcdserver/' 'server/mvcc/backend/'
% 'gofail' 'disable' 'server/etcdserver/' 'server/mvcc/backend/'
% 'rm' '-f' 'bin/etcd'
% (cd server && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=' 'GOOS=' 'GOARCH=s390x' 'go' 'build' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=28d1af294' '-o=../bin/etcd' '.')
stderr: # go.etcd.io/etcd/server/v3
stderr: 2020/11/27 11:46:11 duplicated definition of symbol runtime.exit
FAIL: (code:2):
  % (cd server && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=' 'GOOS=' 'GOARCH=s390x' 'go' 'build' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=28d1af294' '-o=../bin/etcd' '.')
FAIL: etcd_build

% go version                  
go version go1.15.5 linux/amd64
ptabor commented 3 years ago

@spzala @nirmannarang

nirmannarang commented 3 years ago

@ptabor Checking the native as well as cross-build on my machine.

nirmannarang commented 3 years ago

@ptabor I tried the following:

With your git branch: https://github.com/ptabor/etcd/tree/20201127-release, enabled s390x in scripts/build-binary and scripts/build-release.sh

Native Build:

go version go1.15 linux/s390x
GOARCH="s390x" ./build
. . .
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/gorilla/websocket v1.4.2
% 'env' 'GO111MODULE=off' 'go' 'get' 'github.com/myitcv/gobin'
% 'rm' '-f' 'bin/etcd'
% (cd server && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=' 'GOOS=' 'GOARCH=s390x' 'go' 'build' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=65ea11678' '-o=../bin/etcd' '.')
stderr: go: downloading github.com/spf13/cobra v1.1.1
stderr: go: downloading gopkg.in/yaml.v2 v2.2.8
stderr: go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
% 'rm' '-f' 'bin/etcdctl'
% (cd etcdctl && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=' 'go' 'build' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=65ea11678' '-o=../bin/etcdctl' '.')
stderr: go: downloading github.com/urfave/cli v1.22.4
stderr: go: downloading github.com/bgentry/speakeasy v0.1.0
stderr: go: downloading github.com/olekukonko/tablewriter v0.0.4
stderr: go: downloading gopkg.in/cheggaaa/pb.v1 v1.0.28
stderr: go: downloading github.com/mattn/go-runewidth v0.0.7
stderr: go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
stderr: go: downloading github.com/russross/blackfriday/v2 v2.0.1
stderr: go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
SUCCESS: etcd_build (GOARCH=s390x)

Cross Build on x86_64

go version go1.15.5 linux/amd64
GOARCH="s390x" ./build
. . .
go: downloading github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2
go: downloading github.com/sirupsen/logrus v1.7.0
go: downloading github.com/gorilla/websocket v1.4.2
% 'env' 'GO111MODULE=off' 'go' 'get' 'github.com/myitcv/gobin'
% 'rm' '-f' 'bin/etcd'
% (cd server && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=' 'GOOS=' 'GOARCH=s390x' 'go' 'build' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=65ea11678' '-o=../bin/etcd' '.')
stderr: go: downloading github.com/spf13/cobra v1.1.1
stderr: go: downloading gopkg.in/yaml.v2 v2.2.8
stderr: go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
% 'rm' '-f' 'bin/etcdctl'
% (cd etcdctl && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=' 'go' 'build' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=65ea11678' '-o=../bin/etcdctl' '.')
stderr: go: downloading github.com/urfave/cli v1.22.4
stderr: go: downloading github.com/olekukonko/tablewriter v0.0.4
stderr: go: downloading github.com/bgentry/speakeasy v0.1.0
stderr: go: downloading gopkg.in/cheggaaa/pb.v1 v1.0.28
stderr: go: downloading github.com/mattn/go-runewidth v0.0.7
stderr: go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
stderr: go: downloading github.com/russross/blackfriday/v2 v2.0.1
stderr: go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
SUCCESS: etcd_build (GOARCH=s390x)

I can see the stderrors but in the end, the build is successful. The same is with the Travis job(runs with go 1.14.3).

Travis Job: go 1.14.3

% (cd server && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=-v -mod=readonly' 'GOOS=' 'GOARCH=s390x' 'go' 'build' '-v' '-mod=readonly' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=f388a74' '-o=../bin/etcd' '.')
stderr: internal/cpu
stderr: runtime/internal/atomic
stderr: runtime/internal/sys
stderr: internal/bytealg
stderr: runtime/internal/math
stderr: internal/race
stderr: sync/atomic
stderr: runtime
stderr: unicode
stderr: unicode/utf8
stderr: container/list
stderr: math/bits
stderr: math
stderr: crypto/internal/subtle
stderr: crypto/subtle
stderr: internal/testlog
stderr: unicode/utf16
stderr: vendor/golang.org/x/crypto/cryptobyte/asn1
stderr: internal/nettrace
stderr: vendor/golang.org/x/crypto/internal/subtle
stderr: encoding
stderr: golang.org/x/sys/internal/unsafeheader
stderr: google.golang.org/grpc/internal/grpclog
stderr: google.golang.org/grpc/serviceconfig
stderr: github.com/golang/groupcache/lru
stderr: internal/reflectlite
stderr: sync
stderr: math/rand
stderr: internal/singleflight
stderr: errors
stderr: sort
stderr: internal/oserror
stderr: syscall
stderr: io
stderr: bytes
stderr: hash
stderr: strconv
stderr: crypto
stderr: time
stderr: reflect
stderr: context
stderr: internal/syscall/unix
stderr: internal/poll
stderr: internal/syscall/execenv
stderr: os
stderr: encoding/binary
stderr: internal/fmtsort
stderr: crypto/cipher
stderr: fmt
stderr: crypto/aes
stderr: crypto/des
stderr: strings
stderr: crypto/internal/randutil
stderr: crypto/sha512
stderr: crypto/ed25519/internal/edwards25519
stderr: math/big
stderr: bufio
stderr: crypto/hmac
stderr: crypto/md5
stderr: crypto/rc4
stderr: crypto/sha1
stderr: crypto/sha256
stderr: crypto/elliptic
stderr: encoding/asn1
stderr: crypto/rand
stderr: crypto/ecdsa
stderr: crypto/ed25519
stderr: crypto/rsa
stderr: crypto/dsa
stderr: encoding/hex
stderr: crypto/x509/pkix
stderr: encoding/base64
stderr: vendor/golang.org/x/crypto/cryptobyte
stderr: encoding/pem
stderr: path/filepath
stderr: io/ioutil
stderr: vendor/golang.org/x/net/dns/dnsmessage
stderr: net/url
stderr: vendor/golang.org/x/sys/cpu
stderr: vendor/golang.org/x/crypto/chacha20
stderr: net
stderr: vendor/golang.org/x/crypto/poly1305
stderr: vendor/golang.org/x/crypto/chacha20poly1305
stderr: vendor/golang.org/x/crypto/curve25519
stderr: vendor/golang.org/x/crypto/hkdf
stderr: encoding/json
stderr: flag
stderr: log
stderr: compress/flate
stderr: crypto/x509
stderr: github.com/coreos/go-systemd/v22/daemon
stderr: hash/crc32
stderr: compress/gzip
stderr: vendor/golang.org/x/text/transform
stderr: vendor/golang.org/x/text/unicode/bidi
stderr: crypto/tls
stderr: vendor/golang.org/x/text/secure/bidirule
stderr: vendor/golang.org/x/text/unicode/norm
stderr: vendor/golang.org/x/net/idna
stderr: net/textproto
stderr: vendor/golang.org/x/net/http/httpguts
stderr: vendor/golang.org/x/net/http/httpproxy
stderr: vendor/golang.org/x/net/http2/hpack
stderr: mime
stderr: mime/quotedprintable
stderr: net/http/httptrace
stderr: net/http/internal
stderr: mime/multipart
stderr: path
stderr: github.com/beorn7/perks/quantile
stderr: github.com/cespare/xxhash/v2
stderr: net/http
stderr: github.com/golang/protobuf/proto
stderr: github.com/golang/protobuf/ptypes/any
stderr: github.com/golang/protobuf/ptypes/duration
stderr: github.com/golang/protobuf/ptypes/timestamp
stderr: github.com/golang/protobuf/ptypes
stderr: github.com/prometheus/client_model/go
stderr: github.com/prometheus/client_golang/prometheus/internal
stderr: github.com/matttproud/golang_protobuf_extensions/pbutil
stderr: github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
stderr: regexp/syntax
stderr: regexp
stderr: github.com/prometheus/common/model
stderr: expvar
stderr: github.com/prometheus/procfs/internal/fs
stderr: github.com/prometheus/procfs/internal/util
stderr: golang.org/x/sys/unix
stderr: github.com/prometheus/common/expfmt
stderr: runtime/debug
stderr: golang.org/x/net/context
stderr: golang.org/x/net/internal/timeseries
stderr: html
stderr: text/template/parse
stderr: github.com/prometheus/procfs
stderr: text/template
stderr: html/template
stderr: github.com/prometheus/client_golang/prometheus
stderr: text/tabwriter
stderr: golang.org/x/net/trace
stderr: google.golang.org/grpc/backoff
stderr: google.golang.org/grpc/grpclog
stderr: google.golang.org/grpc/connectivity
stderr: google.golang.org/grpc/credentials/internal
stderr: google.golang.org/grpc/internal
stderr: google.golang.org/grpc/credentials
stderr: google.golang.org/grpc/metadata
stderr: google.golang.org/grpc/attributes
stderr: google.golang.org/grpc/resolver
stderr: google.golang.org/grpc/balancer
stderr: google.golang.org/grpc/internal/grpcrand
stderr: google.golang.org/grpc/balancer/base
stderr: google.golang.org/grpc/codes
stderr: google.golang.org/grpc/encoding
stderr: google.golang.org/grpc/balancer/roundrobin
stderr: google.golang.org/grpc/encoding/proto
stderr: google.golang.org/grpc/internal/backoff
stderr: google.golang.org/grpc/internal/balancerload
stderr: google.golang.org/grpc/binarylog/grpc_binarylog_v1
stderr: google.golang.org/genproto/googleapis/rpc/status
stderr: google.golang.org/grpc/internal/status
stderr: google.golang.org/grpc/status
stderr: google.golang.org/grpc/internal/buffer
stderr: google.golang.org/grpc/internal/binarylog
stderr: google.golang.org/grpc/internal/channelz
stderr: google.golang.org/grpc/internal/envconfig
stderr: google.golang.org/grpc/internal/grpcsync
stderr: google.golang.org/grpc/internal/grpcutil
stderr: google.golang.org/grpc/internal/resolver/dns
stderr: google.golang.org/grpc/internal/resolver/passthrough
stderr: golang.org/x/text/transform
stderr: golang.org/x/text/unicode/bidi
stderr: golang.org/x/text/unicode/norm
stderr: golang.org/x/text/secure/bidirule
stderr: golang.org/x/net/http2/hpack
stderr: google.golang.org/grpc/internal/syscall
stderr: google.golang.org/grpc/keepalive
stderr: google.golang.org/grpc/peer
stderr: google.golang.org/grpc/stats
stderr: golang.org/x/net/idna
stderr: google.golang.org/grpc/tap
stderr: google.golang.org/grpc/naming
stderr: net/http/httputil
stderr: golang.org/x/net/http/httpguts
stderr: encoding/csv
stderr: golang.org/x/net/http2
stderr: github.com/spf13/pflag
stderr: github.com/spf13/cobra
stderr: google.golang.org/grpc/internal/transport
stderr: github.com/soheilhy/cmux
stderr: github.com/gogo/protobuf/proto
stderr: google.golang.org/grpc
stderr: github.com/grpc-ecosystem/go-grpc-prometheus
stderr: github.com/golang/protobuf/protoc-gen-go/descriptor
stderr: github.com/gogo/protobuf/protoc-gen-gogo/descriptor
stderr: google.golang.org/genproto/googleapis/api/annotations
stderr: github.com/coreos/go-semver/semver
stderr: go.etcd.io/etcd/api/v3/version
stderr: database/sql/driver
stderr: github.com/gogo/protobuf/gogoproto
stderr: github.com/google/uuid
stderr: go.etcd.io/etcd/api/v3/authpb
stderr: go.etcd.io/etcd/api/v3/membershippb
stderr: go.etcd.io/etcd/api/v3/mvccpb
stderr: go.etcd.io/etcd/api/v3/v3rpc/rpctypes
stderr: go.uber.org/atomic
stderr: go.etcd.io/etcd/api/v3/etcdserverpb
stderr: go.uber.org/multierr
stderr: go.uber.org/zap/buffer
stderr: go.uber.org/zap/internal/bufferpool
stderr: go.uber.org/zap/internal/color
stderr: go.uber.org/zap/internal/exit
stderr: go.uber.org/zap/zapcore
stderr: go.uber.org/zap
stderr: go.etcd.io/etcd/client/v3/balancer/connectivity
stderr: go.etcd.io/etcd/client/v3/balancer/picker
stderr: google.golang.org/grpc/resolver/dns
stderr: google.golang.org/grpc/resolver/passthrough
stderr: go.etcd.io/etcd/client/v3/balancer
stderr: go.etcd.io/etcd/client/v3/balancer/resolver/endpoint
stderr: go.etcd.io/etcd/client/v3/credentials
stderr: github.com/coreos/go-systemd/v22/journal
stderr: go.etcd.io/etcd/pkg/v3/systemd
stderr: go.etcd.io/etcd/pkg/v3/logutil
stderr: go.etcd.io/etcd/pkg/v3/types
stderr: runtime/pprof
stderr: runtime/trace
stderr: net/http/pprof
stderr: go.etcd.io/etcd/pkg/v3/debugutil
stderr: go.etcd.io/etcd/pkg/v3/fileutil
stderr: go.etcd.io/etcd/pkg/v3/flags
stderr: go.etcd.io/etcd/pkg/v3/ioutil
stderr: os/signal
stderr: go.etcd.io/etcd/pkg/v3/osutil
stderr: go.etcd.io/etcd/pkg/v3/srv
stderr: go.etcd.io/etcd/client/v3
stderr: go.etcd.io/etcd/pkg/v3/tlsutil
stderr: go.etcd.io/etcd/pkg/v3/transport
stderr: github.com/golang/protobuf/descriptor
stderr: github.com/golang/protobuf/ptypes/struct
stderr: github.com/golang/protobuf/jsonpb
stderr: github.com/golang/protobuf/ptypes/wrappers
stderr: github.com/grpc-ecosystem/grpc-gateway/internal
stderr: github.com/grpc-ecosystem/grpc-gateway/utilities
stderr: go.etcd.io/etcd/client/v3/concurrency
stderr: go.etcd.io/etcd/client/v3/namespace
stderr: go.etcd.io/etcd/client/v3/ordering
stderr: go.etcd.io/etcd/client/v3/leasing
stderr: google.golang.org/genproto/googleapis/api/httpbody
stderr: google.golang.org/genproto/protobuf/field_mask
stderr: github.com/grpc-ecosystem/grpc-gateway/runtime
stderr: github.com/gorilla/websocket
stderr: github.com/sirupsen/logrus
stderr: hash/fnv
stderr: go.etcd.io/bbolt
stderr: github.com/tmc/grpc-websocket-proxy/wsproxy
stderr: go.etcd.io/etcd/api/v3/etcdserverpb/gw
stderr: go.etcd.io/etcd/pkg/v3/httputil
stderr: go.etcd.io/etcd/pkg/v3/cpuutil
stderr: go.etcd.io/etcd/pkg/v3/netutil
stderr: go.etcd.io/etcd/pkg/v3/runtime
stderr: github.com/dustin/go-humanize
stderr: go.etcd.io/etcd/pkg/v3/contention
stderr: go.etcd.io/etcd/pkg/v3/idutil
stderr: go.etcd.io/etcd/pkg/v3/pbutil
stderr: go.etcd.io/etcd/pkg/v3/schedule
stderr: go.etcd.io/etcd/pkg/v3/traceutil
stderr: go.etcd.io/etcd/pkg/v3/wait
stderr: go.etcd.io/etcd/raft/v3/quorum
stderr: go.etcd.io/etcd/raft/v3/raftpb
stderr: github.com/dgrijalva/jwt-go
stderr: go.etcd.io/etcd/pkg/v3/adt
stderr: go.etcd.io/etcd/server/v3/mvcc/backend
stderr: go.etcd.io/etcd/raft/v3/tracker
stderr: go.etcd.io/etcd/raft/v3/confchange
stderr: go.etcd.io/etcd/raft/v3
stderr: go.etcd.io/etcd/server/v3/etcdserver/cindex
stderr: golang.org/x/crypto/blowfish
stderr: golang.org/x/crypto/bcrypt
stderr: go.etcd.io/etcd/server/v3/auth
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v2error
stderr: container/heap
stderr: github.com/jonboulle/clockwork
stderr: github.com/xiang90/probing
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v2store
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/snap/snappb
stderr: go.etcd.io/etcd/server/v3/wal/walpb
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/snap
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/membership
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v2stats
stderr: golang.org/x/time/rate
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/rafthttp
stderr: go.etcd.io/etcd/server/v3/etcdserver/api
stderr: github.com/modern-go/concurrent
stderr: github.com/modern-go/reflect2
stderr: go.etcd.io/etcd/pkg/v3/pathutil
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v2http/httptypes
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v3alarm
stderr: github.com/google/btree
stderr: go.etcd.io/etcd/server/v3/lease/leasepb
stderr: github.com/json-iterator/go
stderr: go.etcd.io/etcd/server/v3/lease
stderr: go.etcd.io/etcd/server/v3/mvcc
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v3compactor
stderr: go.etcd.io/etcd/server/v3/lease/leasehttp
stderr: go.etcd.io/etcd/pkg/v3/crc
stderr: go.etcd.io/etcd/server/v3/wal
stderr: go.etcd.io/etcd/client/v2
stderr: github.com/prometheus/client_golang/prometheus/promhttp
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v2discovery
stderr: go.etcd.io/etcd/server/v3/etcdserver
stderr: github.com/grpc-ecosystem/go-grpc-middleware
stderr: google.golang.org/grpc/health/grpc_health_v1
stderr: google.golang.org/grpc/health
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v3election/v3electionpb
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v3lock/v3lockpb
stderr: go.etcd.io/etcd/server/v3/proxy/grpcproxy/adapter
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v3election
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v3election/v3electionpb/gw
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v3lock
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v3lock/v3lockpb/gw
stderr: gopkg.in/yaml.v2
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/etcdhttp
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v2auth
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v2http
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v2v3
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v3rpc
stderr: sigs.k8s.io/yaml
stderr: go.etcd.io/etcd/client/v3/naming
stderr: go.etcd.io/etcd/server/v3/proxy/grpcproxy/cache
stderr: go.etcd.io/etcd/server/v3/proxy/httpproxy
stderr: go.etcd.io/etcd/server/v3/etcdserver/api/v3client
stderr: go.etcd.io/etcd/server/v3/proxy/grpcproxy
stderr: go.etcd.io/etcd/server/v3/embed
stderr: go.etcd.io/etcd/server/v3/proxy/tcpproxy
stderr: go.etcd.io/etcd/server/v3/etcdmain
stderr: go.etcd.io/etcd/server/v3
% 'rm' '-f' 'bin/etcdctl'
% (cd etcdctl && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=-v -mod=readonly' 'go' 'build' '-v' '-mod=readonly' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=f388a74' '-o=../bin/etcdctl' '.')
stderr: github.com/shurcooL/sanitized_anchor_name
stderr: github.com/russross/blackfriday/v2
stderr: github.com/bgentry/speakeasy
stderr: os/exec
stderr: github.com/mattn/go-runewidth
stderr: github.com/olekukonko/tablewriter
stderr: github.com/cpuguy83/go-md2man/v2/md2man
stderr: github.com/urfave/cli
stderr: go.etcd.io/etcd/client/v3/mirror
stderr: go.etcd.io/etcd/client/v3/snapshot
stderr: go.etcd.io/etcd/etcdctl/v3/snapshot
stderr: go.etcd.io/etcd/pkg/v3/report
stderr: gopkg.in/cheggaaa/pb.v1
stderr: go.etcd.io/etcd/etcdctl/v3/ctlv2/command
stderr: go.etcd.io/etcd/etcdctl/v3/ctlv3/command
stderr: go.etcd.io/etcd/etcdctl/v3/ctlv2
stderr: go.etcd.io/etcd/etcdctl/v3/ctlv3
stderr: go.etcd.io/etcd/etcdctl/v3
SUCCESS: etcd_build (GOARCH=s390x)
ptabor commented 3 years ago

I see this problem with the 'official repo'

I verified it on 2 different machines.

➜ git clone https://github.com/etcd-io/etcd.git Cloning into 'etcd'... remote: Enumerating objects: 100804, done. remote: Total 100804 (delta 0), reused 0 (delta 0), pack-reused 100804 Receiving objects: 100% (100804/100804), 60.33 MiB | 21.36 MiB/s, done. Resolving deltas: 100% (65311/65311), done.

➜ go version go version go1.15.5 linux/amd64

➜ cd etcd
➜ GOARCH="s390x" ./build go: downloading github.com/json-iterator/go v1.1.10 go: downloading google.golang.org/grpc v1.29.1 go: downloading golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 go: downloading go.uber.org/zap v1.16.0 go: downloading github.com/google/uuid v1.1.2 go: downloading github.com/grpc-ecosystem/grpc-gateway v1.14.6 go: downloading github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966 go: downloading github.com/prometheus/client_golang v1.5.1 go: downloading github.com/golang/protobuf v1.3.5 go: downloading github.com/prometheus/procfs v0.2.0 go: downloading github.com/prometheus/common v0.10.0 go: downloading github.com/gorilla/websocket v1.4.2 go: downloading google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884 go: downloading go.uber.org/multierr v1.5.0 go: downloading github.com/sirupsen/logrus v1.7.0 go: downloading golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634 go: downloading golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 go: downloading golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e go: downloading github.com/jonboulle/clockwork v0.2.2 go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 go: downloading gopkg.in/yaml.v2 v2.3.0 go: downloading go.uber.org/atomic v1.6.0

% 'env' 'GO111MODULE=off' 'go' 'get' 'github.com/myitcv/gobin' stderr: # github.com/myitcv/gobin stderr: 2020/12/11 11:12:35 duplicated definition of symbol runtime.exit FAIL: (code:2): % 'env' 'GO111MODULE=off' 'go' 'get' 'github.com/myitcv/gobin'

So even:

'env'  GOARCH="s390x" 'GO111MODULE=off' 'go' 'get' 'github.com/myitcv/gobin'

alone fails due to this problem.

(but skipping gobin, our own build would fail as well:)

cd server
GOARCH="s390x" go build ./...

go: downloading github.com/spf13/cobra v1.1.1
go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
# go.etcd.io/etcd/server/v3
2020/12/11 11:20:25 duplicated definition of symbol runtime.exit

To me it looks like golang level issue, as it affects multiple binaries (or some common dependency populates multiple symbols fox s390x)

nirmannarang commented 3 years ago

@ptabor

I checked again, could not reproduce the issue you are facing. Could cross-build s390x binary on your branch as well as master branch. Only a few stderr which are in x86 build too. Verified this with go1.15.5

  1. ptabor branch (after enabling s390x in scripts/build-binary and scripts/build-release.sh)

    go: downloading go.uber.org/atomic v1.6.0
    go: downloading github.com/google/btree v1.0.0
    go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
    % 'env' 'GO111MODULE=off' 'go' 'get' 'github.com/myitcv/gobin'
    % 'rm' '-f' 'bin/etcd'
    % (cd server && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=' 'GOOS=' 'GOARCH=s390x' 'go' 'build' '-installsuffix=cgo' '-ldflags=-X=github.com/ptabor/etcd/api/v3/version.GitSHA=65ea11678' '-o=../bin/etcd' '.')
    stderr: go: downloading gopkg.in/yaml.v2 v2.2.8
    stderr: go: downloading github.com/spf13/cobra v1.1.1
    stderr: go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
    % 'rm' '-f' 'bin/etcdctl'
    % (cd etcdctl && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=' 'go' 'build' '-installsuffix=cgo' '-ldflags=-X=github.com/ptabor/etcd/api/v3/version.GitSHA=65ea11678' '-o=../bin/etcdctl' '.')
    stderr: go: downloading github.com/urfave/cli v1.22.4
    stderr: go: downloading github.com/bgentry/speakeasy v0.1.0
    stderr: go: downloading gopkg.in/cheggaaa/pb.v1 v1.0.28
    stderr: go: downloading github.com/olekukonko/tablewriter v0.0.4
    stderr: go: downloading github.com/mattn/go-runewidth v0.0.7
    stderr: go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
    stderr: go: downloading github.com/russross/blackfriday/v2 v2.0.1
    stderr: go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
    SUCCESS: etcd_build (GOARCH=s390x)
    root@3c8c3c5ea1c0:~/src/github.com/coreos/etcd# echo $?
    0
  2. official master branch

    
    go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
    go: downloading go.etcd.io/bbolt v1.3.5
    % 'env' 'GO111MODULE=off' 'go' 'get' 'github.com/myitcv/gobin'
    % 'rm' '-f' 'bin/etcd'
    % (cd server && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=' 'GOOS=' 'GOARCH=s390x' 'go' 'build' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=c632042bb' '-o=../bin/etcd' '.')
    stderr: go: downloading github.com/spf13/cobra v1.1.1
    stderr: go: downloading gopkg.in/yaml.v2 v2.2.8
    stderr: go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
    % 'rm' '-f' 'bin/etcdctl'
    % (cd etcdctl && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS=' 'go' 'build' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=c632042bb' '-o=../bin/etcdctl' '.')
    stderr: go: downloading github.com/urfave/cli v1.22.4
    stderr: go: downloading github.com/olekukonko/tablewriter v0.0.4
    stderr: go: downloading gopkg.in/cheggaaa/pb.v1 v1.0.28
    stderr: go: downloading github.com/bgentry/speakeasy v0.1.0
    stderr: go: downloading github.com/mattn/go-runewidth v0.0.7
    stderr: go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
    stderr: go: downloading github.com/russross/blackfriday/v2 v2.0.1
    stderr: go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
    SUCCESS: etcd_build

root@5d2ece0a2e65:~/src/github.com/coreos/etcd# ls ADOPTERS.md CHANGELOG-4.0.md GOVERNANCE.md ROADMAP.md build.sh go.sum server CHANGELOG-2.3.md CONTRIBUTING.md LICENSE api client hack test CHANGELOG-3.0.md DCO MAINTAINERS bill-of-materials.json code-of-conduct.md logos test.sh CHANGELOG-3.1.md Dockerfile-release Makefile bill-of-materials.override.json contrib pkg tests CHANGELOG-3.2.md Dockerfile-release.arm64 Procfile bin dummy.go raft tools CHANGELOG-3.3.md Dockerfile-release.ppc64le Procfile.learner build etcd.conf.yml.sample s390x.crosslog CHANGELOG-3.4.md Dockerfile-release.s390x Procfile.v2 build.bat etcdctl scripts CHANGELOG-3.5.md Documentation README.md build.ps1 go.mod security

root@5d2ece0a2e65:~/src/github.com/coreos/etcd# ls bin etcd etcdctl

root@5d2ece0a2e65:~/src/github.com/coreos/etcd# file bin/etcd bin/etcd: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), statically linked, not stripped



The binaries are generated successfully in the end.
nirmannarang commented 3 years ago

@ptabor Able to start etcd service from cross-built binary successfully


root@k8sci1:~/cross_bin_on_intel# nohup ./etcd &
[1] 13360
root@k8sci1:~/cross_bin_on_intel# nohup: ignoring input and appending output to 'nohup.out'

root@k8sci1:~/cross_bin_on_intel# ./etcdctl put mykey "this is awesome"
OK

root@k8sci1:~/cross_bin_on_intel# ./etcdctl get mykey
mykey
this is awesome

root@k8sci1:~/cross_bin_on_intel# cat nohup.out
{"level":"info","ts":1610438737.7271607,"caller":"flags/flag.go:113","msg":"recognized and used environment variable","variable-name":"ETCD_DATA_DIR","variable-value":"/root/cross_bin_on_intel/tmp"}
{"level":"warn","ts":1610438737.7295394,"caller":"flags/flag.go:93","msg":"unrecognized environment variable","environment-variable":"ETCD_UNSUPPORTED_ARCH=s390x"}
{"level":"info","ts":"2021-01-12T00:05:37.729-0800","caller":"etcdmain/etcd.go:69","msg":"Running: ","args":["./etcd"]}
{"level":"info","ts":"2021-01-12T00:05:37.730-0800","caller":"embed/etcd.go:113","msg":"configuring peer listeners","listen-peer-urls":["http://localhost:2380"]}
{"level":"info","ts":"2021-01-12T00:05:37.734-0800","caller":"embed/etcd.go:121","msg":"configuring client listeners","listen-client-urls":["http://localhost:2379"]}
{"level":"info","ts":"2021-01-12T00:05:37.734-0800","caller":"embed/etcd.go:268","msg":"starting an etcd server","etcd-version":"3.5.0-pre","git-sha":"c632042bb","go-version":"go1.15.5","go-os":"linux","go-arch":"s390x","max-cpu-set":8,"max-cpu-available":8,"member-initialized":false,"name":"default","data-dir":"/root/cross_bin_on_intel/tmp","wal-dir":"","wal-dir-dedicated":"","member-dir":"/root/cross_bin_on_intel/tmp/member","force-new-cluster":false,"heartbeat-interval":"100ms","election-timeout":"1s","initial-election-tick-advance":true,"snapshot-count":100000,"snapshot-catchup-entries":5000,"initial-advertise-peer-urls":["http://localhost:2380"],"listen-peer-urls":["http://localhost:2380"],"advertise-client-urls":["http://localhost:2379"],"listen-client-urls":["http://localhost:2379"],"listen-metrics-urls":[],"cors":["*"],"host-whitelist":["*"],"initial-cluster":"default=http://localhost:2380","initial-cluster-state":"new","initial-cluster-token":"etcd-cluster","quota-size-bytes":2147483648,"pre-vote":false,"initial-corrupt-check":false,"corrupt-check-time-interval":"0s","auto-compaction-mode":"periodic","auto-compaction-retention":"0s","auto-compaction-interval":"0s","discovery-url":"","discovery-proxy":"","downgrade-check-interval":"5s"}
{"level":"warn","ts":1610438737.7359056,"caller":"fileutil/fileutil.go:54","msg":"check file permission","error":"directory \"/root/cross_bin_on_intel/tmp\" exist, but the permission is \"drwxr-xr-x\". The recommended permission is \"-rwx------\" to prevent possible unprivileged access to the data."}
{"level":"info","ts":"2021-01-12T00:05:37.745-0800","caller":"etcdserver/backend.go:78","msg":"opened backend db","path":"/root/cross_bin_on_intel/tmp/member/snap/db","took":"7.90563ms"}
{"level":"info","ts":"2021-01-12T00:05:37.762-0800","caller":"etcdserver/raft.go:447","msg":"starting local member","local-member-id":"8e9e05c52164694d","cluster-id":"cdf818194e3a8c32"}
{"level":"info","ts":"2021-01-12T00:05:37.762-0800","caller":"raft/raft.go:1528","msg":"8e9e05c52164694d switched to configuration voters=()"}
{"level":"info","ts":"2021-01-12T00:05:37.763-0800","caller":"raft/raft.go:701","msg":"8e9e05c52164694d became follower at term 0"}
{"level":"info","ts":"2021-01-12T00:05:37.763-0800","caller":"raft/raft.go:383","msg":"newRaft 8e9e05c52164694d [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]"}
{"level":"info","ts":"2021-01-12T00:05:37.763-0800","caller":"raft/raft.go:701","msg":"8e9e05c52164694d became follower at term 1"}
{"level":"info","ts":"2021-01-12T00:05:37.773-0800","caller":"raft/raft.go:1528","msg":"8e9e05c52164694d switched to configuration voters=(10276657743932975437)"}
{"level":"warn","ts":"2021-01-12T00:05:37.780-0800","caller":"auth/store.go:1231","msg":"simple token is not cryptographically signed"}
{"level":"info","ts":"2021-01-12T00:05:37.787-0800","caller":"etcdserver/quota.go:94","msg":"enabled backend quota with default value","quota-name":"v3-applier","quota-size-bytes":2147483648,"quota-size":"2.1 GB"}
{"level":"info","ts":"2021-01-12T00:05:37.789-0800","caller":"etcdserver/server.go:756","msg":"starting etcd server","local-member-id":"8e9e05c52164694d","local-server-version":"3.5.0-pre","cluster-version":"to_be_decided"}
{"level":"info","ts":"2021-01-12T00:05:37.789-0800","caller":"etcdserver/server.go:643","msg":"started as single-node; fast-forwarding election ticks","local-member-id":"8e9e05c52164694d","forward-ticks":9,"forward-duration":"900ms","election-ticks":10,"election-timeout":"1s"}
{"level":"info","ts":"2021-01-12T00:05:37.792-0800","caller":"raft/raft.go:1528","msg":"8e9e05c52164694d switched to configuration voters=(10276657743932975437)"}
{"level":"info","ts":"2021-01-12T00:05:37.792-0800","caller":"membership/cluster.go:385","msg":"added member","cluster-id":"cdf818194e3a8c32","local-member-id":"8e9e05c52164694d","added-peer-id":"8e9e05c52164694d","added-peer-peer-urls":["http://localhost:2380"]}
{"level":"info","ts":"2021-01-12T00:05:37.793-0800","caller":"embed/etcd.go:237","msg":"now serving peer/client/metrics","local-member-id":"8e9e05c52164694d","initial-advertise-peer-urls":["http://localhost:2380"],"listen-peer-urls":["http://localhost:2380"],"advertise-client-urls":["http://localhost:2379"],"listen-client-urls":["http://localhost:2379"],"listen-metrics-urls":[]}
{"level":"info","ts":"2021-01-12T00:05:37.793-0800","caller":"embed/etcd.go:516","msg":"serving peer traffic","address":"127.0.0.1:2380"}
{"level":"info","ts":"2021-01-12T00:05:37.973-0800","caller":"raft/raft.go:788","msg":"8e9e05c52164694d is starting a new election at term 1"}
{"level":"info","ts":"2021-01-12T00:05:37.973-0800","caller":"raft/raft.go:714","msg":"8e9e05c52164694d became candidate at term 2"}
{"level":"info","ts":"2021-01-12T00:05:37.974-0800","caller":"raft/raft.go:848","msg":"8e9e05c52164694d received MsgVoteResp from 8e9e05c52164694d at term 2"}
{"level":"info","ts":"2021-01-12T00:05:37.974-0800","caller":"raft/raft.go:766","msg":"8e9e05c52164694d became leader at term 2"}
{"level":"info","ts":"2021-01-12T00:05:37.974-0800","caller":"raft/node.go:327","msg":"raft.node: 8e9e05c52164694d elected leader 8e9e05c52164694d at term 2"}
{"level":"info","ts":"2021-01-12T00:05:37.974-0800","caller":"etcdserver/server.go:2343","msg":"setting up initial cluster version","cluster-version":"3.5"}
{"level":"info","ts":"2021-01-12T00:05:37.976-0800","caller":"etcdserver/server.go:1921","msg":"published local member to cluster through raft","local-member-id":"8e9e05c52164694d","local-member-attributes":"{Name:default ClientURLs:[http://localhost:2379]}","request-path":"/0/members/8e9e05c52164694d/attributes","cluster-id":"cdf818194e3a8c32","publish-timeout":"7s"}
{"level":"info","ts":"2021-01-12T00:05:37.976-0800","caller":"embed/serve.go:97","msg":"ready to serve client requests"}
{"level":"info","ts":"2021-01-12T00:05:37.976-0800","caller":"etcdmain/main.go:47","msg":"notifying init daemon"}
{"level":"info","ts":"2021-01-12T00:05:37.976-0800","caller":"etcdmain/main.go:53","msg":"successfully notified init daemon"}
{"level":"info","ts":"2021-01-12T00:05:37.977-0800","caller":"membership/cluster.go:523","msg":"set initial cluster version","cluster-id":"cdf818194e3a8c32","local-member-id":"8e9e05c52164694d","cluster-version":"3.5"}
{"level":"info","ts":"2021-01-12T00:05:37.977-0800","caller":"api/capability.go:75","msg":"enabled capabilities for version","cluster-version":"3.5"}
{"level":"info","ts":"2021-01-12T00:05:37.977-0800","caller":"etcdserver/server.go:2363","msg":"cluster version is updated","cluster-version":"3.5"}
{"level":"info","ts":"2021-01-12T00:05:37.979-0800","caller":"embed/serve.go:139","msg":"serving client traffic insecurely; this is strongly discouraged!","address":"127.0.0.1:2379"}
nirmannarang commented 3 years ago

@ptabor Any update on this?

ptabor commented 3 years ago

In clean virtual machine it succeeded for me:

ptab@etcd-releaser:~/etcd/server$ GOARCH="s390x" go build ./...
go: downloading google.golang.org/grpc v1.32.0
go: downloading golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb
go: downloading github.com/soheilhy/cmux v0.1.5-0.20210205191134-5ec6847320e5

ptab@etcd-releaser:~/etcd/server$ go version
go version go1.15.7 linux/amd64

ptab@etcd-releaser:~/etcd/server$ 

s390x is back in the release script: https://github.com/etcd-io/etcd/blob/fa14a0af89e6d2626c6803654c1535e2e7e71240/scripts/release#L220

It seems to be covered in Travis: https://travis-ci.com/github/etcd-io/etcd/jobs/484839021

I'm sorry for the noise.

nirmannarang commented 3 years ago

@ptabor No Issues, Good to see s390x back. Thanks.