golang/go
View on GitHubcmd/go: do not allow the main module to replace (to or from) itself
Open
#34,417 opened on Sep 19, 2019
GoCommandNeedsFixhelp wantedmodules
Repository metrics
- Stars
- (133,883 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
What version of Go are you using (go version)?
This problem is also seen on Linux using go1.12.3
And on Mac with the tip branch
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env)?
What did you do?
Option A:
$ git clone https://github.com/rselph-tibco/go-unstable-mods.git
$ cd go-unstable-mods
$ git checkout start_here
$ git switch -c new_branch
$ ./run.sh
The git repository will be updated with the results of each step. Optionally, comment out the git commands to simply produce the error without recording results along the way.
This is equivalent to:
- Start with the contents of the attached file go-unstable-mods-start_here.tar.gz
- Set GOPATH and GOCACHE to point at empty directories
- From the sample1 directory run
go mod tidy - From the sample2 directory run
go mod tidy - From the sample2 directory run
go install ./... - From the sample1 directory run
go install ./... - Repeat the last step indefinitely
At this point, sample1/go.mod will never stabilize.
What did you expect to see?
go.mod should stabilize when the build is given the same inputs over and over.
What did you see instead?
go.mod eventually oscillates between two states, preventing -mod readonly from ever working, and wreaking
havoc with source control.