Masterminds / glide

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

Using flatten flag #429

Open bestofmukul opened 8 years ago

bestofmukul commented 8 years ago

I am confused about the usage of flatten flag with glide.yaml. To flatten nested dependencies in vendor directory, are we supposed to add any such flag or is it included by default(release 0.7.0)?

I am using kubernetes and glog in my project and since glog is also present in vendor directory of kubernetes, there is a panic happening. With my understanding of glide up it should fetch only one copy of glog in my project's vendor directory and there should not be any copy in kubernetes vendor directory. Is it correct to assume that?

mattfarina commented 8 years ago

There were some issues with this in the past. Can you update to Glide 0.10.2 and try again?

bestofmukul commented 8 years ago

I am using glide version 0.10.2 and also tried to put flatten: true at top level package. Glide fetched glog in two locations.

mattfarina commented 8 years ago

Can you share your glide.yaml file and projects directory structure? It would make it easier for me to figure out what's going on.

bestofmukul commented 8 years ago

This is how my dir structure looks like

tree -L 1
.
├── alertconfig
├── am
├── configserver
├── glide.lock
├── glide.yaml
├── healthwatcher
├── promeconfig
├── test
├── tm-sidekick
└── vendor

and glide.yaml is

package: .
flatten: true
import:
- package: github.com/coreos/etcd
  subpackages:
  - client
- package: github.com/golang/glog
- package: github.com/golang/mock
  subpackages:
  - gomock
- package: github.com/google/gofuzz
- package: github.com/gorilla/handlers
- package: github.com/gorilla/mux
- package: github.com/onsi/ginkgo
  subpackages:
  - config
- package: github.com/onsi/gomega
- package: github.com/spf13/cobra
- package: github.com/spf13/pflag
- package: github.com/spf13/viper
- package: github.com/taviti/caldav-go
  subpackages:
  - webdav
  - webdav/entities
- package: golang.org/x/net
  subpackages:
  - context
- package: gopkg.in/inf.v0
- package: gopkg.in/validator.v2
- package: k8s.io/kubernetes

Vendor dir struct

 tree -L 3
.
├── github.com
│   ├── BurntSushi
│   │   └── toml
│   ├── coreos
│   │   └── etcd
│   ├── golang
│   │   ├── glog
│   │   └── mock
│   ├── onsi
│   │   ├── ginkgo
│   │   └── gomega
...
└── k8s.io
    └── kubernetes
        ├── api
        ├── vendor
        └── www

and kubernetes vendor dir struct

vendor/k8s.io/kubernetes/vendor$ tree -L 3
.
├── bitbucket.org
│   ├── bertimus9
│   │   └── systemstat
│   └── ww
│       └── goautoneg
├── github.com
│   ├── coreos
│   │   ├── etcd
│   │   ├── go-etcd
│   │   ├── go-oidc
│   │   ├── go-semver
│   │   ├── go-systemd
│   │   ├── pkg
│   │   └── rkt
│   ├── golang
│   │   ├── glog
│   │   ├── groupcache
│   │   ├── mock
│   │   └── protobuf

(removed a bunch of entries for readability)

khatribharat commented 7 years ago

@mattfarina I'm facing the same issue here. Has support for flatten been removed? I can't see it in the documentation as well.