-
Notifications
You must be signed in to change notification settings - Fork 48
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
diff: latest release version still has old module path #33
Comments
Thanks for reporting this. I just pushed v0.5.1.
|
Thanks for the quick fix. |
Hey @sqs I think it's still happening on If I set the module dependency to direct like this |
@ppapapetrou76 as you said you have an indirect dependency it's probably some dependency of yours that pulls go-diff in with a wrong import path. In this case you could rewrite the path to the new one in your go.mod file like:
|
Indeed the root cause it's here golangci/golangci-lint#487 😄 TY!! |
Sorry for the problems caused, @ppapapetrou76. Just checking, it sounds like your problem is solved (or wil be solved when that PR is merged), right? |
I did the replace trick suggested before and now I get:
Not really looking for a resolution as the large set of issues I faced with |
@rameshvk Sorry to hear you've had a bad experience with modules. If you'd like, feel free to /cc me on an issue in the repository where you ran into the problem with more information, and I can take a look. Perhaps it's been fixed for Go 1.13 already, and if not, we want to make sure it does. The summary of the situation here is that version v0.5.0 of The following replace directive can be used in the main module to replace any incorrect module versions (in dependencies that haven't been updated yet) with a working one:
And/or:
|
Doing that replace gives me this error:
I also tried cloning the package locally (which is actually what I'd prefer) but that had a different set of errors. I find that most issues I run into have been reported (like this) -- it is just that the set of workarounds does not seem like things I can maintain. I suspect when all upstream packages migrate to |
My mistake, I didn't test the exact replace directive I suggested. Updated my post above to provide a better suggestion. @rameshvk Can you point me to a repository and a command I can run to reproduce your original problem? It'll be easier to diagnose this with more information. That said, you're right, the experience should improve over time. Still, I'm happy to help with your problem if you'd like. |
Thanks for your help, that does work (though its not clear to me why go mod -replace wont do a blanket replace as that itself is a useful feature) The repository I'm migrating is a dep of testmd and the only reason I'm migrating this is because I get an error downstream:
I figured upgrading this to |
Looks like the underlying For anyone interested, you can apply this workaround (as suggested by Dmitri above):
Or find the indirect dependency that pulls in the v0.5.0 and update it. In our case, we had to update |
Without transitive build constraints (such as in golang/dep#1124), the workarounds proposed here would need to be applied by every downstream dependency. Or am I missing something? |
That's correct. The act of changing an import path (issue #27) means every active downstream dependency needs to be updated to start using the new import path, or never update to newer versions via There's something that can be done on Sourcegraph's end to reduce toil for all downstream dependencies using the module mode. Right now the vanity import path serves a single go-import meta tag at https://sourcegraph.com/sourcegraph/go-diff?go-get=1: <meta name="go-import" content="sourcegraph.com/sourcegraph/go-diff git https://github.com/sourcegraph/go-diff"> It can add a second go-import meta tag that uses the "mod" VCS type and point to a module proxy that serves the However, there are two problems with that:
It would've been a better idea to consider at the time of changing the import path, but it's less useful to do it afterwards. I wrote this up for posterity, since this is a strategy that can be used in future for less disruptive import path changes. |
The import path of this package has changed in PR #30. /cc @sqs
However, the latest released version (v0.5.0) still has the old module path in its go.mod file:
https://github.com/sourcegraph/go-diff/blob/v0.5.0/go.mod#L1
As a result, trying to install the latest version of this package in module mode fails:
This can be fixed this by making a new release version (perhaps v0.5.1) that contains the new module path in the go.mod file.
The text was updated successfully, but these errors were encountered: