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

x/tools/go/packages: Fails to build with 1.11 #41383

Closed
codyoss opened this issue Sep 14, 2020 · 6 comments
Closed

x/tools/go/packages: Fails to build with 1.11 #41383

codyoss opened this issue Sep 14, 2020 · 6 comments
Labels
FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@codyoss
Copy link
Member

codyoss commented Sep 14, 2020

What version of Go are you using (go version)?

go version go1.11.13 linux/amd64

Does this issue reproduce with the latest release?

No

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build833573345=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Tried to build a module that relied on the latest x/tools commit with go 1.11.

What did you expect to see?

It built successfully.

What did you see instead?

Fails to build with 1.11.

# golang.org/x/tools/go/packages
/go/pkg/mod/golang.org/x/tools@v0.0.0-20200914190812-8f9ed77dd8e5/go/packages/golist_overlay.go:535:7: undefined: strings.ReplaceAll

The mod file declares 1.11 but uses strings.ReplaceAll which was added in 1.12.

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 14, 2020
@gopherbot gopherbot added this to the Unreleased milestone Sep 14, 2020
@davecheney
Copy link
Contributor

The mod file should be updated to go 1.14, the oldest supported release.

@mvdan
Copy link
Member

mvdan commented Sep 14, 2020

Any particular reason you're using Go 1.11? It's not even receiving security updates at this point.

@stamblerre
Copy link
Contributor

I think it just hasn't been updated since then. gopls CI currently does test with Go 1.12 and 1.13 since many people cannot update to the latest versions, so the go.mod should probably be updated to 1.12.

@codyoss
Copy link
Member Author

codyoss commented Sep 14, 2020

As of right now we support 1.11+. We like to maintain compatibility for older versions of Go as our cloud client libraries are used by many developers running in many different environments.

I don't expect that go1.11 stays maintained, just would like the mod file to be 1.12+ so the tooling can behave appropriately. I am assuming that go mod tidy will then find the correct version of the indirect dependency that we have on this lib when the mod file if updated.

@gopherbot
Copy link

Change https://golang.org/cl/254754 mentions this issue: tools, gopls: update Go versions in go.mod files to 1.12

@heschi
Copy link
Contributor

heschi commented Sep 14, 2020

@codyoss AFAIK the Go version is not considered when selecting versions. go get -u will still break the build.

@golang golang locked and limited conversation to collaborators Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

6 participants