Skip to content

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

Closed

Description

@scottTomaszewski

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

Activity

  1. changed the title [-]affected/package: [/-] [+]x/sys: execab block redeclared in go 1.15[/+] on May 3, 2022
  2. added this to the Unreleased milestone on May 3, 2022
  3. changed the title [-]x/sys: execab block redeclared in go 1.15[/-] [+]x/sys: execabs isGo119ErrDot redeclared in go 1.15[/+] on May 3, 2022
  4. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on May 3, 2022
  5. bcmills commented on May 3, 2022

    @bcmills
    Contributor

    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).

  6. gopherbot commented on May 3, 2022

    @gopherbot
    Contributor

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

  7. self-assigned this
    on May 3, 2022
  8. scottTomaszewski commented on May 3, 2022

    @scottTomaszewski
    Author

    Fixed, thank you 🙏

  9. locked and limited conversation to collaborators on Jun 22, 2023
  10. added a commit that references this issue on Jun 7, 2024
    988cb79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions