'go tool dist' fails

Bug #1076017 reported by Mike Carifio
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
golang (Debian)
Fix Released
Unknown
golang (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

$ go tool dist
go tool dist: $GOROOT is not set correctly or not exported
 GOROOT=/usr/lib/go
 /usr/lib/go/include/u.h does not exist
go tool dist: exit status 1

This command is used to configure the GOPATH in the Intellij go plugin.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in golang (Ubuntu):
status: New → Confirmed
Revision history for this message
James Henstridge (jamesh) wrote :

I ran into this problem when trying to build https://github.com/nsf/gogobject

Here is a copy of the code being run in the dist tool, for reference:

    http://code.google.com/p/go/source/browse/src/cmd/dist/build.c

There seems to be two problems preventing the tool from functioning. FIrst, it is searching for include/u.h to verify that $GOROOT is probably correct (it doesn't actually care about the file contents).

Secondly, the tool still fails if we work around that when it tries to run "hg identify -b" to check for version information. This obviously fails because there is no repository. However, it looks like it only does this if a $GOROOT/VERSION file is not present.

So to get the tool to function correctly, I made the following changes:

    cd /usr/lib/go
    mkdir include
    touch include/u.h
    echo go1.0.2 > VERSION

The golang package should probably be modified to install the VERSION file. I'm not sure of the rationale behind not installing those headers, but if you don't install the headers, the tool should probably check for the presence of a different file.

Changed in golang (Debian):
status: Unknown → New
Changed in golang (Debian):
status: New → Fix Released
Changed in golang (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.