Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#38860 - [go] additional tools

Attached to Project: Community Packages
Opened by Tom Burdick (bfrog) - Monday, 10 February 2014, 16:42 GMT
Last edited by Alexander F. Rødseth (xyproto) - Saturday, 22 March 2014, 01:25 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Vesa Kaihlavirta (vegai)
Alexander F. Rødseth (xyproto)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 7
Private No

Details

Description:

Go provides additional tooling in separate repositories that require root and /usr installed files, would be nice to have these included in the Go package.

Additional info:
* go-1.2-2

Go Tools from https://code.google.com/p/go.tools/
* cover
* lint
* vet
* oracle
* imports
* docs (I believe this got moved to go.tools)
This task depends upon

Closed by  Alexander F. Rødseth (xyproto)
Saturday, 22 March 2014, 01:25 GMT
Reason for closing:  Fixed
Comment by Jesus Alvarez (demizer) - Saturday, 15 February 2014, 10:00 GMT
Cover and lint are incredibly useful. We could create a "go-tools" package like the D guys have done with "dtools" package. I would be willing to create the initial PKGBUILD if you all like.
Comment by Jesus Alvarez (demizer) - Saturday, 15 February 2014, 10:07 GMT
Forgot to mention, the "-cover" argument to the "go test" command requires the cover tool to be installed to

GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"

Using go get on an arbitrary GOPATH doesn't work since go get needs root permission to install into the tools directory.
Comment by Alexander F. Rødseth (xyproto) - Tuesday, 18 February 2014, 11:16 GMT
Thanks for the information, will consider including all the go tools together with the go package.
Comment by Alexander F. Rødseth (xyproto) - Monday, 24 February 2014, 14:08 GMT
I tried packaging the tools as a separate "go-tools" package, with all sorts of techniques, but the packaging proved elusive.

I also tried including the go tools in the go package, but had no luck with "go get" or other techniques within the PKGBUILD.

My next plan is to ask in the go forums how this problem is best attacked.
Comment by Alexander F. Rødseth (xyproto) - Wednesday, 26 February 2014, 16:21 GMT
The go package builds from sources fetched directly from mercurial now. This should fix the problem with godoc+GOROOT.

All that is left is figuring out how to best build/package to go tools together with the go package. Working on it.
Comment by Alexander F. Rødseth (xyproto) - Wednesday, 26 February 2014, 17:46 GMT
Found a fix, just have to test it a bit more.

EDIT: Didn't work. Still need to find a way to include the go tools, that works.
Comment by Alexander F. Rødseth (xyproto) - Tuesday, 04 March 2014, 23:14 GMT
Embedding godoc, cover and vet has proved elusive. Any PKGBUILD that solves this and includes them in the go package is warmly welcome.
I have tried many things, including using "go get" in the PKGBUILD.
Comment by Alexander F. Rødseth (xyproto) - Tuesday, 04 March 2014, 23:26 GMT
Found this PKGBUILD that may have solved it: https://aur.archlinux.org/packages/go/go-crosstool/PKGBUILD

Will try it out and add Daniel YC Lin as contributor if it works.
Comment by Alexander F. Rødseth (xyproto) - Thursday, 06 March 2014, 11:49 GMT
Fixed and tested. godoc and vet are now included. Building for x86_64 and i686 right now and will push to [community] when it's done.
Comment by Alexander F. Rødseth (xyproto) - Thursday, 06 March 2014, 15:09 GMT
When testing, it only works when building for x86_64 here, not i686. Trying to figure out why.
Comment by Jesus Alvarez (demizer) - Thursday, 06 March 2014, 15:24 GMT
Woo hoo! Thanks for the hard work!
Comment by Alexander F. Rødseth (xyproto) - Friday, 07 March 2014, 17:10 GMT
Thanks :) Not sure how to add the tools for i686 yet, though. :/

Building for i686 (without godoc/vet/lint) and x86_64 (with godoc/vet/lint) right now. Will push to [community] when it's done.

Suggestions and PKGBUILDS for how to include the tools on both i686 and x86_64 are warmly welcome.

I tried the go-hg package from AUR, but it would not build (in a chroot) for i686 either. See comments here: https://aur.archlinux.org/packages/go-hg/

Hopefully, having the tools included for the x86_64 version is better than not having them included at all. I assume that including them for x86_64 should at least cover one of the major use cases, which is running go on 64-bit servers.
Comment by John Luebs (jkluebs) - Saturday, 15 March 2014, 22:08 GMT
I built the go-hg package successfully in a 32-bit chroot. The erro reported is nothing more than a small typo in package().

In package() of that PKGBUILD, this line:
if [ $CARCH = x86 -a $platform = linux_386 ] ; then
needs to be this:
if [ $CARCH = i686 -a $platform = linux_386 ] ; then

CARCH is a arch/makepkg variable, and "x86" is not a valid value. linux_386 is the go platform identifier.
After that, it seems to work just fine.
Comment by John Luebs (jkluebs) - Saturday, 15 March 2014, 23:19 GMT
Comment by John Luebs (jkluebs) - Saturday, 15 March 2014, 23:47 GMT
The attached PKGBUILD seems to operate correctly for x86_64 and 32-bit chroots.
PKGBUILD.alt has similar changes but it is the style similar to go-hg.

Edit: The first PKGBUILD doesn't set GOPATH which failed when run in a clean system. I can't seem to delete it.
Comment by Alexander F. Rødseth (xyproto) - Sunday, 16 March 2014, 19:58 GMT
Thanks for putting effort into figuring this one out! Good catch with the x86/x86_64 typo in the go-hg package. (Just for the record, the PKGBUILD for the "go" package did not have this typo).

I'll try out the posted PKGBUILDs and see if I get any further with this. If not, I will ask for help on the go mailinglist.
Comment by Alexander F. Rødseth (xyproto) - Saturday, 22 March 2014, 00:57 GMT
Thank you, John Luebs! Building and testing the proposed PKGBUILD changes now.
Comment by Alexander F. Rødseth (xyproto) - Saturday, 22 March 2014, 01:25 GMT
It works! The updated package will appear in [community] shortly.

Loading...