-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
Retraction in go.mod should be allowed to retract versions of subdirectory go.mod files in the same git repo #49015
Comments
1 seems infeasible, the module system doesn't operate on the concept of repos, and individual modules are independent. 2 is already possible possible by publishing a higher version which retracts all the versions before, up to and including the current version |
Sorry @seankhliao I didn't explain myself well in my proposal 2. My understanding is (please correct me if I'm wrong) that the current thing we have in 2, is that yes we can retract all previous versions of this module in the Thus, my proposal is to add something like (any of the following or some better names, I'm bad at names):
With the semantic of "retract all previous versions of this module, and also ignore the current version of this module and lookup the parent directory for go module instead". Does that make sense? |
Say you're currently have You can add a commit with |
Thankns, @seankhliao! That worked. |
skipci. Currently when people going to https://pkg.go.dev/github.com/apache/[email protected]/lib/go/thrift it shows that a previous version with lib/go/thrift/go.mod file is the latest version. With solution provided in golang/go#49015 (comment), this commit will NOT be merged, but tagged as `lib/go/thrift/v0.0.1-do-not-use`, in order to retract the bad version and make `v0.15.0` and the future versions as the correct latest version recognized by go toolchain.
Currently when people going to https://pkg.go.dev/github.com/apache/[email protected]/lib/go/thrift it shows that a previous version with lib/go/thrift/go.mod file is the latest version. With solution provided in golang/go#49015 (comment), this commit will NOT be merged, but tagged as `lib/go/thrift/v0.0.1-do-not-use`, in order to retract the bad version and make `v0.15.0` and the future versions as the correct latest version recognized by go toolchain. [skip ci]
Currently when people going to https://pkg.go.dev/github.com/apache/[email protected]/lib/go/thrift it shows that a previous version with lib/go/thrift/go.mod file is the latest version. With solution provided in golang/go#49015 (comment), this commit will NOT be merged, but tagged as `lib/go/thrift/v0.0.1-do-not-use`, in order to retract the bad version and make `v0.15.0` and the future versions as the correct latest version recognized by go toolchain. [skip ci]
Currently when people going to https://pkg.go.dev/github.com/apache/[email protected]/lib/go/thrift it shows that a previous version with lib/go/thrift/go.mod file is the latest version. With solution provided in golang/go#49015 (comment), this commit will NOT be merged, but tagged as `lib/go/thrift/v0.0.1-do-not-use`, in order to retract the bad version and make `v0.15.0` and the future versions as the correct latest version recognized by go toolchain. [skip ci]
Currently when people going to https://pkg.go.dev/github.com/apache/[email protected]/lib/go/thrift it shows that a previous version with lib/go/thrift/go.mod file is the latest version. With solution provided in golang/go#49015 (comment), this commit will NOT be merged, but tagged as `lib/go/thrift/v0.0.1-do-not-use`, in order to retract the bad version and make `v0.15.0` and the future versions as the correct latest version recognized by go toolchain. [skip ci]
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
This is the latest release
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
This is forked from the discussion of #34055 and is an issue currently affecting Apache Thrift.
I made a minimal reproducible example at https://github.com/fishy/test-go-mod-retract to demonstrate the issue, but the high level summary is:
go.mod
to a subdirectory, without realizing the consequences of that.go.mod
in the subdirectory and addedgo.mod
to the root directory instead.go.mod
under the subdirectory will be recognized by go toolchain (and pkg.go.dev site) as the "latest" version, over whatever git semver tag you tagged at the project later (for example, if you go to https://pkg.go.dev/github.com/apache/[email protected]/lib/go/thrift, it will tell you that it's not the "latest" version).go.mod
file, it won't work (as I demonstrated in the test-go-mod-retract repo).What did you expect to see?
Either:
go.mod
file, from the rootgo.mod
fileor
go.mod
file (e.g. we can add the subdirectorygo.mod
saying "every previous version coming out of thisgo.mod
file are retracted and this go.mod file should be ignored")What did you see instead?
The consequences of the mistake of adding subdirectory
go.mod
file lasts forever with no way to fix completely.The text was updated successfully, but these errors were encountered: