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: runtime_test execution of nm uses system go, not go in tree #7089

Open
randall77 opened this Issue Jan 9, 2014 · 6 comments

Comments

Projects
None yet
5 participants
@randall77
Contributor

randall77 commented Jan 9, 2014

check out tree
cd go/src
./make.bash
../bin/go test runtime -short

--- FAIL: TestRuntimeGogoBytes (0.10 seconds)
    runtime_test.go:113: go tool nm: exit status 1
        usage: nm [-aghnsSTu] file ...
FAIL

It's picking up the system-wide go (and thus nm) which is Go 1.2, not the one from
../bin/go which is tip.

Setting GOROOT before building fixes it.  This used to work, although I guess mostly by
accident (the system and tip nm's were compatible).  Any way we can fix this, or do I
have to start setting GOROOT all the time now?
@bradfitz

This comment has been minimized.

Member

bradfitz commented Jan 9, 2014

Comment 1:

Even when you set the GOROOT, I think it's still finding your system-wide "go" 1.2
binary, but "go tool nm" is then respecting Go 1.2.
All of our tests that exec.LookPath("go") should probably use the locally-built go
binary instead of whatever old thing is on the system.  It's more than just the runtime
package, IIRC.  runtime/race, runtime/pprof, os/signal, crypto/x509, ...
@bradfitz

This comment has been minimized.

Member

bradfitz commented Jan 9, 2014

Comment 2:

s/then respecting Go 1.2/then respecting GOROOT/
@minux

This comment has been minimized.

Member

minux commented Jan 10, 2014

Comment 3:

how about making the test query runtime.GOROOT and execute goroot/bin/go instead of
relying
on (the correct) cmd/go is in $PATH?
@rsc

This comment has been minimized.

Contributor

rsc commented Mar 3, 2014

Comment 4:

I would say you should put your development tree in your path ahead of other things if
you are going to run tests by hand. all.bash works, so this is purely about local
development. We could work to change tests to invoke the right "go", but the assumption
is going to creep back in, because nearly everyone working on Go already does put their
development bin directory ahead of the system bins. It's fine to change existing tests
if you'd like not to do this for some reason, but you'll probably have to keep fixing
them as new ones crop up.

Labels changed: added release-none.

Status changed to Accepted.

@rsc

This comment has been minimized.

Contributor

rsc commented Mar 3, 2014

Comment 5:

Owner changed to ---.

@griesemer

This comment has been minimized.

Contributor

griesemer commented Oct 1, 2014

Comment 6:

Labels changed: added repo-main.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc removed release-none labels Apr 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment