From bc9faaf647a61bb07b37b4221f761e0cef40cb0d Mon Sep 17 00:00:00 2001 From: Shulhan Date: Tue, 3 Jul 2018 00:36:44 +0700 Subject: Remove govendor vendor tool It cannot handle transitive dependencies when building Consul [1] [1] https://github.com/kardianos/govendor/issues/348 --- README.md | 17 +++++++++++++---- env.go | 2 -- package.go | 4 ---- vendormode.go | 7 ++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 8cd69e7..3203cfa 100644 --- a/README.md +++ b/README.md @@ -128,19 +128,26 @@ After downloading a package, beku will check for known vendor files and run vendor command on the package directory to install their dependencies on package's vendor directory. The following vendor file will be detected, -* `Godeps`, will invoke [gdm](https://github.com/sparrc/gdm) * `Gopkg.toml`, will invoke [dep](https://github.com/golang/dep) -* `vendor/vendor.json`, will invoke [govendor](https://github.com/kardianos/govendor) If no vendor files found, beku will install the dependencies manually. Installation of vendor tools is not handled by beku automatically, user must install them manually, either by using `go get` or by using `beku -S`, e.g. - $ beku -S https://github.com/sparrc/gdm $ beku -S https://github.com/golang/dep - $ beku -S https://github.com/kardianos/govendor +The following vendor management tool will not be supported until +they can fix their issue(s), + +* govendor [2], cannot handle transitive dependencies (error when building +Consul) +* gdm [3]. gdm is not vendor tool, its use GOPATH the same as beku. Using +gdm will result in inconsistent build if two or more package depends on the +same dependency. For example, package A and B depends on X, package A +depends on X v0.4.0, while package B depends on X v0.5.0, while our repository +is depends on version of X v0.6.0. Running `gdm` on A and then on B, will +change the X to v0.5.0. ### Options @@ -194,3 +201,5 @@ user. # References [1] https://www.archlinux.org/pacman/ +[2] https://github.com/kardianos/govendor/issues/348 +[3] https://github.com/sparrc/gdm diff --git a/env.go b/env.go index eb5a8b3..4c45ad9 100644 --- a/env.go +++ b/env.go @@ -1364,8 +1364,6 @@ func (env *Env) build(pkg *Package) (err error) { vendorCmdDep = append(vendorCmdDep, "-v") } err = pkg.Run(env, vendorCmdDep) - } else if cmd&vendorModeGovendor > 0 { - err = pkg.Run(env, vendorCmdGovendor) } if err != nil { diff --git a/package.go b/package.go index a08ab60..eb1e7d9 100644 --- a/package.go +++ b/package.go @@ -317,10 +317,6 @@ func (pkg *Package) ScanBuild() (cmd vendorMode) { cmd |= vendorModeDep return } - ok = IsFileExist(pkg.FullPath, vendorFileGovendor) - if ok { - cmd |= vendorModeGovendor - } return } diff --git a/vendormode.go b/vendormode.go index 1dc54f8..f83f0ff 100644 --- a/vendormode.go +++ b/vendormode.go @@ -8,15 +8,12 @@ type vendorMode uint const ( vendorModeDep vendorMode = 1 << iota - vendorModeGovendor ) const ( - vendorFileDep = "Gopkg.toml" - vendorFileGovendor = "vendor/vendor.json" + vendorFileDep = "Gopkg.toml" ) var ( - vendorCmdDep = []string{"dep", "ensure"} - vendorCmdGovendor = []string{"govendor", "sync"} + vendorCmdDep = []string{"dep", "ensure"} ) -- cgit v1.3