cannot go get the source code

Bug #1662857 reported by 258189379@qq.com
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Eric Claude Jones
2.2
Won't Fix
High
Eric Claude Jones

Bug Description

The error is as below indicates that the context path error

get "gopkg.in/goose.v1/swift": found meta tag main.metaImport{Prefix:"gopkg.in/goose.v1", VCS:"git", RepoRoot:"https://gopkg.in/goose.v1"} at https://gopkg.in/goose.v1/swift?go-get=1
get "gopkg.in/goose.v1/swift": verifying non-authoritative meta tag
github.com/vmware/govmomi (download)
package github.com/juju/juju/cmd/juju
 imports context: unrecognized import path "context" (import path does not begin with hostname)

Revision history for this message
Anastasia (anastasia-macmood) wrote :

Could you please clarify what you are doing, steps to reproduce?
What version of Juju are you running?

Changed in juju-core:
status: New → Incomplete
Revision history for this message
258189379@qq.com (258189379-6) wrote :

I follow the github tutorial to get the source code for compiling as the follow command:
go get -d -v github.com/juju/juju/...

After a long term downloading and then got the error as below:

get "gopkg.in/goose.v1/swift": verifying non-authoritative meta tag
github.com/vmware/govmomi (download)
package github.com/juju/juju/cmd/juju
 imports context: unrecognized import path "context" (import path does not begin with hostname)

Revision history for this message
Anastasia (anastasia-macmood) wrote :

I am not clear whether you were following instructions from CONTRIBUTING (for example, https://github.com/juju/juju/blob/staging/CONTRIBUTING.md) or from README (for example, https://github.com/juju/juju/blob/staging/README.md).

A URL you are using would be helpful :)

Do you have GOPATH setup?

Revision history for this message
Joel Sing (jsing) wrote :

This happens if you follow the instructions in the juju README.md file (under the "Getting Juju" heading):

$ go version
go version go1.6.2 linux/amd64
$ GOPATH=~/go go get -d -v github.com/juju/juju/...
...
github.com/vmware/govmomi (download)
package github.com/juju/juju/cmd/juju
        imports context: unrecognized import path "context" (import path does not begin with hostname)

I believe this is due to the Juju code importing github.com/vmware/govmomi, which appears to depend on the context packaging being in the standard library, which is a Go 1.7 feature - using an older version of Go to get the Juju sources will now fail.

The options are likely to be:

- Require Go 1.7 to fetch/build Juju.

- Change the instructions to git clone juju, then use godeps to fetch the dependencies (instead of relying on `go get`).

- Import a version of govmomi that is version pinned to code prior to the switch to "context" imports.

Changed in juju-core:
status: Incomplete → Confirmed
Revision history for this message
Anastasia (anastasia-macmood) wrote :

Please follow instructions from https://github.com/juju/juju/blob/develop/CONTRIBUTING.md#dependency-management

You are missing build dependencies and need to run godeps tool before building juju.

Revision history for this message
Joel Sing (jsing) wrote :

While I understand the need for godeps before building, the instructions in the README.md tell you that you should fetch the code with:

  go get -d -v github.com/juju/juju/...

If you do this with Go 1.6 this fails, hence the bug reports.

I believe one of the following needs to be done:

- Document a minimum version of Go 1.7 (in which case the above go get command works)

- Replace the above go get command with a git clone, followed by godeps.

Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :

It seems like this is about Juju 2.x so moving to the "juju" project. "juju-core" is for Juju 1.25.

affects: juju-core → juju
Changed in juju:
status: Confirmed → Triaged
importance: Undecided → High
assignee: nobody → Menno Finlay-Smits (menno.smits)
milestone: none → 2.2.0
Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :

Juju 2.x now requires Go 1.8. I'm going to reword the documentation and reorganise some of the setup related Make targets.

Ian Booth (wallyworld)
Changed in juju:
milestone: 2.2.0 → 2.3-alpha1
Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :
Changed in juju:
assignee: Menno Finlay-Smits (menno.smits) → Eric Claude Jones (ecjones)
status: Triaged → In Progress
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → 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.