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: remove special-case that puts godoc in $GOROOT/bin #15106

Closed
DeedleFake opened this issue Apr 4, 2016 · 8 comments
Closed

cmd/go: remove special-case that puts godoc in $GOROOT/bin #15106

DeedleFake opened this issue Apr 4, 2016 · 8 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@DeedleFake
Copy link

  1. What version of Go are you using (go version)?

    go version go1.6 linux/amd64

  2. What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="$HOME/devel/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
  1. What did you do?
go get -v golang.org/x/tools/cmd/godoc
  1. What did you expect to see?
    godoc gets installed to $GOPATH/bin/godoc.

  2. What did you see instead?

    go install golang.org/x/tools/cmd/godoc: open /usr/lib/go/bin/godoc: permission denied

On Arch Linux, and, I assume, most other distributions that have a Go package in their repositories, $GOROOT is set to a directory that all users have access to. On Arch, it gets set to /usr/lib/go/. This means that installing godoc via go get can only be done by root because it is hardwired in the go tool (pkg.go:703) to install to $GOROOT/bin.

@bradfitz
Copy link
Contributor

bradfitz commented Apr 7, 2016

I believe this was intentional, as part of the transition of moving godoc out of the standard library. But maybe it's time to reconsider that. @adg, @robpike?

@bradfitz bradfitz added this to the Unplanned milestone Apr 7, 2016
@robpike
Copy link
Contributor

robpike commented Apr 7, 2016

-me, +@rsc

@adg
Copy link
Contributor

adg commented Apr 8, 2016

I think we should probably remove the special case for Go 1.7.
Once this was necessary to make go doc work, but cmd/doc has made that unnecessary.

The release-builder tool can take care of putting godoc in $GOROOT/bin for binary releases.

@adg adg changed the title cmd/go: godoc is hardwired to install to GOROOT/bin cmd/go: remove special-case that puts godoc in $GOROOT/bin Apr 8, 2016
@adg adg removed the Thinking label Apr 8, 2016
@adg adg modified the milestones: Go1.7, Unplanned Apr 8, 2016
@gopherbot
Copy link

CL https://golang.org/cl/21701 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/21703 mentions this issue.

gopherbot pushed a commit that referenced this issue Apr 10, 2016
Updates #15106

Change-Id: I4214b841d63bb7e9c3c5ede2abe21a8a68f06c41
Reviewed-on: https://go-review.googlesource.com/21701
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@adg
Copy link
Contributor

adg commented Apr 10, 2016

I have submitted the fix to cmd/go, but will hold off on submitting the corresponding change to x/build/cmd/release until just before Go 1.7 beta1. Keep this issue open and associated with the Go 1.7 milestone until then.

@quentinmit
Copy link
Contributor

Ping @adg. We're closing in on the beta release, so it's about time to submit your CL.

@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label May 26, 2016
@adg
Copy link
Contributor

adg commented May 26, 2016

Thanks for the reminder @quentinmit!

@golang golang locked and limited conversation to collaborators May 26, 2017
@rsc rsc unassigned adg Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants