Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 500452 - dev-lang/go-1.2 should install tools (such as godoc)
Summary: dev-lang/go-1.2 should install tools (such as godoc)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: William Hubbs
URL: https://code.google.com/p/go/issues/d...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-06 01:22 UTC by Austin English (RETIRED)
Modified: 2015-08-23 15:57 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Austin English (RETIRED) gentoo-dev 2014-02-06 01:22:40 UTC
Trying to do code coverage with go fails:
go test -coverprofile=coverage.out
go tool: no such tool "cover"; to install:
	go get code.google.com/p/go.tools/cmd/cover

It seems the issue is that it's in a separate code base:

https://code.google.com/p/go.tools/ 
as opposed to:
https://code.google.com/p/go/

the upstream source tarball (for 1.2) does not contain these tools either. There's an upstream bug for this: https://code.google.com/p/go/issues/detail?id=6927

the ebuild could install those tools for the user, as a workaround until upstream gets their (packaging) act together.

As a workaround:
# GOPATH=/tmp/ go get code.google.com/p/go.tools/cmd/cover

Reproducible: Always

Steps to Reproduce:
go test -coverprofile=coverage.out



build1 ~ # eix dev-lang/go
[I] dev-lang/go
     Available versions:  1.1.2 1.2{tbz2} **9999 {bash-completion emacs vim-syntax zsh-completion}
     Installed versions:  1.2{tbz2}(12:52:25 AM 02/06/2014)(bash-completion vim-syntax -emacs -zsh-completion)
     Homepage:            http://www.golang.org
     Description:         A concurrent garbage collected and typesafe programming language
Comment 1 William Hubbs gentoo-dev 2014-02-07 07:28:11 UTC
Here is where upstream talks about the test coverage tool [1].
I'm not exactly comfortable with installing it automatically with the
dev-lang/go ebuild, because I think "go get" in that context is
installing from a live repository, and if I do that, we can't have a
stable dev-lang/go.

Thoughts?

[1] http://golang.org/doc/go1.2
Comment 2 Austin English (RETIRED) gentoo-dev 2014-02-07 19:43:49 UTC
(In reply to William Hubbs from comment #1)
> Here is where upstream talks about the test coverage tool [1].
> I'm not exactly comfortable with installing it automatically with the
> dev-lang/go ebuild, because I think "go get" in that context is
> installing from a live repository, and if I do that, we can't have a
> stable dev-lang/go.
> 
> Thoughts?
> 
> [1] http://golang.org/doc/go1.2

You could use a known revision from git.
Comment 3 Austin English (RETIRED) gentoo-dev 2014-02-07 19:44:14 UTC
(In reply to austinenglish@gmail.com from comment #2)
> (In reply to William Hubbs from comment #1)
> > Here is where upstream talks about the test coverage tool [1].
> > I'm not exactly comfortable with installing it automatically with the
> > dev-lang/go ebuild, because I think "go get" in that context is
> > installing from a live repository, and if I do that, we can't have a
> > stable dev-lang/go.
> > 
> > Thoughts?
> > 
> > [1] http://golang.org/doc/go1.2
> 
> You could use a known revision from git.

Err, mecurial..or whatever the hot VCS of the day is :)
Comment 4 William Hubbs gentoo-dev 2014-02-07 22:12:25 UTC
(In reply to austinenglish@gmail.com from comment #3)
> (In reply to austinenglish@gmail.com from comment #2)
> > You could use a known revision from git.
> 
> Err, mecurial..or whatever the hot VCS of the day is :)

Not directly. Go get doesn't let you do that, and Gentoo policy would require me to make a tarball snapshot and mirror it.

Also I wouldn't do this in the dev-lang/go package, it would be dev-lang/go-tools.
Comment 5 Austin English (RETIRED) gentoo-dev 2014-02-07 22:45:29 UTC
(In reply to William Hubbs from comment #4)
> (In reply to austinenglish@gmail.com from comment #3)
> > (In reply to austinenglish@gmail.com from comment #2)
> > > You could use a known revision from git.
> > 
> > Err, mecurial..or whatever the hot VCS of the day is :)
> 
> Not directly. Go get doesn't let you do that, and Gentoo policy would
> require me to make a tarball snapshot and mirror it.

Well, yeah, of course that won't work for go get. That's outside of portage's control, though, so I don't see why it matters.

> Also I wouldn't do this in the dev-lang/go package, it would be
> dev-lang/go-tools.

Works for me, ideally dev-lang/go would rdepend on dev-lang/go-tools, but as long as I can get it from portage I'm happy.
Comment 6 Andreas Klauer 2014-02-11 15:27:23 UTC
I was looking for godoc. Seems to be an essential tool because Go keeps telling you to use it (go help fmt -> For more about gofmt, see 'godoc gofmt'.). Unfortunately that's not part of the ebuild either so you have to http://golang.org/doc/install/source#tools

# go get code.google.com/p/go.tools/cmd/...

It would be nice if this could be incorporated in an ebuild somehow.
Comment 7 William Hubbs gentoo-dev 2014-02-11 20:19:17 UTC
Looking at the upstream bug, it looks like it will be better to wait for
them to fix this then encorporate their patch.
Comment 8 Marien Zwart (RETIRED) gentoo-dev 2014-02-22 13:05:03 UTC
Tweaking subject based on the assumption I'm not the only one specifically looking for "godoc".

As described in https://code.google.com/p/go/issues/detail?id=6654:

- the "godoc" tool (and other tools) cannot easily be installed as user: "go get code.google.com/p/go.tools/cmd/godoc" tries to install them into /usr/lib/go/, not the user's GOPATH. The "workaround" provided in this bug needs to be run as root, and writes into /usr/. It is therefore not a workaround I am willing to run.

- "it is NOT a goal to allow updating godoc or vet or cover or any other tool separately from the rest of the tree", so having these installed along with go itself makes more sense than having the user "go get" them from vcs.

If there is a workaround to install the tools without root privs, please share (preferably in the go ebuild, at least on this bug).
Comment 9 Johannes Kimmel 2014-04-28 09:14:20 UTC
On my opinion the go ebuild should include the go tools.  The popular opinion in #go-nuts was that a proper go distribution includes the tools.  Debian bundles them, too, and people seem to be happy.  
There seems no sane way to install the tools as a user other than setting the whole toolchain up oneself.
Comment 10 Marien Zwart (RETIRED) gentoo-dev 2015-05-17 07:10:35 UTC
Please package the tools (either in the go ebuild or a separate ebuild).

The linked issue was moved to https://github.com/golang/go/issues/6654 and closed. Upstream considers this working as intended.

Looking at upstream's misc/makerelease/makerelease.go, they bundle the latest revision on the release-branch.go1.4 branch of https://github.com/golang/tools/ with their binary releases. Ideally we'd convince upstream to start using tags in and/or source tarballs of that repository (corresponding to Go releases). You could then write ebuilds or include the tools in the dev-lang/go ebuild.

I agree upstream's release process is broken when it comes to the tools, but please consider working around it to provide feature parity between upstream's binary releases and what can be installed through ebuilds (or convince upstream to improve their release process: it's not ideal it's not obvious which sources go into their binary releases).
Comment 11 Zac Medico gentoo-dev 2015-05-27 04:18:33 UTC
I've added the following packages:

dev-go/go-crypto
dev-go/go-text
dev-go/go-net
dev-go/go-oauth2
dev-go/go-sys
dev-go/go-tools (installs godoc)
Comment 12 Marien Zwart (RETIRED) gentoo-dev 2015-05-27 11:17:56 UTC
Thanks! godoc works great. I'm not closing this in case there are other tools missing I don't know about.
Comment 13 William Hubbs gentoo-dev 2015-08-23 15:57:13 UTC
In Go 1.5, cover and vet are now part of the main go repository.
I am closing this bug; please open a new one if you are missing a
specific tool.

Thanks,

William