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

proxy.golang.org: deploy Go 1.13 fixes for pseudo-version derivation #32805

Closed
myitcv opened this issue Jun 27, 2019 · 12 comments
Closed

proxy.golang.org: deploy Go 1.13 fixes for pseudo-version derivation #32805

myitcv opened this issue Jun 27, 2019 · 12 comments
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@myitcv
Copy link
Member

myitcv commented Jun 27, 2019

What version of Go are you using (go version)?

$ go version
go version devel +998a98984b Thu Jun 27 04:16:38 2019 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myitcv/.cache/go-build"
GOENV="/home/myitcv/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/myitcv/gos"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build401641143=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Whilst investigating a problem that ultimately lead to https://go-review.googlesource.com/c/tools/+/184018, I noticed what appears to be an issue with pseudo version derivation for submodules (in the presence of circular requirements)

At the time of writing, tip of tools is 4874f86.

$ go get golang.org/x/tools/gopls@latest
$ go list -m golang.org/x/tools/gopls
golang.org/x/tools/gopls v0.1.0
$ go get golang.org/x/tools/gopls@master
$ go list -m golang.org/x/tools/gopls
golang.org/x/tools/gopls v0.0.0-20190627033414-4874f863e654

The pseudo version looks wrong: it should be something like v0.1.1-0....

I could not reproduce this however (ignoring for one second the circular requirement golang.org/x/tools/gopls -> golang.org/x/tools -> golang.org/x/tools/gopls):

$ go get github.com/myitcvscratch/versioncheck/submodule@latest
$ go list -m github.com/myitcvscratch/versioncheck/submodule
github.com/myitcvscratch/versioncheck/submodule v0.1.0
$ go get github.com/myitcvscratch/versioncheck/submodule@master
$ go list -m github.com/myitcvscratch/versioncheck/submodule
github.com/myitcvscratch/versioncheck/submodule v0.1.1-0.20190627101117-acca917f454d

So perhaps this is something to do with the circular requirement that currently (incorrectly) exists? https://go-review.googlesource.com/c/tools/+/184018 will fix that, but raising this issue in any case for completeness.

What did you expect to see?

Per above.

What did you see instead?

Per above.

cc @bcmills

@bcmills
Copy link
Contributor

bcmills commented Jun 27, 2019

This appears to be an artifact of the fact that the proxy is still using a go command from the 1.12 branch, combined with the fact that the go command now uses the proxy by default:

example.com$ gotip mod init example.com
go: creating new go.mod: module example.com

example.com$ gotip version
go version devel +998a9898 Thu Jun 27 04:16:38 2019 +0000 linux/amd64

example.com$ export GOPROXY=direct

example.com$ gotip get golang.org/x/tools/gopls@latest
go: finding golang.org/x/tools/gopls v0.1.0
go: downloading golang.org/x/tools/gopls v0.1.0
go: extracting golang.org/x/tools/gopls v0.1.0
go: downloading golang.org/x/tools v0.0.0-20190612231717-10539ce30318
go: extracting golang.org/x/tools v0.0.0-20190612231717-10539ce30318
go: downloading golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: extracting golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: finding golang.org/x/tools v0.0.0-20190612231717-10539ce30318
go: finding golang.org/x/sync v0.0.0-20190423024810-112230192c58

example.com$ gotip list -m golang.org/x/tools/gopls
golang.org/x/tools/gopls v0.1.0

example.com$ gotip get golang.org/x/tools/gopls@master
go: finding golang.org/x/tools/gopls master
go: downloading golang.org/x/tools/gopls v0.1.1-0.20190627033414-4874f863e654
go: extracting golang.org/x/tools/gopls v0.1.1-0.20190627033414-4874f863e654

example.com$ gotip list -m golang.org/x/tools/gopls
golang.org/x/tools/gopls v0.1.1-0.20190627033414-4874f863e654
example.com$ gotip mod init example.com
go: creating new go.mod: module example.com

example.com$ gotip version
go version devel +998a9898 Thu Jun 27 04:16:38 2019 +0000 linux/amd64

example.com$ unset GOPROXY

example.com$ gotip get golang.org/x/tools/gopls@latest
go: finding golang.org/x/tools/gopls v0.1.0
go: downloading golang.org/x/tools/gopls v0.1.0
go: extracting golang.org/x/tools/gopls v0.1.0
go: downloading golang.org/x/tools v0.0.0-20190612231717-10539ce30318
go: extracting golang.org/x/tools v0.0.0-20190612231717-10539ce30318
go: downloading golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: extracting golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: finding golang.org/x/tools v0.0.0-20190612231717-10539ce30318
go: finding golang.org/x/sync v0.0.0-20190423024810-112230192c58

example.com$ gotip list -m golang.org/x/tools/gopls
golang.org/x/tools/gopls v0.1.0

example.com$ gotip get golang.org/x/tools/gopls@master
go: finding golang.org/x/tools/gopls master
go: downloading golang.org/x/tools/gopls v0.0.0-20190627033414-4874f863e654
go: extracting golang.org/x/tools/gopls v0.0.0-20190627033414-4874f863e654

example.com$ gotip list -m golang.org/x/tools/gopls
golang.org/x/tools/gopls v0.0.0-20190627033414-4874f863e654

@bcmills bcmills added modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 27, 2019
@bcmills bcmills added this to the Go1.13 milestone Jun 27, 2019
@bcmills
Copy link
Contributor

bcmills commented Jun 27, 2019

I believe that the proxy folks are currently in the process of testing go1.13beta1, so hopefully this issue will be resolved when they make the upgrade to 1.13. (That probably won't happen until closer to the Go 1.13 final release, though.)

CC @hyangah @katiehockman @heschik

@bcmills bcmills changed the title cmd/go: submodule pseudo-version incorrect following tagged version proxy.golang.org: deploy Go 1.13 fixes for pseudo-version derivation Jun 27, 2019
@bcmills
Copy link
Contributor

bcmills commented Jun 27, 2019

Specifically, this should be fixed when the proxy re-resolves the master branch after upgrading to a go command containing the fix for #27171.

It might be a little while. 🙂

@myitcv
Copy link
Member Author

myitcv commented Jun 27, 2019

Thanks @bcmills - my immediate problem will go away if I submit https://go-review.googlesource.com/c/tools/+/184018. Was holding off submitting until you had a chance to look; are we good to submit https://go-review.googlesource.com/c/tools/+/184018 now?

@bcmills
Copy link
Contributor

bcmills commented Jun 27, 2019

Also note that the v0.0.0- pseudo-version that you get today is valid under the new validation rules; it's just not the optimal name for that commit.

@bcmills
Copy link
Contributor

bcmills commented Jun 27, 2019

Should be fine to submit that CL. I think we've got a solid understanding of the behavior you've observed here.

@myitcv
Copy link
Member Author

myitcv commented Jun 27, 2019

Just to note the error that gave rise to all of this:

$ go get golang.org/x/tools/gopls@master golang.org/x/tools@master
go: finding golang.org/x/tools master
go: finding golang.org/x/tools/gopls master
go get: inconsistent versions:
        golang.org/x/tools@v0.0.0-20190627033414-4874f863e654 from golang.org/x/tools@master requires golang.org/x/tools/gopls@v0.1.0 (not golang.org/x/tools/gopls@v0.0.0-20190627033414-4874f863e654 from golang.org/x/tools/gopls@master)

Thanks - will submit that CL now.

@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 27, 2019
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 27, 2019
@gopherbot
Copy link

Change https://golang.org/cl/184719 mentions this issue: cmd/go: fix TestScript/mod_sumdb_golang to avoid assumptions about @v/list

gopherbot pushed a commit that referenced this issue Jul 2, 2019
…/list

I accidentally fetched an invalid version of rsc.io/quote from
proxy.golang.org, which the proxy then cached and now includes in
https://proxy.golang.org/rsc.io/quote/@v/list.

That causes 'go get rsc.io/quote` to resolve to a different version
depending on whether the proxy is used.

Adjust the test to fetch an explicit version instead, since the choice
of 'latest' is mostly irrelevant to the checksum database logic that
the test is intended to verify.

Updates #32805
Fixes #32900

Change-Id: I075b1f62e8c71545d0fb2dd4bd77ba525fc2a36d
Reviewed-on: https://go-review.googlesource.com/c/go/+/184719
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@helperShang

This comment has been minimized.

@heschi

This comment has been minimized.

@katiehockman
Copy link
Contributor

Now proxy.golang.org uses the 1.13 version of the go command, and all of the versions that are newly invalid in 1.13 (like the psuedoversion you listed) have been removed and should no longer be served through the mirror.
Hopefully this issue should now be resolved!

@bcmills bcmills closed this as completed Aug 6, 2019
@bcmills
Copy link
Contributor

bcmills commented Aug 7, 2019

For folks who are now running into versions that fail validation: see https://tip.golang.org/doc/go1.13#version-validation for suggested fixes and workarounds.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

7 participants