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

go/build: tests use a non-hermetic "go" binary #39198

Closed
bcmills opened this issue May 21, 2020 · 1 comment
Closed

go/build: tests use a non-hermetic "go" binary #39198

bcmills opened this issue May 21, 2020 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented May 21, 2020

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

$ go version
go version devel +567fe4650b Thu May 21 13:43:48 2020 -0400 linux/amd64

Does this issue reproduce with the latest release?

Yes.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/usr/local/google/home/bcmills/.cache/go-build"
GOENV="/usr/local/google/home/bcmills/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/usr/local/google/home/bcmills/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/usr/local/google/home/bcmills"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/google/home/bcmills/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/google/home/bcmills/go/pkg/tool/linux_amd64"
GCCGO="/usr/local/google/home/bcmills/bin/gccgo"
GOAMD64="alignedjumps"
AR="ar"
CC="gcc"
CXX="c++"
CGO_ENABLED="1"
GOMOD="/usr/local/google/home/bcmills/go/src/go.mod"
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-build456911771=/tmp/go-build -gno-record-gcc-switches"

What did you do?

~/go/src$ ls ~/minbin
ar  as  cat  clang  diff  echo  env  gcc  ld  pwd  uname  whoami

~/go/src$ PATH=~/minbin ../bin/go test go/build
--- FAIL: TestImportDirNotExist (0.00s)
    --- FAIL: TestImportDirNotExist/GO111MODULE=on (0.00s)
        build_test.go:356: Import(full, 0) got error: "go/build: go list go/build/doesnotexist: exec: \"go\": executable file not found in $PATH\n\n", want "cannot find package" or "is not in GOROOT" error
        build_test.go:356: Import(full, FindOnly) got error: "go/build: go list go/build/doesnotexist: exec: \"go\": executable file not found in $PATH\n\n", want "cannot find package" or "is not in GOROOT" error
--- FAIL: TestImportPackageOutsideModule (0.00s)
    build_test.go:480: error when importing package when no go.mod is present: got "go/build: go list example.com/p: exec: \"go\": executable file not found in $PATH\n\n"; want "cannot find module providing package"
FAIL
FAIL    go/build        0.107s
FAIL

What did you expect to see?

Tests run using the go command from the same GOROOT used to build the go/build test.

What did you see instead?

A test failure due to the go command not being present in PATH.

@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsFix The path to resolution is known, but the work has not been done. labels May 21, 2020
@bcmills bcmills added this to the Go1.15 milestone May 21, 2020
@bcmills bcmills self-assigned this May 21, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/234880 mentions this issue: all: use a hermetic "go" tool in standard-library tests

@golang golang locked and limited conversation to collaborators May 21, 2021
@rsc rsc unassigned bcmills Jun 23, 2022
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. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

2 participants