Project

General

Profile

Actions

Story #11720

closed

Add dependency management for Go packages

Added by Tom Clegg over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
05/17/2017
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-

Description

Our Go packages (programs and libraries) need something analogous to bundler, so changes in our dependencies don't break our builds or introduce new code without giving us a chance to preview.

https://github.com/golang/go/wiki/PackageManagementTools

https://github.com/tools/godep seems like the most obvious choice.

https://github.com/kardianos/govendor might work.


Subtasks 1 (0 open1 closed)

Task #11723: ReviewResolvedNico César05/17/2017

Actions

Related issues 1 (0 open1 closed)

Related to Arvados - Bug #11717: vendor dir for crunch-run dependenciesClosed

Actions
Actions #1

Updated by Tom Clegg over 7 years ago

  • Description updated (diff)

The first godep problem I ran into was discussed on github:

FWIW: Now that work has started for a native solution [...] I'm likely not going to be working on godep very much. In the interim I'm suggesting people migrate to govendor (https://github.com/kardianos/govendor) if they are having problems with godep.

So, with govendor:

11720-govendor @ f3c054cba1141f95b74c6143b1842364153c664b

Actions #2

Updated by Tom Clegg over 7 years ago

  • Status changed from New to In Progress
Actions #3

Updated by Tom Clegg over 7 years ago

Procedure for updating dependencies:
  1. Ensure $GOPATH points somewhere (maybe ~/go)
  2. go get github.com/kardianos/govendor
  3. Either
    • add a symlink to a checked-out arvados tree:
      mkdir -p ${GOPATH}/src/git.curoverse.com && ln -sfT ${WORKSPACE} ${GOPATH}/src/git.curoverse.com/arvados.git
    • ...or check out the arvados tree the normal Go way:
      go get git.curoverse.com/arvados.git
  4. cd ${GOPATH}/src/git.curoverse.com/arvados.git && ${GOPATH}/bin/govendor update +v

"+v" means all vendor packages. You can also update a single dependency, etc. See https://github.com/kardianos/govendor

Now $GOPATH/src/git.coroverse.com/arvados.git/vendor/vendor.json is updated with new version specs. Run tests, commit, push.

Actions #5

Updated by Tom Clegg over 7 years ago

  • Target version set to 2017-05-24 sprint
Actions #6

Updated by Tom Clegg over 7 years ago

  • Assigned To set to Tom Clegg
Actions #7

Updated by Tom Clegg over 7 years ago

11720-govendor @ 865d1b22bb42a6c89ca9aa9a3513f3c61c6547c7 (missed adding vendor/.gitignore because it said to ignore itself)

Actions #8

Updated by Nico César over 7 years ago

in build/run-tests.sh

cd "$GOPATH/src/git.curoverse.com/arvados.git" && \
    "$GOPATH/bin/govendor" sync -v || \
        fatal "govendor sync failed" 

shouldn't be using GOROOT ? I had the impression GOPATH is a colon/comma separated values of the path, that in 95% of the time is only onve value,

but I could be wrong and this changed in later versions of Go

Actions #9

Updated by Tom Clegg over 7 years ago

Nico César wrote:

shouldn't be using GOROOT ? I had the impression GOPATH is a colon/comma separated values of the path, that in 95% of the time is only onve value,

That's true in general, but in run-tests.sh we set GOPATH to {tempdir}/GOPATH so I don't think we need to support the multi-value case.

(GOROOT is where stdlib and the go tools themselves live)

Actions #10

Updated by Nico César over 7 years ago

besides that LGTM

Actions #11

Updated by Tom Clegg over 7 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:b22ff6242148a9b37baef6c74701fa85a8765adf.

Actions

Also available in: Atom PDF