Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: "is not a descendent of preceding tag" test errors at head #39366

Closed
matloob opened this issue Jun 2, 2020 · 3 comments
Closed

cmd/go: "is not a descendent of preceding tag" test errors at head #39366

matloob opened this issue Jun 2, 2020 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@matloob
Copy link
Contributor

matloob commented Jun 2, 2020

The following cmd/go tests are broken on my machine (darwin/amd64) at head:

  • TestScript/mod_get_pseudo
  • TestScript/mod_invalid_version
  • TestScript/mod_replace_gopkgin
  • TestScript/TestScript/mod_gopkg_unstable

The failures seem to be due to tagging changes on repos fetched by our tests.

Here's the log:

$ devgo test cmd/go
go test proxy running at GOPROXY=http://127.0.0.1:52140/mod
go proxy: no archive rsc.io v1.5.2: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive example.com v0.1.0: file does not exist
go proxy: no archive rsc.io v1.1.0: file does not exist
go proxy: no archive golang.org v0.1.0: file does not exist
go proxy: no archive golang.org v0.3.0: file does not exist
go proxy: no archive golang.org/x v0.1.0: file does not exist
go proxy: no archive golang.org/x v0.3.0: file does not exist
go proxy: no archive example.com/newcycle v1.0.0: file does not exist
go proxy: no archive test.go v1.0.0: file does not exist
go proxy: no archive rsc.io v1.5.1: file does not exist
go proxy: no archive rsc.io v1.4.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.5.2: file does not exist
--- FAIL: TestScript (0.00s)
    --- FAIL: TestScript/mod_get_pseudo (2.72s)
        script_test.go:209:
            # Testing git->module converter's generation of +incompatible tags; turn off proxy. (0.000s)
            # We can resolve the @master branch without unshallowing the local repository
            # (even with older gits), so try that before we do anything else.
            # (This replicates https://golang.org/issue/26713 with git 2.7.4.) (2.696s)
            > go get -d github.com/rsc/legacytest@master
            [stderr]
            go: downloading github.com/rsc/legacytest v2.0.1-0.20180717164253-7303f7796364+incompatible
            go get github.com/rsc/legacytest@master: github.com/rsc/legacytest@v2.0.1-0.20180717164253-7303f7796364+incompatible: invalid pseudo-version: revision 7303f7796364 is not a descendent of preceding tag (v2.0.0)
            [exit status 1]
            FAIL: testdata/script/mod_get_pseudo.txt:12: unexpected command failure

    --- FAIL: TestScript/mod_invalid_version (57.30s)
        script_test.go:209:
            # Regression test for golang.org/issue/27173: if the user (or go.mod file)
            # requests a pseudo-version that does not match both the module path and commit
            # metadata, reject it with a helpful error message.
            #
            # TODO(bcmills): Replace the github.com/pierrec/lz4 examples with something
            # equivalent on vcs-test.golang.org.
            # An incomplete commit hash is not a valid semantic version,
            # but can appear in the main go.mod file anyway and should be resolved. (16.950s)
            # A module path below the repo root that does not contain a go.mod file is invalid. (4.511s)
            # However, arguments to 'go get' can name packages above the root. (5.337s)
            # A major version that does not match the module path is invalid. (0.550s)
            # A pseudo-version with fewer than 12 digits of SHA-1 prefix is invalid. (1.032s)
            # A pseudo-version with more than 12 digits of SHA-1 prefix is invalid. (1.066s)
            # A pseudo-version that does not match the commit timestamp is invalid. (1.083s)
            # A 'replace' directive in the main module can replace an invalid timestamp
            # with a valid one. (0.866s)
            # A pseudo-version that is not derived from a tag is invalid. (2.136s)
            # A v1.0.0- pseudo-version that is not derived from a tag is invalid:
            # v1.0.0- implies no tag, but the correct no-tag prefix for a module path
            # without a major-version suffix is v0.0.0-. (1.490s)
            # A pseudo-version vX.Y.Z+1 cannot have Z+1 == 0, since that would
            # imply a base tag with a negative patch field. (1.037s)
            # A 'replace' directive in the main module can replace an
            # invalid pseudo-version base with a valid one. (0.466s)
            # A 'replace' directive can replace an invalid 'latest' version, and
            # should suppress errors for that version in 'go get -u' (2.208s)
            # A pseudo-version derived from a non-ancestor tag is invalid. (4.168s)
            # A pseudo-version derived from a canonical tag on the same revision is invalid. (0.960s)
            # A +incompatible suffix is not allowed on a version that is actually compatible. (2.853s)
            # The pseudo-version for a commit after a tag with a non-matching major version
            # should instead be based on the last matching tag. (10.411s)
            > cp go.mod.orig go.mod
            > go mod edit -require github.com/pierrec/lz4@473cd7ce01a1
            > go list -m github.com/pierrec/lz4
            [stderr]
            go: github.com/pierrec/lz4@v1.0.2-0.20190131084431-473cd7ce01a1: invalid pseudo-version: revision 473cd7ce01a1 is not a descendent of preceding tag (v1.0.1)
            [exit status 1]
            FAIL: testdata/script/mod_invalid_version.txt:184: unexpected command failure

    --- FAIL: TestScript/mod_replace_gopkgin (66.80s)
        script_test.go:209:
            # Regression test for golang.org/issue/34254:
            # a clone of gopkg.in/[…].vN should be replaceable by
            # a fork hosted at corp.example.com/[…]/vN,
            # even if there is an explicit go.mod file containing the
            # gopkg.in path. (0.000s)
            # Replacing gopkg.in/[…].vN with a repository with a root go.mod file
            # specifying […].vN and a compatible version should succeed, even if
            # the replacement path is not a gopkg.in path. (59.180s)
            # Previous versions of the "go" command accepted v0 and v1 pseudo-versions
            # as replacements for gopkg.in/[…].v4.
            # As a special case, we continue to accept those. (4.928s)
            > cd ../4-to-0
            $WORK/gopath/src/4-to-0
            > go list -m gopkg.in/src-d/go-git.v4
            [stdout]
            gopkg.in/src-d/go-git.v4 v4.13.1 => github.com/src-d/go-git v0.0.0-20190801152248-0d1a009cbb60
            > cd ../4-to-1
            $WORK/gopath/src/4-to-1
            > go list -m gopkg.in/src-d/go-git.v4
            [stderr]
            go: github.com/src-d/go-git@v1.0.1-0.20190801152248-0d1a009cbb60: invalid pseudo-version: revision 0d1a009cbb60 is not a descendent of preceding tag (v1.0.0)
            [exit status 1]
            FAIL: testdata/script/mod_replace_gopkgin.txt:29: unexpected command failure

    --- FAIL: TestScript/mod_gopkg_unstable (45.03s)
        script_test.go:209:
            > env GO111MODULE=on
            > cp go.mod.empty go.mod
            > go get -d gopkg.in/dummy.v2-unstable
            [stderr]
            go: downloading gopkg.in/dummy.v2-unstable v2.0.0
            go: gopkg.in/dummy.v2-unstable upgrade => v2.0.0
            > cp x.go.txt x.go
            > cp go.mod.empty go.mod
            > go list
            [stdout]
            m
            [stderr]
            go: finding module for package gopkg.in/dummy.v2-unstable
            go: found gopkg.in/dummy.v2-unstable in gopkg.in/dummy.v2-unstable v2.0.0
            > [!net] skip
            > [!exec:git] skip
            > env GOPROXY=direct
            > env GOSUMDB=off
            > go get gopkg.in/macaroon-bakery.v2-unstable/bakery
            [stderr]
            go: downloading gopkg.in/macaroon-bakery.v2-unstable v2.0.0-20171026135619-38b77b89a624
            go: found gopkg.in/macaroon-bakery.v2-unstable/bakery in gopkg.in/macaroon-bakery.v2-unstable v2.0.0-20171026135619-38b77b89a624
            go: finding module for package github.com/juju/loggo
            go: finding module for package gopkg.in/errgo.v1
            go: finding module for package golang.org/x/crypto/nacl/box
            go: finding module for package github.com/rogpeppe/fastuuid
            go: finding module for package golang.org/x/net/context
            go: finding module for package gopkg.in/macaroon.v2
            go: finding module for package github.com/golang/protobuf/proto
            go: downloading github.com/rogpeppe/fastuuid v1.2.0
            go: downloading github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e
            go: downloading github.com/golang/protobuf v1.4.2
            go: downloading golang.org/x/net v0.0.0-20200602114024-627f9648deb9
            go: downloading golang.org/x/crypto v0.0.0-20200602180216-279210d13fed
            go: downloading gopkg.in/errgo.v1 v1.0.1
            go: downloading gopkg.in/macaroon.v2 v2.1.0
            go: found github.com/juju/loggo in github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e
            go: found github.com/rogpeppe/fastuuid in github.com/rogpeppe/fastuuid v1.2.0
            go: found golang.org/x/crypto/nacl/box in golang.org/x/crypto v0.0.0-20200602180216-279210d13fed
            go: found golang.org/x/net/context in golang.org/x/net v0.0.0-20200602114024-627f9648deb9
            go: found gopkg.in/errgo.v1 in gopkg.in/errgo.v1 v1.0.1
            go: found gopkg.in/macaroon.v2 in gopkg.in/macaroon.v2 v2.1.0
            go: found github.com/golang/protobuf/proto in github.com/golang/protobuf v1.4.2
            go: gopkg.in/errgo.v1@v1.0.1 requires
            	github.com/frankban/quicktest@v1.2.2 requires
            	github.com/google/go-cmp@v0.2.1-0.20190312032427-6f77996f0c42: invalid pseudo-version: git merge-base --is-ancestor -- v0.2.0 6f77996f0c42f7b84e5a2b252227263f93432e9b in $WORK/gopath/pkg/mod/cache/vcs/8726c33a34f2c7112ff9a550395685eb57f08c9388dac85bc9e0dd90c8cb37bf: signal: abort trap:
            	BUG: commit-reach.c:65: bad generation skip ffffffff >        1 at b5cce8991b5672867358e36b3821ab1f778c1871
            [exit status 1]
            FAIL: testdata/script/mod_gopkg_unstable.txt:15: unexpected command failure

FAIL
FAIL	cmd/go	207.301s
FAIL
@matloob
Copy link
Contributor Author

matloob commented Jun 2, 2020

@bcmills @jayconrod

The weird thing here is that the tests that are failing are failing on different remote repos:

TestScript/mod_get_pseudo fails on github.com/rsc/legacytest

TestScript/mod_invalid_version fails on github.com/pierrec/lz4

TestScript/mod_replace_gopkgin fails on github.com/src-d/go-git

and TestScript/TestScript/mod_gopkg_unstable fails with what looks like a runtime error?

@jayconrod jayconrod added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 2, 2020
@jayconrod
Copy link
Contributor

I believe this is a bug in the version of Git deployed on Google machines. I was able to reproduce this failure with go1.14.4, so it's not caused by a recent change in cmd/go.

This script reproduces the problem:

#!/bin/bash

set -euxo pipefail
if [ -d legacytest ]; then
  echo "legacytest directory already exists" >&2
  exit 1
fi
mkdir legacytest
cd legacytest
git init --bare
git remote add origin -- https://github.com/rsc/legacytest
git fetch -f --depth=1 origin refs/heads/master:refs/heads/master
git fetch -f origin 'refs/heads/*:refs/heads/*' 'refs/tags/*:refs/tags/*'
git fetch --unshallow -f origin
git merge-base --is-ancestor -- v2.0.0 7303f77963648d5f1ec5e55eccfad8e14035866c
echo success

@jayconrod
Copy link
Contributor

This has been fixed internally.

@golang golang locked and limited conversation to collaborators Jun 3, 2021
@rsc rsc unassigned bcmills Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants