diff --git a/Gopkg.lock b/Gopkg.lock index 4bbb9473de..7d4b9d06e1 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -45,5 +45,5 @@ memo = "940bdaea844d101260e58623a5bae0392cce009ab34d274e89058b780e880309" [[projects]] name = "github.com/sdboyer/gps" packages = [".","internal","internal/fs","pkgtree"] - revision = "f118745d0aaff02a6a627467fc773716d1df518c" - version = "v0.16.0" + revision = "154c091e40c985ca523b0b350bc351024a97844c" + version = "v0.16.1" diff --git a/vendor/github.com/sdboyer/gps/cmd.go b/vendor/github.com/sdboyer/gps/cmd.go index ca0e7c3f31..ea8c4940c2 100644 --- a/vendor/github.com/sdboyer/gps/cmd.go +++ b/vendor/github.com/sdboyer/gps/cmd.go @@ -63,8 +63,10 @@ func (c *monitoredCmd) run(ctx context.Context) error { return &timeoutError{c.timeout} } case <-ctx.Done(): - if err := c.cmd.Process.Kill(); err != nil { - return &killCmdError{err} + if c.cmd.Process != nil { + if err := c.cmd.Process.Kill(); err != nil { + return &killCmdError{err} + } } return c.ctx.Err() case err := <-done: diff --git a/vendor/github.com/sdboyer/gps/deduce.go b/vendor/github.com/sdboyer/gps/deduce.go index a105bb59b8..b02c531fa3 100644 --- a/vendor/github.com/sdboyer/gps/deduce.go +++ b/vendor/github.com/sdboyer/gps/deduce.go @@ -614,13 +614,6 @@ func (dc *deductionCoordinator) deduceRootPath(ctx context.Context, path string) returnFunc: func(pd pathDeduction) { dc.mut.Lock() dc.rootxt.Insert(pd.root, pd.mb) - - if pd.root != path { - // Replace the vanity deducer with a real result set, so - // that subsequent deductions don't hit the network - // again. - dc.rootxt.Insert(path, pd.mb) - } dc.mut.Unlock() }, } diff --git a/vendor/github.com/sdboyer/gps/deduce_test.go b/vendor/github.com/sdboyer/gps/deduce_test.go index a4c5990e3d..65670962b7 100644 --- a/vendor/github.com/sdboyer/gps/deduce_test.go +++ b/vendor/github.com/sdboyer/gps/deduce_test.go @@ -472,18 +472,16 @@ var pathDeductionFixtures = map[string][]pathDeductionFixture{ root: "golang.org/x/exp", mb: maybeGitSource{url: mkurl("https://go.googlesource.com/exp")}, }, - // rsc.io appears to have broken - //{ - //in: "rsc.io/pdf", - //root: "rsc.io/pdf", - //mb: maybeGitSource{url: mkurl("https://github.com/rsc/pdf")}, - //}, + { + in: "golang.org/x/net/html", + root: "golang.org/x/net", + mb: maybeGitSource{url: mkurl("https://go.googlesource.com/net")}, + }, }, } func TestDeduceFromPath(t *testing.T) { - for typ, fixtures := range pathDeductionFixtures { - typ, fixtures := typ, fixtures + do := func(typ string, fixtures []pathDeductionFixture, t *testing.T) { t.Run(typ, func(t *testing.T) { t.Parallel() @@ -585,6 +583,21 @@ func TestDeduceFromPath(t *testing.T) { } }) } + for typ, fixtures := range pathDeductionFixtures { + typ, fixtures := typ, fixtures + t.Run("first", func(t *testing.T) { + do(typ, fixtures, t) + }) + } + + // Run the test set twice to ensure results are correct for both cached + // and uncached deductions. + for typ, fixtures := range pathDeductionFixtures { + typ, fixtures := typ, fixtures + t.Run("second", func(t *testing.T) { + do(typ, fixtures, t) + }) + } } func TestVanityDeduction(t *testing.T) { @@ -598,7 +611,7 @@ func TestVanityDeduction(t *testing.T) { vanities := pathDeductionFixtures["vanity"] // group to avoid sourcemanager cleanup ctx := context.Background() - t.Run("vanity", func(t *testing.T) { + do := func(t *testing.T) { for _, fix := range vanities { fix := fix t.Run(fmt.Sprintf("%s", fix.in), func(t *testing.T) { @@ -624,7 +637,11 @@ func TestVanityDeduction(t *testing.T) { } }) } - }) + } + + // Run twice, to ensure correctness of cache + t.Run("first", do) + t.Run("second", do) } func TestVanityDeductionSchemeMismatch(t *testing.T) { diff --git a/vendor/github.com/sdboyer/gps/satisfy.go b/vendor/github.com/sdboyer/gps/satisfy.go index 19392ae9e6..dd32f8529a 100644 --- a/vendor/github.com/sdboyer/gps/satisfy.go +++ b/vendor/github.com/sdboyer/gps/satisfy.go @@ -59,12 +59,10 @@ func (s *solver) check(a atomWithPackages, pkgonly bool) error { s.mtr.pop() return err } - // TODO(sdboyer) decide how to refactor in order to re-enable this. Checking for - // revision existence is important...but kinda obnoxious. - //if err := s.checkRevisionExists(a, dep); err != nil { - //s.traceInfo(err) - //return err - //} + if err := s.checkRevisionExists(a, dep); err != nil { + s.traceInfo(err) + return err + } if err := s.checkPackageImportsFromDepExist(a, dep); err != nil { s.traceInfo(err) s.mtr.pop()