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/go: go build -x sometimes produces a script that won't run #3279

Closed
pjweinb opened this issue Mar 11, 2012 · 5 comments
Closed

cmd/go: go build -x sometimes produces a script that won't run #3279

pjweinb opened this issue Mar 11, 2012 · 5 comments
Milestone

Comments

@pjweinb
Copy link

pjweinb commented Mar 11, 2012

My GOROOT is /User/pjw/go.  I have a file /User/pjw/gostuff/src/linalg/linalg.go.

In /User/pjw/gostuff I execute go build -x linalg.  The second line of the output script
is
cd $GOROOTstuff/src/linalg
Of course $GOROOTstuff is not defined.

The problem is at (or near) line 892 of cmd/go/build.go in fmtcmd(), where it blindly
changes the /User/pjw/go prefix of /User/pjw/gostuff/src/linalg into $GOROOT.

(Maybe the right fix is to use ${GOROOT}?}
@alberts
Copy link
Contributor

alberts commented Mar 11, 2012

Comment 1:

There's a second problem in this area that is harder to solve. go test -x doesn't
produce the script command to remake _testmain.go. But this can probably be worked
around by keeping the work directory as long as everything else is valid script.

@dsymonds
Copy link
Contributor

Comment 2:

Labels changed: added priority-go1, toolbug, removed priority-triage.

Owner changed to @rsc.

Status changed to Accepted.

@fsouza
Copy link
Contributor

fsouza commented Mar 12, 2012

Comment 3:

https://golang.org/cl/5754076/
not sure if it is a good solution. rsc?

@rsc
Copy link
Contributor

rsc commented Mar 12, 2012

Comment 4:

http://golang.org/cl/5796068

@rsc
Copy link
Contributor

rsc commented Mar 12, 2012

Comment 5:

This issue was closed by revision 376fc74.

Status changed to Fixed.

@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants