diff --git a/lock.json b/lock.json index f27282a743..9d3ef1b964 100644 --- a/lock.json +++ b/lock.json @@ -1,5 +1,5 @@ { - "memo": "fc012dfb266db9deec4121dd38069e2556ba66a5514939662da94fac1251996e", + "memo": "dd7782503f94ea4f3c17b4ce6795480b02b24a389bb05db3acaa273c71e66766", "projects": [ { "name": "github.com/Masterminds/semver", @@ -35,8 +35,7 @@ }, { "name": "github.com/sdboyer/gps", - "version": "v0.14.1", - "revision": "287edec9f4ca516577cc3ac9744068a34c4c7b08", + "revision": "eba751a", "packages": [ "." ] diff --git a/manifest.json b/manifest.json index 2c5403aa3c..afd95189e1 100644 --- a/manifest.json +++ b/manifest.json @@ -10,7 +10,7 @@ "version": ">=0.8.0, <1.0.0" }, "github.com/sdboyer/gps": { - "version": ">=0.14.0, <1.0.0" + "revision": "eba751a" } } } diff --git a/vendor/github.com/Masterminds/vcs/errors.go b/vendor/github.com/Masterminds/vcs/errors.go index 369abb50a5..94a7dbee26 100644 --- a/vendor/github.com/Masterminds/vcs/errors.go +++ b/vendor/github.com/Masterminds/vcs/errors.go @@ -96,7 +96,7 @@ type vcsError struct { // Error implements the Error interface func (e *vcsError) Error() string { - return fmt.Sprintf("%s: %v, %s", e.s, e.e, e.o) + return fmt.Sprintf("%s: %v, '%s'", e.s, e.e, e.o) } // Original retrieves the underlying implementation specific error. diff --git a/vendor/github.com/sdboyer/gps/analysis.go b/vendor/github.com/sdboyer/gps/analysis.go index 5f2f0eb9bd..e5f0fe3cec 100644 --- a/vendor/github.com/sdboyer/gps/analysis.go +++ b/vendor/github.com/sdboyer/gps/analysis.go @@ -112,15 +112,13 @@ func ListPackages(fileRoot, importRoot string) (PackageTree, error) { // would have an err with the same path as is called this time, as only // then will filepath.Walk have attempted to descend into the directory // and encountered an error. - var file *os.File - file, err = os.Open(wp) + _, err = os.Open(wp) if err != nil { if os.IsPermission(err) { return filepath.SkipDir } return err } - defer file.Close() // Compute the import path. Run the result through ToSlash(), so that // windows file paths are normalized to slashes, as is expected of diff --git a/vendor/github.com/sdboyer/gps/maybe_source.go b/vendor/github.com/sdboyer/gps/maybe_source.go index d6489a7fbc..d59962aedc 100644 --- a/vendor/github.com/sdboyer/gps/maybe_source.go +++ b/vendor/github.com/sdboyer/gps/maybe_source.go @@ -67,7 +67,7 @@ func (m maybeGitSource) try(cachedir string, an ProjectAnalyzer) (source, string path := filepath.Join(cachedir, "sources", sanitizer.Replace(ustr)) r, err := vcs.NewGitRepo(ustr, path) if err != nil { - return nil, ustr, err + return nil, "", err } src := &gitSource{ @@ -85,7 +85,7 @@ func (m maybeGitSource) try(cachedir string, an ProjectAnalyzer) (source, string if !r.CheckLocal() { _, err = src.listVersions() if err != nil { - return nil, ustr, err + return nil, "", err } } @@ -112,7 +112,7 @@ func (m maybeGopkginSource) try(cachedir string, an ProjectAnalyzer) (source, st ustr := m.url.String() r, err := vcs.NewGitRepo(ustr, path) if err != nil { - return nil, ustr, err + return nil, "", err } src := &gopkginSource{ @@ -133,7 +133,7 @@ func (m maybeGopkginSource) try(cachedir string, an ProjectAnalyzer) (source, st if !r.CheckLocal() { _, err = src.listVersions() if err != nil { - return nil, ustr, err + return nil, "", err } } @@ -149,10 +149,10 @@ func (m maybeBzrSource) try(cachedir string, an ProjectAnalyzer) (source, string path := filepath.Join(cachedir, "sources", sanitizer.Replace(ustr)) r, err := vcs.NewBzrRepo(ustr, path) if err != nil { - return nil, ustr, err + return nil, "", err } if !r.Ping() { - return nil, ustr, fmt.Errorf("Remote repository at %s does not exist, or is inaccessible", ustr) + return nil, "", fmt.Errorf("Remote repository at %s does not exist, or is inaccessible", ustr) } src := &bzrSource{ @@ -183,10 +183,10 @@ func (m maybeHgSource) try(cachedir string, an ProjectAnalyzer) (source, string, path := filepath.Join(cachedir, "sources", sanitizer.Replace(ustr)) r, err := vcs.NewHgRepo(ustr, path) if err != nil { - return nil, ustr, err + return nil, "", err } if !r.Ping() { - return nil, ustr, fmt.Errorf("Remote repository at %s does not exist, or is inaccessible", ustr) + return nil, "", fmt.Errorf("Remote repository at %s does not exist, or is inaccessible", ustr) } src := &hgSource{ diff --git a/vendor/github.com/sdboyer/gps/solve_bimodal_test.go b/vendor/github.com/sdboyer/gps/solve_bimodal_test.go index 3ee7493f2c..2f9ce4c10b 100644 --- a/vendor/github.com/sdboyer/gps/solve_bimodal_test.go +++ b/vendor/github.com/sdboyer/gps/solve_bimodal_test.go @@ -285,6 +285,33 @@ var bimodalFixtures = map[string]bimodalFixture{ "a 1.0.0", ), }, + "project cycle involving root with backtracking": { + ds: []depspec{ + dsp(mkDepspec("root 0.0.0", "a ~1.0.0"), + pkg("root", "a", "b"), + pkg("root/foo"), + ), + dsp(mkDepspec("a 1.0.0"), + pkg("a", "root/foo"), + ), + dsp(mkDepspec("a 1.0.1"), + pkg("a", "root/foo"), + ), + dsp(mkDepspec("b 1.0.0", "a 1.0.0"), + pkg("b", "a"), + ), + dsp(mkDepspec("b 1.0.1", "a 1.0.0"), + pkg("b", "a"), + ), + dsp(mkDepspec("b 1.0.2", "a 1.0.0"), + pkg("b", "a"), + ), + }, + r: mksolution( + "a 1.0.0", + "b 1.0.2", + ), + }, "project cycle not involving root": { ds: []depspec{ dsp(mkDepspec("root 0.0.0", "a ~1.0.0"), diff --git a/vendor/github.com/sdboyer/gps/solver.go b/vendor/github.com/sdboyer/gps/solver.go index 95c913c72f..7c12da8b81 100644 --- a/vendor/github.com/sdboyer/gps/solver.go +++ b/vendor/github.com/sdboyer/gps/solver.go @@ -1152,6 +1152,12 @@ func (s *solver) unselectLast() (atomWithPackages, bool) { } for _, dep := range deps { + // Skip popping if the dep is the root project, which can occur if + // there's a project-level import cycle. (This occurs frequently with + // e.g. kubernetes and docker) + if s.rd.isRoot(dep.Ident.ProjectRoot) { + continue + } s.sel.popDep(dep.Ident) // if no parents/importers, remove from unselected queue diff --git a/vendor/github.com/sdboyer/gps/source_manager.go b/vendor/github.com/sdboyer/gps/source_manager.go index 4af32139a3..2ed04deeb8 100644 --- a/vendor/github.com/sdboyer/gps/source_manager.go +++ b/vendor/github.com/sdboyer/gps/source_manager.go @@ -532,9 +532,6 @@ func (sm *SourceMgr) getSourceFor(id ProjectIdentifier) (source, error) { src, has := sm.srcs[nn] sm.srcmut.RUnlock() if has { - if src == nil { - return nil, fmt.Errorf("no src 1") - } return src, nil } @@ -546,9 +543,6 @@ func (sm *SourceMgr) getSourceFor(id ProjectIdentifier) (source, error) { // we don't care about the ident here, and the future produced by // deducePathAndProcess will dedupe with what's in the sm.srcs map src, _, err = ft.srcf() - if err == nil && src == nil { - return nil, fmt.Errorf("no src 2") - } return src, err }