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
x/exp/cmd/gorelease: main module should not require newer version of itself #37567
Comments
I think this is not supposed to work, independent of the version. This is a cyclic dependency, and golang doesn't support that as far as I know. |
Go allows cyclic dependencies in modules, just not packages. |
Can I suggest a new title? "x/exp/cmd/gorelease: when main module has cycle to itself, only allow versions greater than latest in cycle" Or, something to that affect? The current title and description don't seem to match: the title says "cycles are not allowed", the description says "cycles are allowed but version has to be greater than greatest in cycle". |
Change https://golang.org/cl/273288 mentions this issue: |
Thoughts after looking into this for a while:
Does that sound about right @jayconrod ? |
@jadekler I don't think that's quite right: it's okay if a module requires a lower version of itself; a higher version should be an error though. For example, suppose we're running The approach you outlined should work except the condition at the end needs to be flipped. Also, this should apply at all major versions including v0. |
SG! Rewriting step
Logic above seems to hold, AFAICT? Probably missing something though - please let me know if I am! |
Suppose that module
example.com/main
requiresexample.com/a@v1.0.0
, which requiresexample.com/main@v1.5.0
.gorelease
should report an error when run onexample.com/main
with a proposed version lower thanv1.5.0
. A lower version will not be usable, since MVS will always upgrade the module to a higher version.The text was updated successfully, but these errors were encountered: