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/sys: execabs isGo119ErrDot redeclared in go 1.15 #52668

Closed
scottTomaszewski opened this issue May 3, 2022 · 3 comments
Closed

x/sys: execabs isGo119ErrDot redeclared in go 1.15 #52668

scottTomaszewski opened this issue May 3, 2022 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@scottTomaszewski
Copy link

scottTomaszewski commented May 3, 2022

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

$ go version
go version go1.15.7 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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build372615255=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go 1.15 has issues with the isGo119ErrDot function being redeclared:

$ go get golang.org/x/tools/cmd/goimports
# golang.org/x/sys/execabs
root/go/src/golang.org/x/sys/execabs/execabs_go119.go:11:6: isGo119ErrDot redeclared in this block
	previous declaration at root/go/src/golang.org/x/sys/execabs/execabs_go118.go:9:31

You can reproduce the issue with this Docker file, run docker build . on it

FROM docker:20.10.12
RUN apk add curl git
RUN curl -LO "https://dl.google.com/go/go1.15.7.linux-amd64.tar.gz"
RUN tar -C /usr/local -xzf go1.15.7.linux-amd64.tar.gz
ENV PATH /usr/local/go/bin:${PATH}
RUN go version
RUN go env
RUN go get golang.org/x/tools/cmd/goimports

We started experiencing this issue after this change: https://cs.opensource.google/go/x/sys/+/b6088ccd6cba9272b1e5639ef2df5b5731b85abc

What did you expect to see?

No failure

@scottTomaszewski scottTomaszewski changed the title affected/package: x/sys: execab block redeclared in go 1.15 May 3, 2022
@gopherbot gopherbot added this to the Unreleased milestone May 3, 2022
@scottTomaszewski scottTomaszewski changed the title x/sys: execab block redeclared in go 1.15 x/sys: execabs isGo119ErrDot redeclared in go 1.15 May 3, 2022
@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label May 3, 2022
@bcmills
Copy link
Contributor

bcmills commented May 3, 2022

Note that per the release policy, Go 1.15 is no longer supported.

However, it's an easy fix and I don't see much harm in applying it (beyond enabling folks to use insecure, out-of-date Go releases).

@gopherbot
Copy link

Change https://go.dev/cl/403695 mentions this issue: execabs: add legacy "//+build" constraints

@bcmills bcmills self-assigned this May 3, 2022
@scottTomaszewski
Copy link
Author

Fixed, thank you 🙏

@rsc rsc unassigned bcmills Jun 22, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants