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: TestScript/mod_invalid_version is failing locally #47233

Closed
jayconrod opened this issue Jul 15, 2021 · 5 comments
Closed

cmd/go: TestScript/mod_invalid_version is failing locally #47233

jayconrod opened this issue Jul 15, 2021 · 5 comments
Labels
FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@jayconrod
Copy link
Contributor

Not sure why this isn't happening on TryBots, but this is what I'm seeing when I run locally on macOS or Linux:

$ go test -run=TestScript/mod_invalid_version_repro
go test proxy running at GOPROXY=http://127.0.0.1:60665/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/mod_invalid_version_repro (3.39s)
        script_test.go:252: 
            # 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.
            # A pseudo-version derived from a canonical tag on the same revision is invalid. (3.337s)
            > cp go.mod.orig go.mod
            > go mod edit -require golang.org/x/text@v0.2.1-0.20171213102548-c4d099d611ac
            > cd outside
            $WORK/gopath/src/outside
            > ! go list -m golang.org/x/text
            [stderr]
            go list -m: golang.org/x/text@v0.2.1-0.20171213102548-c4d099d611ac: invalid pseudo-version: tag (v0.2.0) found on revision c4d099d611ac is already canonical, so should not be replaced with a pseudo-version derived from that tag
            go list -m: example.com@v0.0.0 requires
                golang.org/x/text@v0.2.1-0.20171213102548-c4d099d611ac: invalid pseudo-version: tag (v0.2.0) found on revision c4d099d611ac is already canonical, so should not be replaced with a pseudo-version derived from that tag
            [exit status 1]
            > stderr 'go list -m: example.com@v0.0.0 requires\n\tgolang.org/x/text@v0.2.1-0.20171213102548-c4d099d611ac: invalid pseudo-version: tag \(v0.2.0\) found on revision c4d099d611ac is already canonical, so should not be replaced with a pseudo-version derived from that tag'
            > cd ..
            $WORK/gopath/src
            > ! go list -m golang.org/x/text
            [stdout]
            golang.org/x/text v0.2.1-0.20171213102548-c4d099d611ac
            FAIL: testdata/script/mod_invalid_version_repro.txt:23: unexpected command success
            
FAIL
exit status 1
FAIL    cmd/go  5.088s
@jayconrod jayconrod added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Jul 15, 2021
@jayconrod jayconrod added this to the Go1.18 milestone Jul 15, 2021
@jayconrod jayconrod self-assigned this Jul 15, 2021
@jayconrod
Copy link
Contributor Author

I could reproduce the bug using Git only:

#!/usr/bin/env bash

set -euo pipefail

rm -rf repo
mkdir repo
cd repo
git init --bare
git remote add origin -- https://go.googlesource.com/text
git fetch -f --depth=1 origin refs/tags/v0.2.0:refs/tags/v0.2.0
got=$(git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' c4d099d611ac --)
want='c4d099d611ac3ded35360abf03581e13d91c828f 1513160748 grafted, tag: v0.2.0'
if [ "$got" != "$want" ]; then
  echo "got:  $got" >&2
  echo "want: $want" >&2
  exit 1
else
  echo ok >&2
fi

This may be a bug with the version of Git installed on my machine. I couldn't reproduce this with Git 2.32.0.

@dmitshur dmitshur added the GoCommand cmd/go label Jul 16, 2021
@dmitshur
Copy link
Contributor

Is this marked as a 1.18 release blocker because it's okay to fix this after 1.17 is released?

I can't reproduce with git version 2.30.1 (Apple Git-130) either.

@jayconrod jayconrod modified the milestones: Go1.18, Go1.17 Jul 16, 2021
@jayconrod
Copy link
Contributor Author

Ah, meant to mark this for 1.17.

I'm removing the release-blocker label, since this seems to be a bug in Google's Git, not in Go, and I don't expect we'll need to change anything.

Reported internally as b/193836680.

@jrn
Copy link

jrn commented Jul 16, 2021

Thanks for reporting. https://lore.kernel.org/git/YO8RaMj7sN4ABe5d@coredump.intra.peff.net/ should fix this.

The buggy commit was not part of any Git release, so cmd/go shouldn't need to work around it.

@jayconrod
Copy link
Contributor Author

Thanks @jrn! I'll close this issue then.

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants