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

dep cannot vendor dependencies if parent isn't go-gettable #1363

Closed
rselbach opened this issue Nov 9, 2017 · 1 comment
Closed

dep cannot vendor dependencies if parent isn't go-gettable #1363

rselbach opened this issue Nov 9, 2017 · 1 comment

Comments

@rselbach
Copy link

rselbach commented Nov 9, 2017

What version of dep are you using (dep version)?

dep:
 version     : devel
 build date  :
 git hash    :
 go version  : go1.9.1
 go compiler : gc
 platform    : darwin/amd64

What dep command did you run?

I ran dep init -v on a directory with a single testcase go file (see below). Here's the output --

Getting direct dependencies...
Checked 1 directories for packages.
Found 1 direct dependencies.
Root project is "git.coyotesystems.com/lab/test"
 1 transitively valid internal packages
 1 external packages imported from 1 projects
(0)   ✓ select (root)
(1)	? attempt golang.org/x/sys with 1 pkgs; 1 versions to try
(1)	    try golang.org/x/sys@master
(2)	✗   golang.org/x/sys at master has problem subpkg(s):
(2)	  	golang.org/x/sys/unix has err (scanner.ErrorList); required by (root).
(1)	  ← no more versions of golang.org/x/sys to try; begin backtrack
  ✗ solving failed

Solver wall times by segment:
     b-source-exists: 527.041707ms
         b-list-pkgs: 163.656631ms
         select-root:    128.439µs
            new-atom:     78.595µs
             satisfy:     40.398µs
     b-list-versions:     16.882µs
               other:     11.177µs
  b-deduce-proj-root:      3.077µs

  TOTAL: 690.976906ms

No versions of golang.org/x/sys met constraints:
	master: Could not introduce golang.org/x/sys@master, as its subpackage golang.org/x/sys/unix does not contain usable Go code (scanner.ErrorList).. (Package is required by (root).)

What did you expect to see?

I expected the package golang.org/x/sys/unix to be vendored inside vendor/

What did you see instead?

An error message:

No versions of golang.org/x/sys met constraints:
	master: Could not introduce golang.org/x/sys@master, as its subpackage golang.org/x/sys/unix does not contain usable Go code (scanner.ErrorList).. (Package is required by (root).)

It seems to me as though the problem is dep is trying to go-get golang.org/x/sys instead of golang.org/x/sys/unix.

This could be related to #1306, but not exactly the same as golang.org/x/sys/unix does contain .go files.

Testcase

Here is the simple testcase I used for this --

package main

import (
        "fmt"

        "golang.org/x/sys/unix"
)

func main() {
        a := unix.AF_APPLETALK
        fmt.Println(a)
}
@rselbach
Copy link
Author

rselbach commented Nov 9, 2017

This was with dep installed with brew. I just tried compiling from master and it seems the bug is gone, so I'm closing it. Seems like the brew version is old?

@rselbach rselbach closed this as completed Nov 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant