Masterminds / glide

Package Management for Golang
https://glide.sh
Other
8.15k stars 540 forks source link

useing stash repo with glide #611

Open yasharya1984 opened 8 years ago

yasharya1984 commented 8 years ago

Using glide version : 0.12.2

Sample yaml : package: stash.verizon.com/abc/myproj import: - package: stash.verizon.com/abc/config repo: http://stash.verizon.com/scm/abc/config.git vcs: git ref: develop

Above sample works if there is no further local dependency other than git hub one which glide understands. Now if this config again imports multiple libraries like "stash.verizon.com/abc/xyz". I do not want to write all these dependent in yaml file. Basically i want glide to find out further dependencies and use "http://stash.verizon.com" as repo for them.

Currently i am getting following error : [WARN] Unable to checkout stash.verizon.com/abc/xyz [ERROR] Error looking for stash.verizon.com/abc/xyz: Cannot detect VCS

sdboyer commented 8 years ago

It's an interesting idea, but...

Having glide not only infer repository locations from import paths, but infer new patterns from the manifest for inferring repository locations would quickly become a rat's nest. In what order are the patterns read in? How general should the inferred patterns be? How would inferred patterns interact when they suggest something slightly different? What does "suggesting something slightly different" even mean?

It would also break importability of any manifest expecting that to happen, as there's no sane algorithm for picking dependencies if, every time you pick a dependency, this inference from the manifest has the potential to change the way that you interpret the import path/names of all your other dependencies.

It seems like your immediate need would be solved by simply using the import path "stash.verizon.com/scm/abc/config.git" directly (no need for a repo: directive, then), and "stash.verizon.com/scm/abc/xyz.git" for the other one. Would it not?

yasharya1984 commented 8 years ago

No it would not. I have 20-25 repo which multi level dependencies. If i include one repo then it may come with 15 other dependencies. I do not want to calculate that manually or work on the returned errors. And it is not working without giving repo: directive. [WARN] Unable to checkout stash.verizon.com/scm/abc/config.git [ERROR] Update failed for stash.verizon.com/scm/abc/config.git: Unable to get repository [ERROR] Failed to do initial checkout of config: Unable to get repository

If i can tell (top level configuration) for all packages starting with "stash.verizon.com" use repo "http://stash.verizon.com/scm/", vcs:git and ref:"master" then it would do the trick for me.

jonaz commented 8 years ago

Im having a similiar problem trying to adopt glide in our organization.

This works fine:

go get stash.domain.local/a/internal-libs.git/go/dao

My custom ssh config looks like this to make go get work:

Host stash.domain.local
    HostName stash.domain.local
    Port 7999
    User git

But with glide install it does NOT work fine. glide init make this config:

- package: stash.domain.local/a/internal-libs.git
  subpackages:
  - go/dao

And then glide install errors out:

[INFO]  Lock file (glide.lock) does not exist. Performing update.
[INFO]  Downloading dependencies. Please wait...
[INFO]  --> Fetching updates for github.com/facebookgo/inject.
[INFO]  --> Fetching updates for github.com/gin-gonic/gin.
[INFO]  --> Fetching updates for github.com/satori/go.uuid.
[INFO]  --> Fetching updates for gopkg.in/redis.v3.
[INFO]  --> Fetching updates for gopkg.in/tylerb/graceful.v1.
[INFO]  --> Fetching stash.domain.local/a/internal-libs.git.
[INFO]  --> Fetching updates for github.com/lib/pq.
[INFO]  --> Fetching updates for golang.org/x/crypto.
[INFO]  --> Fetching updates for github.com/koding/multiconfig.
[WARN]  Unable to checkout stash.domain.local/a/internal-libs.git
[ERROR] Update failed for stash.domain.local/a/internal-libs.git: Unable to get repository
[ERROR] Failed to do initial checkout of config: Unable to get repository

Why is not glide install using same logic as go get when talking to git?