Skip to content

runtime: suggest use relative path in traceback #5840

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

Closed
chai2010 opened this issue Jul 5, 2013 · 5 comments
Closed

runtime: suggest use relative path in traceback #5840

chai2010 opened this issue Jul 5, 2013 · 5 comments

Comments

@chai2010
Copy link
Contributor

chai2010 commented Jul 5, 2013

for example:

    // Print during crash.
    //  main(0x1, 0x2, 0x3)
    //      /home/rsc/go/src/runtime/x.go:23 +0xf

to this style:

    // Print during crash.
    //  main(0x1, 0x2, 0x3)
    //      $(GOROOT)/src/runtime/x.go:23 +0xf

If i mv $(GOPATH) to new dir, the traceback output will changed
(and the `go build` output also changed).

I think use $(GOROOT) and $(GOPATH) relative path more better.
@davecheney
Copy link
Contributor

Comment 1:

I don't see how this would work. If you've moved your Go install from the place you've
compiled it to somewhere else then you need to override the value of $GOROOT embedded
into the go tool to make things work.
The better tool for this is to use GOROOT_FINAL when compiling Go.
It's hard to get excited about this, the path prefix of the code is much less
interesting than the other contents of the panic message.

@chai2010
Copy link
Contributor Author

chai2010 commented Jul 5, 2013

Comment 2:

if we check out the source code from the same Repository, use the same version.
we expect the `go build` ouput is same.
but the `go build` ouput depends on $GOROOT and $GOPATH absolute path.

@chai2010
Copy link
Contributor Author

chai2010 commented Jul 5, 2013

Comment 3:

if we check out the source code from the same Repository, use the same version.
we expect the `go build` output is same.
but the `go build` output depends on $GOROOT and $GOPATH absolute path.

@alberts
Copy link
Contributor

alberts commented Jul 8, 2013

Comment 4:

Maybe this is a request for bit-identical builds? issue #5170

@rsc
Copy link
Contributor

rsc commented Jul 8, 2013

Comment 5:

Full paths are intentional: a full path can be interpreted by other tools in ways that
relative paths or pseudo-paths cannot. You can change the eventual path with
$GOROOT_FINAL if that's the problem.

Status changed to WorkingAsIntended.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
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

5 participants