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

TiDB v2.1.2 build failed for wrong tidb-tools version #8827

Closed
Xuanwo opened this issue Dec 26, 2018 · 16 comments
Closed

TiDB v2.1.2 build failed for wrong tidb-tools version #8827

Xuanwo opened this issue Dec 26, 2018 · 16 comments

Comments

@Xuanwo
Copy link
Contributor

Xuanwo commented Dec 26, 2018

Bug Report

  1. What did you do?

I'm the maintainer of tidb on AUR, and also the maintainer from archlinuxcn which provides tidb binary.

I tried to bump tidb version to 2.1.2 but failed error.

  1. What did you expect to see?

I expect to see tidb built with success.

  1. What did you see instead?

tidb build failed with error:

# command-line-arguments
tidb-server/main.go:193:17: undefined: client.NewLocalPumpsClient
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

v2.1.2


Some more info:

NewLocalPumpsClient was introduced in PR #8747, but in this pr, go.mod has been set to 2.1.1 instead of 2.1.2: https://github.com/pingcap/tidb/pull/8747/files#diff-37aff102a57d3d7b797f152915a6dc16L53

And NewLocalPumpsClient was introduced in commit which tagged to 2.1.2

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Dec 26, 2018

And maybe we should introduce Reproducible builds to make sure every formal release not broken and can be verified.

@AstroProfundis
Copy link
Contributor

@WangXiangUSTC PTAL?

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Dec 28, 2018

Any update on this ?

@WangXiangUSTC
Copy link
Contributor

can you provide all your make log, like this:

[tidb@ip-172-16-30-67 tidb]$ make
CGO_ENABLED=0 GO111MODULE=on go build   -ldflags '-X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=v2.1.2" -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=2018-12-28 05:42:10" -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=1e06ccc019b86a67b6bad8a1e9288bd172e645e4" -X "github.com/pingcap/tidb/util/printer.TiDBGitBranch=HEAD" -X "github.com/pingcap/tidb/util/printer.GoVersion=go version go1.11.1 linux/amd64" ' -o bin/tidb-server tidb-server/main.go
go: extracting github.com/pingcap/tidb-tools v2.1.1-0.20181218072513-b2235d442b06+incompatible
Build TiDB Server successfully!

and you can try delete the tidb-tools' cache in your system in $GOPATH/pkg/mod, and then make again?

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Dec 28, 2018

We do not use the Makefile provided by upstream, instead, we use following scripts:

build() {
  export GOPATH="$srcdir/build"
  export PATH=$GOPATH/bin:$PATH
  export CGO_ENABLED=0

  cd $GOPATH/src/$_gopkgname

  GO111MODULE=on go build -o bin/tidb-server tidb-server/main.go
}

The while pkgbuild file can be found here: https://gist.github.com/Xuanwo/4ed59a2888361764795e4eeea974f415

We use devtools from arch to build the package which will create a new chroot, so I don't think the cache will be the problem.

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Dec 28, 2018

I also try to build tidb 2.1.2 directly with $GOPATH/pkg/mod/cache removed, and I facing this error:

:) ~/Code/go/src/github.com/pingcap/tidb (git)-[tags/v2.1.2]
:) git s
HEAD detached at v2.1.2
nothing to commit, working tree clean
:) ~/Code/go/src/github.com/pingcap/tidb (git)-[tags/v2.1.2]
:) CGO_ENABLED=0 GO111MODULE=on go build -o bin/tidb-server tidb-server/main.go
go: finding github.com/apache/thrift v0.0.0-20161221203622-b2a4d4ae21c7
go: finding github.com/beorn7/perks v0.0.0-20160229213445-3ac7bf7a47d1
go: finding github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e
go: finding github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db
go: finding github.com/dgrijalva/jwt-go v3.2.0+incompatible
go: finding github.com/spaolacci/murmur3 v0.0.0-20150829172844-0d12bf811670
go: finding github.com/grpc-ecosystem/grpc-gateway v1.4.1
go: finding github.com/pingcap/check v0.0.0-20171206051426-1c287c953996
go: finding github.com/coreos/bbolt v1.3.1-coreos.6
go: finding github.com/matttproud/golang_protobuf_extensions v1.0.1
go: finding github.com/prometheus/procfs v0.0.0-20180408092902-8b1c2da0d56d
go: finding github.com/montanaflynn/stats v0.0.0-20151014174947-eeaced052adb
go: finding github.com/cznic/mathutil v0.0.0-20160613104831-78ad7f262603
go: finding github.com/pingcap/tidb-tools v2.1.1-0.20181218072513-b2235d442b06+incompatible
go: finding github.com/google/btree v0.0.0-20161217183710-316fb6d3f031
go: finding github.com/BurntSushi/toml v0.3.1
go: finding github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58
go: finding github.com/ghodss/yaml v1.0.0
go: finding golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2
go: finding github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef
go: finding github.com/hpcloud/tail v1.0.0
go: finding github.com/prometheus/common v0.0.0-20180426121432-d811d2e9bf89
go: finding github.com/pingcap/errors v0.11.0
go: finding github.com/prometheus/client_golang v0.8.0
go: finding github.com/cznic/sortutil v0.0.0-20150617083342-4c7342852e65
go: finding github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f
go: finding golang.org/x/crypto v0.0.0-20180503215945-1f94bef427e3
go: finding gopkg.in/fsnotify.v1 v1.4.7
go: finding gopkg.in/natefinch/lumberjack.v2 v2.0.0-20161104145732-dd45e6a67c53
go: finding github.com/uber/jaeger-lib v1.1.0
go: finding github.com/golang/protobuf v1.1.0
go: finding github.com/ugorji/go v1.1.1
go: finding github.com/pingcap/gofail v0.0.0-20181217135706-6a951c1e42c3
go: finding github.com/opentracing/basictracer-go v1.0.0
go: finding github.com/pingcap/parser v0.0.0-20181207085916-6c21d4344dfa
go: finding golang.org/x/text v0.3.0
go: finding github.com/coreos/etcd v3.2.18+incompatible
go: finding github.com/pingcap/pd v2.1.0-rc.4+incompatible
go: finding golang.org/x/net v0.0.0-20180906233101-161cd47e91fd
go: finding github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf
go: finding github.com/pingcap/goleveldb v0.0.0-20171020084629-8d44bfdf1030
go: finding github.com/blacktear23/go-proxyprotocol v0.0.0-20171102103907-62e368e1c470
go: finding github.com/davecgh/go-spew v1.1.1
go: finding gopkg.in/yaml.v2 v2.2.1
go: finding github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5
go: finding github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385
go: finding github.com/cockroachdb/cmux v0.0.0-20170110192607-30d10be49292
go: finding github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18
go: finding github.com/stretchr/testify v1.2.2
go: finding github.com/onsi/ginkgo v1.7.0
go: finding github.com/gogo/protobuf v1.1.1
go: finding github.com/coreos/go-systemd v0.0.0-20180202092358-40e2722dffea
go: finding github.com/gorilla/mux v0.0.0-20170228224354-599cba5e7b61
go: finding github.com/pingcap/kvproto v0.0.0-20181109035735-8e3f33ac4929
go: finding github.com/coreos/go-semver v0.2.0
go: finding golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e
go: finding github.com/sirupsen/logrus v0.0.0-20170323161349-3bcb09397d6d
go: finding google.golang.org/grpc v1.12.0
go: finding github.com/go-sql-driver/mysql v0.0.0-20170715192408-3955978caca4
go: finding github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7
go: finding github.com/pingcap/tipb v0.0.0-20180910045846-371b48b15d93
go: finding github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20171020063731-82921fcf811d
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding github.com/onsi/gomega v1.4.1
go: finding github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff
go: finding github.com/jonboulle/clockwork v0.1.0
go: finding gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
go: finding golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
go: finding github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a
go: finding github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
go: finding github.com/opentracing/opentracing-go v1.0.2
go: finding github.com/pkg/errors v0.8.0
go: finding github.com/uber/jaeger-client-go v2.8.0+incompatible
go: finding github.com/twinj/uuid v0.0.0-20150629100731-70cac2bcd273
go: finding google.golang.org/genproto v0.0.0-20180427144745-86e600f69ee4
go: finding github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20160910222444-6b7015e65d36
go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: finding github.com/unrolled/render v0.0.0-20171102162132-65450fb6b2d3
go: finding github.com/fsnotify/fsnotify v1.4.7
go: downloading github.com/pingcap/pd v2.1.0-rc.4+incompatible
go: downloading golang.org/x/net v0.0.0-20180906233101-161cd47e91fd
go: downloading github.com/pingcap/kvproto v0.0.0-20181109035735-8e3f33ac4929
go: downloading github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20171020063731-82921fcf811d
go: downloading google.golang.org/grpc v1.12.0
go: verifying github.com/grpc-ecosystem/[email protected]: checksum mismatch
        downloaded: h1:68J4W1eby3GvUxsMVrCSGZOlHSWWZwP/4fZVwd9iCX0=
        go.sum:     h1:csWUAYcri3tWuLbspjXpc2o6GnE+6o89qj/ms/Py3OY=
CGO_ENABLED=0 GO111MODULE=on go build -o bin/tidb-server tidb-server/main.go  17.59s user 6.65s system 56% cpu 42.899 total
:) ~/Code/go/src/github.com/pingcap/tidb (git)-[tags/v2.1.2]
:) CGO_ENABLED=0 GO111MODULE=on go build -o bin/tidb-server tidb-server/main.go                                                                                           
go: downloading github.com/pingcap/pd v2.1.0-rc.4+incompatible
go: downloading golang.org/x/net v0.0.0-20180906233101-161cd47e91fd
go: downloading github.com/coreos/etcd v3.2.18+incompatible
go: downloading github.com/pingcap/kvproto v0.0.0-20181109035735-8e3f33ac4929
go: downloading google.golang.org/grpc v1.12.0
go: verifying github.com/pingcap/[email protected]: checksum mismatch
        downloaded: h1:E24nIxjoFlFkwCMaC7+KtHdxBZ79p1h++xEjhBXJw0M=
        go.sum:     h1:NAq95+VGsS2G7SjzZ5LP9iUlCMNAs13QUzbNY3G90v8=

It looks like go.sum is not updated correctly ?

@tiancaiamao
Copy link
Contributor

Try Go1.11.3

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Dec 28, 2018

After downgrade go to 1.11.3, problem solved.

So it's a bug in go modules ?

@tiancaiamao
Copy link
Contributor

Yes, you can google the result. Many user meets the same problem golang/go#29281

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Dec 28, 2018

Great, I add a workaround and it built successfuly, thank you for all~

@Xuanwo Xuanwo closed this as completed Dec 28, 2018
@Guru107
Copy link

Guru107 commented Dec 28, 2018

The release tag v2.1.2 Dockerfile still uses 1.10.1. I also faced the same issue.

@Xuanwo Xuanwo reopened this Apr 1, 2019
@Xuanwo
Copy link
Contributor Author

Xuanwo commented Apr 1, 2019

While building tidb 2.1.7, I still facing the checksum mismatch error.

verifying github.com/grpc-ecosystem/[email protected]: checksum mismatch
        downloaded: h1:68J4W1eby3GvUxsMVrCSGZOlHSWWZwP/4fZVwd9iCX0=
        go.sum:     h1:csWUAYcri3tWuLbspjXpc2o6GnE+6o89qj/ms/Py3OY=

I built it with following command:

CGO_ENABLED=1 GO111MODULE=on go build   -ldflags '-X github.com/pingcap/parser/mysql.TiDBReleaseVersion=2.1.7 -X github.com/pingcap/tidb/util/printer.TiDBGitHash=v2.1.7 -X github.com/pingcap/tidb/util/printer.TiDBGitBranch=master -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=2019-04-01 02:29:44" -X "github.com/pingcap/tidb/util/printer.GoVersion=go version go1.12.1 linux/amd64" ' -o bin/tidb-server tidb-server/main.go

Maybe we should do go clean -modcache and go mod tidy to fix the sum?

@tiancaiamao

Build log could be found here: https://gist.github.com/Xuanwo/c78aae49d223487558874907c5225908

@tiancaiamao
Copy link
Contributor

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Apr 1, 2019

Does this commit included in v2.1.7?

Arch uses go 1.12.1 to build.

@tiancaiamao
Copy link
Contributor

No, v2.1.7 is using go 1.11.3 @Xuanwo
https://github.com/pingcap/tidb/blob/v2.1.7/circle.yml#L6

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Apr 2, 2019

Got it.

@Xuanwo Xuanwo closed this as completed Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants