dkulchenko / bunch

npm-like tool for managing Go dependencies
MIT License
79 stars 13 forks source link

Non-dependencies always get fetched #24

Open mberhault opened 9 years ago

mberhault commented 9 years ago

We pull in a few command-line tools for commit hooks, so they are not imported by anything, just listed in our Bunchfile. eg:

github.com/kisielk/errcheck
github.com/barakmich/go-nyet
github.com/golang/lint/golint
golang.org/x/tools/cmd/goimports
github.com/dkulchenko/bunch

These always seem to get fetched and installed, even when up-to-date:

bunch --verbose install
refreshing github.com/kisielk/errcheck ... done
  - fetching dependencies for github.com/kisielk/errcheck ... done

refreshing github.com/barakmich/go-nyet ... done
  - fetching dependencies for github.com/barakmich/go-nyet ... done

refreshing github.com/golang/lint/golint ... done
  - fetching dependencies for github.com/golang/lint/golint ... done

refreshing golang.org/x/tools/cmd/goimports ... done
  - fetching dependencies for golang.org/x/tools/cmd/goimports ... done

refreshing github.com/dkulchenko/bunch ... done
  - fetching dependencies for github.com/dkulchenko/bunch ... done

skipping github.com/cockroachdb/cockroach-prod, up to date                 
skipping code.google.com/p/goauth2/oauth, up to date                 
skipping github.com/awslabs/aws-sdk-go/aws, up to date                 
skipping github.com/awslabs/aws-sdk-go/service/ec2, up to date                 
skipping github.com/awslabs/aws-sdk-go/service/elb, up to date                 
skipping github.com/cockroachdb/clog, up to date                 
skipping github.com/cockroachdb/cockroach/util, up to date                 
skipping github.com/ghemawat/stream, up to date                 
skipping github.com/gogo/protobuf/proto, up to date                 
skipping github.com/inconshreveable/mousetrap, up to date                 
skipping github.com/spf13/cobra, up to date                 
skipping github.com/spf13/pflag, up to date                 
skipping golang.org/x/net/context, up to date                 
skipping google.golang.org/api/compute/v1, up to date                 
skipping google.golang.org/api/googleapi, up to date                 
skipping google.golang.org/api/resourceviews/v1beta2, up to date                 
skipping gopkg.in/yaml.v1, up to date                 
installing github.com/kisielk/errcheck ... 
  - setting version of github.com/kisielk/errcheck to  (resolved as a48456c583c0111c8310fc59335f6496b8eb85f1) ... done
  - building package github.com/kisielk/errcheck ... done
  - installing package github.com/kisielk/errcheck ... done
successfully installed github.com/kisielk/errcheck                 

installing github.com/barakmich/go-nyet ... 
  - setting version of github.com/barakmich/go-nyet to  (resolved as fba7607fa3f727680833b0c44f35b448dbe5c5a8) ... done
  - building package github.com/barakmich/go-nyet ... done
  - installing package github.com/barakmich/go-nyet ... done
successfully installed github.com/barakmich/go-nyet                 

installing github.com/golang/lint/golint ... 
  - setting version of github.com/golang/lint/golint to  (resolved as 14b90a5a5501db8773a53730d1f814ccb13271f6) ... skipped, unknown repo type
  - building package github.com/golang/lint/golint ... done
  - installing package github.com/golang/lint/golint ... done
successfully installed github.com/golang/lint/golint                 

installing golang.org/x/tools/cmd/goimports ... 
  - setting version of golang.org/x/tools/cmd/goimports to  (resolved as 3d1847243ea4f07666a91110f48e79e43396603d) ... skipped, unknown repo type
  - building package golang.org/x/tools/cmd/goimports ... done
  - installing package golang.org/x/tools/cmd/goimports ... done
successfully installed golang.org/x/tools/cmd/goimports                 

installing github.com/dkulchenko/bunch ... 
  - setting version of github.com/dkulchenko/bunch to  (resolved as 85e3a193fda570b257df3fef56d278535553572f) ... done
  - building package github.com/dkulchenko/bunch ... done
  - installing package github.com/dkulchenko/bunch ... done
successfully installed github.com/dkulchenko/bunch                 
dkulchenko commented 9 years ago

This is a bug due to bunch always checking for a package file being present, which aren't generated with binary-only packages. Will look into checking the go list --json . "Target" instead.