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

update to go 1.18 #2745

Merged
merged 4 commits into from
Mar 29, 2022
Merged

update to go 1.18 #2745

merged 4 commits into from
Mar 29, 2022

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Mar 22, 2022

Signed-off-by: CrazyMax crazy-max@users.noreply.github.com

@crazy-max crazy-max marked this pull request as draft March 22, 2022 09:24
@crazy-max
Copy link
Member Author

crazy-max commented Mar 22, 2022

#13 [stage-0 5/6] RUN --mount=target=/go/src/github.com/moby/buildkit --mount=target=/root/.cache,type=cache   GOARCH=amd64 golangci-lint run &&   GOARCH=arm64 golangci-lint run
#13 15.92 panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt

golangci/golangci-lint#2414

needs https://github.com/golangci/golangci-lint/releases/tag/v1.45.0

@crazy-max
Copy link
Member Author

 > [containerd 1/1] RUN --mount=from=containerd-src,src=/usr/src/containerd,readwrite --mount=target=/root/.cache,type=cache   git fetch origin   && git checkout -q "v1.6.1"   && make bin/containerd   && make bin/containerd-shim-runc-v2   && make bin/ctr   && mv bin /out:
#49 2.034 + bin/containerd
#49 2.047 go: inconsistent vendoring in /go/src/github.com/containerd/containerd:
#49 2.047 	github.com/containerd/containerd: is marked as replaced in vendor/modules.txt, but not replaced in go.mod
#49 2.047 
#49 2.047 	To ignore the vendor directory, use -mod=readonly or -mod=mod.
#49 2.047 	To sync the vendor directory, run:
#49 2.047 		go mod vendor
#49 2.047 make: *** [Makefile:230: bin/containerd] Error 1

@crazy-max
Copy link
Member Author

#13 14.28 cmd/buildkitd/debug.go:1: : error obtaining VCS status: exec: "git": executable file not found in $PATH
#13 14.28       Use -buildvcs=false to disable VCS stamping. (typecheck)
#13 14.28 package main
#13 14.28 frontend/dockerfile/cmd/dockerfile-frontend/main.go:1: : error obtaining VCS status: exec: "git": executable file not found in $PATH
#13 14.28       Use -buildvcs=false to disable VCS stamping. (typecheck)
#13 14.28 package main
#13 14.28 frontend/dockerfile/parser/dumper/main.go:1: : error obtaining VCS status: exec: "git": executable file not found in $PATH
#13 14.28       Use -buildvcs=false to disable VCS stamping. (typecheck)
#13 14.28 package main
#13 14.28 frontend/dockerfile/instructions/parse.go:728:23: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
#13 14.28       return errors.Errorf("%s requires at least two arguments, but only one was provided. Destination could not be determined.", command)
#13 14.28                            ^
#13 14.28 util/resolver/retryhandler/retry.go:63:52: SA1019: ne.Temporary is deprecated: Temporary errors are not well-defined. Most "temporary" errors are timeouts, and the few exceptions are surprising. Do not use this method. (staticcheck)
#13 14.28       if ne, ok := errors.Cause(err).(net.Error); ok && ne.Temporary() {
#13 14.28                                                         ^
#13 14.28 util/testutil/integration/run.go:213:9: SA1019: strings.Title is deprecated: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
#13 14.28       return strings.Title(fullname[dot:])
#13 14.28              ^
#13 14.28 solver/testutil/cachestorage_testsuite.go:390:9: SA1019: strings.Title is deprecated: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
#13 14.28       return strings.Title(fullname[dot:])
#13 14.28              ^
#13 ERROR: process "/bin/sh -c GOARCH=amd64 golangci-lint run &&   GOARCH=arm64 golangci-lint run" did not complete successfully: exit code: 1

@thaJeztah
Copy link
Member

For the strings.Title() deprecation warning, I'd recommend NOT following their advice. strings.Title() is perfectly fine for ASCII(ish) strings, and using golang.org/x/text for that is really too much (see moby/moby#43201 - it brings in 20k+ lines of code for no advantage at all)

@crazy-max crazy-max marked this pull request as ready for review March 22, 2022 16:13
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

Examples that use go need to be updated as well

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@@ -70,3 +70,16 @@ func retryError(err error) bool {

return false
}

// isTemporaryNetworkError returns false unless the error implements
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this. We already have a typed struct and that has Temporary() method. There is no need to pass it as an interface and then detect the method again. This looks like a very complicated(and not type-safe) way to trick the analysis in the linter.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@tonistiigi tonistiigi merged commit ade332e into moby:master Mar 29, 2022
@crazy-max crazy-max deleted the go1.18 branch April 6, 2022 17:09
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