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

runtime: External tests not run with the correct compiler #16577

quentinmit opened this issue Aug 2, 2016 · 4 comments


None yet
4 participants
Copy link

commented Aug 2, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go 1.7rc4
  2. What did you do?

$ cd go/
$ ./src/make.bash
$ ./bin/go test -short runtime

  1. What did you expect to see?
    Tests run with ./bin/go
  2. What did you see instead?
    Tests run with the first "go" in $PATH (in this case, the "go" on $PATH was broken, so the tests failed.)

@quentinmit quentinmit added this to the Go1.8Maybe milestone Aug 2, 2016


This comment has been minimized.

Copy link

commented Aug 2, 2016

I've run into this before as well. Recursive calls to "go build" from tests use the go from your path, not the go that was used to run "go test". There are two workarounds: use all.bash, or set up GOROOT/PATH with the directory you're running in.

I don't see any obvious fix. All these tests call testenv.MustHaveGoBuild(t) or variants, maybe we could have them return the right path to use?


This comment has been minimized.

Copy link

commented Aug 2, 2016

There's already this in testenv:

// GoToolPath reports the path to the Go tool.
// If the tool is unavailable GoToolPath calls t.Skip.
// If the tool should be available and isn't, GoToolPath calls t.Fatal.
func GoToolPath(t *testing.T) string {

There's probably stuff not using it.


This comment has been minimized.

Copy link

commented Aug 2, 2016

Excellent, that's new to me. We should use GoToolPath instead of the MustHaveGoBuild + "go" combo.
Same for MustHaveGoRun, I guess.


This comment has been minimized.

Copy link

commented Aug 30, 2016

CL mentions this issue.

@gopherbot gopherbot closed this in 842b058 Aug 30, 2016

@golang golang locked and limited conversation to collaborators Aug 30, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.