janelia-flyem / dvid

Distributed, Versioned, Image-oriented Dataservice
http://dvid.io
Other
197 stars 33 forks source link

gocloud.dev git repo #346

Closed stuarteberg closed 4 years ago

stuarteberg commented 4 years ago

Recently, the following lines were added to scripts/get-go-dependencies.sh:

# Go Cloud Development Kit
go get gocloud.dev
go get github.com/google/wire
go get golang.org/x/xerrors

As usual, a corresponding entry was added to scripts/conda-recipe/meta.yaml to speed up the build by caching the git repo of the new dependency:

  # go cloud dev kit
  - git_url: https://gocloud.dev
    git_tag: master
    folder:  src/gocloud.dev

...but unfortunately https://gocloud.dev is not a git repo, so the build fails. I'm not sure what git repo we should be caching instead. For now, I've simply commented out the new lines in meta.yaml. We should fix that eventually.

DocSavage commented 4 years ago

Unfortunately, it seems the aliasing is breaking things. I believe git calls to gocloud.dev might work, hence why go get gocloud.dev works. We could simply change all those reference to the actual github repo: https://github.com/google/go-cloud

DocSavage commented 4 years ago

I'll see if I move to the actual github repo and also pin to v0.19.0 whether things are better.

stuarteberg commented 4 years ago

Unfortunately, it seems the aliasing is breaking things. I believe git calls to gocloud.dev might work

Looks like they don't:

$ git clone https://gocloud.dev
Cloning into 'gocloud.dev'...
fatal: repository 'https://gocloud.dev/' not found

We could simply change all those reference to the actual github repo: https://github.com/google/go-cloud

Yeah, I thought about doing that, but didn't have time for trial-and-error this morning.

It would be nice to also figure out which repos to use for the other two go get commands:

go get github.com/google/wire
go get golang.org/x/xerrors
DocSavage commented 4 years ago

The golang.org/x/xerrors isn't a valid git directory. I think what we're seeing here is a divergence of the go modules referencing and the standard git references. In which case, we may just have to drop the conda caching.

DocSavage commented 4 years ago

Also, it looks like we can't simply use the github version of gocloud.dev because code inside that git version makes references to gocloud.dev as well. package github.com/google/go-cloud: code in directory /Users/katzw/work-go/src/github.com/google/go-cloud expects import "gocloud.dev"

stuarteberg commented 4 years ago

Will this work?

 # go cloud dev kit
  - git_url: https://github.com/google/go-cloud
    git_tag: master
    folder:  src/gocloud.dev

That is:

git clone https://github.com/google/go-cloud $GOPATH/src/gocloud.dev
DocSavage commented 4 years ago

It seems to work and makes sense. We stick with gocloud.dev references within all Go code, and then just use that github repo as a source. I also added github.com/google/wire but couldn't find a git repo for xerrors so we'll just leave it out.