Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Cannot vendor github.com/lib/pq #790

Closed
stub42 opened this issue Jun 26, 2017 · 6 comments · Fixed by #857
Closed

Cannot vendor github.com/lib/pq #790

stub42 opened this issue Jun 26, 2017 · 6 comments · Fixed by #857
Labels

Comments

@stub42
Copy link

stub42 commented Jun 26, 2017

What version of Go (go version) and dep (git describe --tags) are you using?

go version go1.8.3 linux/amd64

What dep command did you run?

In a hello world example:

package main

import (
	"fmt"
	_ "github.com/lib/pq"
)

func main() {
	fmt.Println("vim-go")
}

I ran:

dep init -v

What did you expect to see?

github.com/lib/pq vendored like any other dependency

What did you see instead?

A confusing failure. Not a git repository, but enough of a git repository to see the remote branches?

$ dep init -v
Root project is "stub/hello"
 1 transitively valid internal packages
 1 external packages imported from 1 projects
(0)   ✓ select (root)
(1)	? attempt github.com/lib/pq with 1 pkgs; 6 versions to try
(1)	    try github.com/lib/pq@master
(1)	✗   unable to update repository: fatal: Not a git repository (or any of the parent directories): .git
(1)	    try github.com/lib/pq@1895-fix
(1)	✗   unable to update repository: fatal: Not a git repository (or any of the parent directories): .git
(1)	    try github.com/lib/pq@499
(1)	✗   unable to update repository: fatal: Not a git repository (or any of the parent directories): .git
(1)	    try github.com/lib/[email protected]
(1)	✗   unable to update repository: fatal: Not a git repository (or any of the parent directories): .git
(1)	    try github.com/lib/pq@pgpass
(1)	✗   unable to update repository: fatal: Not a git repository (or any of the parent directories): .git
(1)	    try github.com/lib/[email protected]
(1)	✗   unable to update repository: fatal: Not a git repository (or any of the parent directories): .git
(1)	  ← no more versions of github.com/lib/pq to try; begin backtrack
  ✗ solving failed

Solver wall times by segment:
     b-source-exists: 6.321992483s
         b-list-pkgs:   43.45328ms
            new-atom:     328.36µs
             satisfy:    304.534µs
         select-root:    283.162µs
  b-deduce-proj-root:     58.775µs
     b-list-versions:     25.679µs
               other:      7.237µs

  TOTAL: 6.36645351s

No versions of github.com/lib/pq met constraints:
	master: unable to update repository: fatal: Not a git repository (or any of the parent directories): .git

	1895-fix: unable to update repository: fatal: Not a git repository (or any of the parent directories): .git

	499: unable to update repository: fatal: Not a git repository (or any of the parent directories): .git

	go1.0: unable to update repository: fatal: Not a git repository (or any of the parent directories): .git

	pgpass: unable to update repository: fatal: Not a git repository (or any of the parent directories): .git

	go1.0-cutoff: unable to update repository: fatal: Not a git repository (or any of the parent directories): .git
@stub42
Copy link
Author

stub42 commented Jun 26, 2017

Cleaning out $GOPATH (removing $GOPATH/pkg and everything in $GOPATH/src that isn't mine) got it working. Something being used as a cache in here must have been bogus.

@darkowlzz
Copy link
Collaborator

Thanks for reporting. I think we had similar issues before dep v0.1.0, which was fixed before the release.
@stub42 can you check your version of dep? (git describe --tags in $GOPATH/src/github.com/golang/dep directory)

@stub42
Copy link
Author

stub42 commented Jun 30, 2017

I have been testing trunk, so probably 77df563 .

govendor and 'go get' where the other tools that might have pulled things in.

@kron4eg
Copy link

kron4eg commented Jun 30, 2017

Same go file, with current dep master g4bfa359

$ $GOPATH/bin/dep init -v
Root project is "bla"
 1 transitively valid internal packages
 1 external packages imported from 1 projects
(0)   ✓ select (root)
(1)	? attempt github.com/lib/pq with 1 pkgs; 6 versions to try
(1)	    try github.com/lib/pq@master
(1)	✓ select github.com/lib/pq@master w/2 pkgs
  ✓ found solution with 2 packages from 1 projects

Solver wall times by segment:
     b-source-exists: 3.227709763s
         b-list-pkgs: 155.588644ms
              b-gmal: 146.187271ms
             satisfy:    111.756µs
         select-atom:     86.532µs
            new-atom:     70.982µs
         select-root:     70.592µs
  b-deduce-proj-root:      30.68µs
     b-list-versions:     13.207µs
               other:      6.749µs

  TOTAL: 3.529876176s

  Using master as constraint for direct dep github.com/lib/pq
  Locking in master (8837942) for direct dep github.com/lib/pq

@stub42 probably you use git submodules, inside docker maybe. I saw such case when .git inside container gets detached from it's main database.

@stub42
Copy link
Author

stub42 commented Jun 30, 2017

No submodules or containers involved. Per #790 (comment) vendoring with dep worked again after I cleared out $GOPATH/pkg, so I'm assuming something non-standard ended up in here (like an empty directory where dep expected a git repo). Any evidence has been destroyed, so maybe just close this issue unless recovery can be done (ignore or remove the broken local copy and use the remote repo).

@ibrasho ibrasho added the bug label Jul 5, 2017
@sdboyer
Copy link
Member

sdboyer commented Jul 8, 2017

yeah, this is most likely a case of failure to terminate subprocesses gracefully on interrupt. it's a known issue - we just went for a lowest-common-denominator that would work cross platform, but it's too harsh, using os.Process.Kill(), which doesn't give e.g. git a chance to clean up after itself.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants