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

cmd/dist: cannot re-run tests #13501

Closed
paulzhol opened this issue Dec 5, 2015 · 4 comments
Closed

cmd/dist: cannot re-run tests #13501

paulzhol opened this issue Dec 5, 2015 · 4 comments
Milestone

Comments

@paulzhol
Copy link
Member

@paulzhol paulzhol commented Dec 5, 2015

After a successful run of ./all.bash or ./make.bash, cannot re-run tests:

../bin/go tool dist test --no-rebuild api

##### API check
import cycle not allowed
package fmt
    imports errors
    imports runtime
    imports runtime/internal/atomic
    imports runtime
2015/12/05 16:16:29 Failed: exit status 1

Also

../bin/go tool dist test api

##### Building packages and commands.
import cycle not allowed
package archive/tar
    imports bytes
    imports errors
    imports runtime
    imports runtime/internal/atomic
    imports runtime
net/http/h2_bundle.go:26:2: cannot find package "golang.org/x/net/http2/hpack" in any of:
    /home/yuval/Data/go-test/src/golang.org/x/net/http2/hpack (from $GOROOT)
    ($GOPATH not set)
can't load package: import cycle not allowed
package archive/tar
    imports bytes
    imports errors
    imports runtime
    imports runtime/internal/atomic
    imports runtime
cmd/internal/objfile/disasm.go:18:2: cannot find package "golang.org/x/arch/arm/armasm" in any of:
    /home/yuval/Data/go-test/src/golang.org/x/arch/arm/armasm (from $GOROOT)
    ($GOPATH not set)
cmd/internal/objfile/disasm.go:19:2: cannot find package "golang.org/x/arch/x86/x86asm" in any of:
    /home/yuval/Data/go-test/src/golang.org/x/arch/x86/x86asm (from $GOROOT)
    ($GOPATH not set)
2015/12/05 16:19:22 building packages and commands: exit status 1
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 5, 2015

Works for me.

Do you have GOROOT set in the environment?

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Dec 5, 2015
@paulzhol
Copy link
Member Author

@paulzhol paulzhol commented Dec 5, 2015

I'm not setting GOROOT explicitly, it appears in go env though.

env | grep ^GO

../bin/go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOOS="freebsd"
GOPATH=""
GORACE=""
GOROOT="/home/yuval/Data/go-test"
GOTOOLDIR="/home/yuval/Data/go-test/pkg/tool/freebsd_amd64"
GO15VENDOREXPERIMENT=""
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0"
CXX="clang++"
CGO_ENABLED="1"
@paulzhol
Copy link
Member Author

@paulzhol paulzhol commented Dec 5, 2015

It looks like I had an older version of go (go version go1.5.1 freebsd/amd64) in my PATH. If I clear it I'm getting

../bin/go tool dist test --no-rebuild api
2015/12/05 17:36:37 Error running go env CGO_ENABLED: exec: "go": executable file not found in $PATH

If I put the newly built go binary in the PATH then everything works as expected

PATH=~/Data/go-test/bin:$PATH ../bin/go tool dist test --no-rebuild api
##### API check
...

https://github.com/golang/go/blob/master/src/cmd/dist/test.go#L78 uses os/exec.Command so that's expected I guess.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 5, 2015

Yeah, I think for this limited use it's OK to rely on PATH. In normal use PATH will be set as needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.