"go install -a" fails trying to rebuild internal Go packages

1,165 views
Skip to first unread message

Chris McGee

unread,
Oct 14, 2013, 8:11:25 PM10/14/13
to golan...@googlegroups.com
Hello All,

I have a command that I'm working on that depends on a library that I have in my GOPATH. After upgrading to Go 1.2RC1 I ran a "go install -a <mycmd>" to force it to recompile the command and the library it depends on. When I try this I get the following error:

go install runtime: open /usr/local/go/pkg/linux_amd64/runtime.a: permission denied

It appears that it is trying to recompile one of the Go runtime packages in the GOROOT and failing because the install directory is owned by root. I'm using godeb to manage my packages. I'm not sure if that makes a difference.

Is there a way to coerce it to recompile only packages that are in my local GOPATH and not the ones in the GOROOT?

Thanks,
Chris

Dave Cheney

unread,
Oct 14, 2013, 8:13:28 PM10/14/13
to Chris McGee, golang-nuts
rm -rf $GOPATH/pkg will do the job.
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/9120d622-e8a8-451f-941e-34899ae0a457%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Dave Cheney

unread,
Oct 14, 2013, 8:18:53 PM10/14/13
to Chris McGee, golang-nuts

Chris McGee

unread,
Oct 14, 2013, 8:27:56 PM10/14/13
to golan...@googlegroups.com, Chris McGee
Thank you for the workaround and the link!

Chris

Chris McGee

unread,
Oct 14, 2013, 8:32:42 PM10/14/13
to golan...@googlegroups.com, Chris McGee
It's odd that there's no mention of the "all" selector for go install/test/clean in the "go help" for any of those subcommands. I had no idea that it existed until I read this issue.

Dave Cheney

unread,
Oct 14, 2013, 8:35:17 PM10/14/13
to Chris McGee, golang-nuts
This was fixed at tip

http://tip.golang.org/cmd/go/#hdr-Description_of_package_lists
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/a03db4e0-8685-4bb5-ac2b-aaa02c185118%40googlegroups.com.

Chris McGee

unread,
Oct 14, 2013, 8:51:00 PM10/14/13
to golan...@googlegroups.com, Chris McGee
Ah great, thanks again.
Reply all
Reply to author
Forward
0 new messages