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: TestImportDirNotExist fails when running all.bash #36867

Closed
vovapi opened this issue Jan 29, 2020 · 5 comments
Closed

go/build: TestImportDirNotExist fails when running all.bash #36867

vovapi opened this issue Jan 29, 2020 · 5 comments
Labels
FrozenDueToAge modules 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

@vovapi
Copy link
Contributor

vovapi commented Jan 29, 2020

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

$ go version
go version go1.13.7 darwin/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="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/vladimir/Library/Caches/go-build"
GOENV="/Users/vladimir/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/vladimir/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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=/var/folders/rn/t2tk57cn2h7f2kbbhpy0vx7h0000gq/T/go-build571665734=/tmp/go-build -gno-record-gcc-switches -fno-common"
Running on macOS Catalina 10.15.2

What did you do?

I follow contribution guide

$ git clone https://go.googlesource.com/go
$ cd go/src
$ ./all.bash  

What did you expect to see?

...
ALL TESTS PASSED

What did you see instead?

...
--- FAIL: TestImportDirNotExist (0.03s)
    build_test.go:346: Import(full, 0) got error: "package go/build/doesnotexist is not in GOROOT (/Users/vladimir/golang/go/src/go/build/doesnotexist)", want "cannot find package" error
    build_test.go:346: Import(full, FindOnly) got error: "package go/build/doesnotexist is not in GOROOT (/Users/vladimir/golang/go/src/go/build/doesnotexist)", want "cannot find package" error
FAIL
FAIL    go/build        0.884s
...
FAIL
go tool dist: Failed: exit status 1

Possible cause

The issue seems to be caused by GO111MODULES turned on by default. If I set GO111MODULES=off in run.bash everything works fine.

@bcmills bcmills self-assigned this Jan 29, 2020
@bcmills bcmills added modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 29, 2020
@bcmills bcmills added this to the Backlog milestone Jan 29, 2020
@bcmills
Copy link
Contributor

bcmills commented Jan 29, 2020

This appears to have regressed in CL 199840. Should be a pretty easy fix.

@bcmills bcmills added the Testing An issue that has been verified to require only test changes, not just a test failure. label Jan 29, 2020
@bcmills bcmills modified the milestones: Backlog, Go1.14 Jan 29, 2020
@bcmills
Copy link
Contributor

bcmills commented Jan 29, 2020

I was mistaken. The actual regression was in CL 210339.

@bcmills
Copy link
Contributor

bcmills commented Jan 29, 2020

I was mistaken again. 😅

I actually bisected the failure properly this time, and it's from CL 203820, for #34860.

@vovapi
Copy link
Contributor Author

vovapi commented Jan 29, 2020

Yep. I bisected it too and got CL 203820

@gopherbot
Copy link

Change https://golang.org/cl/216817 mentions this issue: go/build: update TestImportDirNotExist to accept more detailed error strings

@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 29, 2020
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 29, 2020
@golang golang locked and limited conversation to collaborators Jan 28, 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 modules 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

3 participants