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

Upgrade github.com/pingcap/tidb/pkg/parser #948

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

Tang8330
Copy link
Contributor

It was using an old version of tidb/pkg/parser that was causing Linux failures when building a Go binary.

   • building                                       binary=dist/artie-reader_linux_386/reader
  ⨯ release failed after 2s                  error=failed to build for linux_386: exit status 1: # github.com/pingcap/tidb/pkg/parser/mysql
../../../../pkg/mod/github.com/pingcap/tidb/pkg/[email protected]/mysql/const.go:459:2: cannot use 1 << iota (untyped int constant 2147483648) as SQLMode value in constant declaration (overflows)
../../../../pkg/mod/github.com/pingcap/tidb/pkg/[email protected]/mysql/const.go:460:2: cannot use 1 << iota (untyped int constant 4294967296) as SQLMode value in constant declaration (overflows)
../../../../pkg/mod/github.com/pingcap/tidb/pkg/[email protected]/mysql/util.go:44:19: cannot use 4294967295 (untyped int constant) as int value in struct literal (overflows)
../../../../pkg/mod/github.com/pingcap/tidb/pkg/[email protected]/mysql/util.go:45:19: cannot use 4294967295 (untyped int constant) as int value in struct literal (overflows)

make: *** [release] Error 1

@dveeden
Copy link
Collaborator

dveeden commented Nov 18, 2024

Seems related to #929

@Tang8330
Copy link
Contributor Author

Tang8330 commented Nov 18, 2024

Go version would be ideal to follow the release policy and that seems like there's no activity on the GH issue you've linked?

I'm particularly interested in getting the dependency updated so it can unbreak our builds.

@dveeden Any ideas on how we can get this in? Let me know if you'd like me to decouple upgrading the Go version from the dependency change (it automatically happened via go get -u ...)

@dveeden
Copy link
Collaborator

dveeden commented Nov 18, 2024

Yes, I get almost the same result with a go get -u

$ go get -u github.com/pingcap/tidb/pkg/parser 
go: upgraded go 1.18 => 1.22
go: added toolchain go1.23.3
go: upgraded github.com/pingcap/errors v0.11.5-0.20221009092201-b66cddb77c32 => v0.11.5-0.20240620035150-b3526907a872
go: upgraded github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c => v0.0.0-20240528011301-b51a646c7c86
go: upgraded github.com/pingcap/log v1.1.1-0.20230317032135-a0d097d16e22 => v1.1.1-0.20240314023424-862ccc32f18d
go: upgraded github.com/pingcap/tidb/pkg/parser v0.0.0-20231103042308-035ad5ccbe67 => v0.0.0-20241118182902-d86a3669d783
go: upgraded go.uber.org/goleak v1.2.1 => v1.3.0
go: upgraded go.uber.org/zap v1.26.0 => v1.27.0
go: upgraded golang.org/x/text v0.13.0 => v0.20.0

For the toolchain line: https://go.dev/doc/toolchain

@dveeden
Copy link
Collaborator

dveeden commented Nov 18, 2024

I don't fully get why your build breaks and mine (and CI) doesn't?

@Tang8330
Copy link
Contributor Author

I don't fully get why your build breaks and mine (and CI) doesn't?

Hm, I'm not sure how to answer this q. This broke on our repo: https://github.com/artie-labs/reader, running make release and the stacktrace is in the description of the PR.

@@ -1,6 +1,8 @@
module github.com/go-mysql-org/go-mysql

go 1.18
go 1.22
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So 1.22 and 1.23 are in supported status now and 1.21 is not anymore.

https://go.dev/doc/devel/release

@dveeden
Copy link
Collaborator

dveeden commented Nov 18, 2024

I don't fully get why your build breaks and mine (and CI) doesn't?

Hm, I'm not sure how to answer this q. This broke on our repo: https://github.com/artie-labs/reader, running make release and the stacktrace is in the description of the PR.

I tried a make release but that didn't work as I didn't have goreleaser installed. After that it complained about error=missing GITHUB_TOKEN, GITLAB_TOKEN and GITEA_TOKEN and then I tried make build which resulted in error=git tag v0.1.96 was not made against commit 04f3a34111bc8b9c750882329ad03b3a279b48e6. Finally I tried go build which resulted in a reader binary:

$ go version -m reader | grep -E '^\s*build|tidb/pkg/parser'
	dep	github.com/pingcap/tidb/pkg/parser	v0.0.0-20231103042308-035ad5ccbe67	h1:m0RZ583HjzG3NweDi4xAcK54NBBPJh+zXp5Fp60dHtw=
	build	-buildmode=exe
	build	-compiler=gc
	build	CGO_ENABLED=1
	build	CGO_CFLAGS=
	build	CGO_CPPFLAGS=
	build	CGO_CXXFLAGS=
	build	CGO_LDFLAGS=
	build	GOARCH=amd64
	build	GOOS=linux
	build	GOAMD64=v3
	build	vcs=git
	build	vcs.revision=04f3a34111bc8b9c750882329ad03b3a279b48e6
	build	vcs.time=2024-11-17T17:42:29Z
	build	vcs.modified=false

@dveeden
Copy link
Collaborator

dveeden commented Nov 18, 2024

This fails for a 32-bit build.

$ GOARCH=386 go build
# github.com/pingcap/tidb/pkg/parser/mysql
/home/dvaneeden/go/pkg/mod/github.com/pingcap/tidb/pkg/[email protected]/mysql/const.go:459:2: cannot use 1 << iota (untyped int constant 2147483648) as SQLMode value in constant declaration (overflows)
/home/dvaneeden/go/pkg/mod/github.com/pingcap/tidb/pkg/[email protected]/mysql/const.go:460:2: cannot use 1 << iota (untyped int constant 4294967296) as SQLMode value in constant declaration (overflows)
/home/dvaneeden/go/pkg/mod/github.com/pingcap/tidb/pkg/[email protected]/mysql/util.go:44:19: cannot use 4294967295 (untyped int constant) as int value in struct literal (overflows)
/home/dvaneeden/go/pkg/mod/github.com/pingcap/tidb/pkg/[email protected]/mysql/util.go:45:19: cannot use 4294967295 (untyped int constant) as int value in struct literal (overflows)

I still think we should upgrade this package, but you might also want to check if you intended to build 32-bit builds instead of 64-bit

@dveeden
Copy link
Collaborator

dveeden commented Nov 18, 2024

@Tang8330 you might want to send a PR to add Artie Reader to this list: https://github.com/shlomi-noach/awesome-mysql

Also, if you want to add TiDB support, we have TiCDC, which can also do the debezium message format: https://docs.pingcap.com/tidb/stable/ticdc-debezium So not sure if it makes sense to add support in Artie Reader or if you can/want to re-use TiCDC.

@lance6716 lance6716 merged commit b1f4fb3 into go-mysql-org:master Nov 19, 2024
13 checks passed
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 this pull request may close these issues.

3 participants