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

Dep fails to install transitive dependencies #1211

Closed
khatribharat opened this issue Sep 23, 2017 · 2 comments
Closed

Dep fails to install transitive dependencies #1211

khatribharat opened this issue Sep 23, 2017 · 2 comments

Comments

@khatribharat
Copy link

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

dep:
 version     : v0.3.1
 build date  : 2017-09-19
 git hash    : 83789e2
 go version  : go1.9
 go compiler : gc
 platform    : linux/amd64

What dep command did you run?

> mkdir dep && cd dep
> echo -e "package main\n\nimport \"github.com/uber/jaeger-client-go\"" > main.go
> dep init -v
Getting direct dependencies...
Checked 1 directories for packages.
Found 1 direct dependencies.
Root project is "[REDACTED]"
 1 transitively valid internal packages
 1 external packages imported from 1 projects
(0)   ✓ select (root)
(1)	? attempt github.com/uber/jaeger-client-go with 1 pkgs; 63 versions to try
(1)	    try github.com/uber/jaeger-client-go@v2.9.0
(1)	✓ select github.com/uber/jaeger-client-go@v2.9.0 w/8 pkgs
(2)	? attempt github.com/uber/jaeger-lib with 1 pkgs; 6 versions to try
(2)	    try github.com/uber/jaeger-lib@v1.1.0
(2)	✓ select github.com/uber/jaeger-lib@v1.1.0 w/1 pkgs
(3)	? attempt github.com/codahale/hdrhistogram with 1 pkgs; 1 versions to try
(3)	    try github.com/codahale/hdrhistogram@master
(3)	✓ select github.com/codahale/hdrhistogram@master w/1 pkgs
(4)	? attempt github.com/opentracing/opentracing-go with 3 pkgs; 28 versions to try
(4)	    try github.com/opentracing/opentracing-go@v1.0.2
(4)	✓ select github.com/opentracing/opentracing-go@v1.0.2 w/3 pkgs
(5)	? attempt golang.org/x/net with 1 pkgs; 5 versions to try
(5)	    try golang.org/x/net@master
(5)	✓ select golang.org/x/net@master w/1 pkgs
(6)	? attempt github.com/apache/thrift with 1 pkgs; 29 versions to try
(6)	    try github.com/apache/thrift@0.10.0
(6)	✓ select github.com/apache/thrift@0.10.0 w/1 pkgs
  ✓ found solution with 15 packages from 6 projects

Solver wall times by segment:
     b-list-versions: 14.461157949s
         b-list-pkgs:  3.705338611s
     b-source-exists:  3.530721645s
  b-deduce-proj-root:  804.277764ms
              b-gmal:  288.852402ms
         select-atom:    1.937467ms
             satisfy:    1.563405ms
            new-atom:     425.266µs
         select-root:     323.696µs
               other:      25.446µs

  TOTAL: 22.794623651s

  Locking in master (0744d00) for transitive dep golang.org/x/net
  Locking in 0.10.0 (b2a4d4a) for transitive dep github.com/apache/thrift
  Using ^2.9.0 as constraint for direct dep github.com/uber/jaeger-client-go
  Locking in v2.9.0 (3e38700) for direct dep github.com/uber/jaeger-client-go
  Locking in v1.1.0 (3b2a9ad) for transitive dep github.com/uber/jaeger-lib
  Locking in master (3a0bb77) for transitive dep github.com/codahale/hdrhistogram
  Locking in v1.0.2 (1949ddb) for transitive dep github.com/opentracing/opentracing-go
(1/6) Wrote github.com/opentracing/opentracing-go@v1.0.2
(2/6) Wrote github.com/codahale/hdrhistogram@master
(3/6) Wrote github.com/uber/jaeger-lib@v1.1.0
(4/6) Wrote github.com/uber/jaeger-client-go@v2.9.0
(5/6) Wrote golang.org/x/net@master
(6/6) Wrote github.com/apache/thrift@0.10.0

What did you expect to see?

This doesn't install all transitive dependencies. The jaeger-client-go repository contains a glide.yaml and a glide.lock and dep doesn't install all dependencies from these files.

dep fails to install the following transitive dependencies from the aforementioned glide.yaml

- package: github.com/uber/tchannel-go
  version: ^1.1.0
  subpackages:
  - atomic
  - thrift
  - thrift/gen-go/meta
  - tnet
  - trace/thrift/gen-go/tcollector
  - typed
- package: github.com/stretchr/testify
  version: ^1.1.3
  subpackages:
  - assert
  - require
  - suite
- package: github.com/crossdock/crossdock-go
@ibrasho
Copy link
Collaborator

ibrasho commented Sep 23, 2017

At the moment, dep doesn't import any third-party dep management files in transitive dependencies.

#920 is an attempt to add on-the-fly importing of glide.yaml files but it's still a WIP.

@sdboyer
Copy link
Member

sdboyer commented Sep 25, 2017

hi, welcome!

just clarifying a bit further - even when we do add support for pulling in other tools' metadata on the fly, dep will not incorporate the subpackages information in glide.yaml, as doing so would violate dep's model that the set of packages required packages are based on exactly two things:

  1. static import path analysis, beginning from the set of imports declared in the root project
  2. required packages listed in the root project's Gopkg.toml

in other words: those transitive dependencies' subpackages aren't actually required to compile when you only import github.com/uber/jaeger-client-go, so dep doesn't include them. if you import more of jaeger-client-go's subpackages, or specify some of those packages as required, then they'll show up. but otherwise, this is the intentional design of dep, and respecting it keeps operations simpler.

(closing, works as intended)

@sdboyer sdboyer closed this as completed Sep 25, 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

3 participants