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

Broken go.mod file (3.4): version tag not corresponding with package name #12109

Closed
bozaro opened this issue Jul 3, 2020 · 7 comments
Closed
Labels

Comments

@bozaro
Copy link

bozaro commented Jul 3, 2020

Issue

I can't get add to project etcd client 3.4+ without tricks:

➜  go get go.etcd.io/[email protected]
go get go.etcd.io/[email protected]: go.etcd.io/[email protected]: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v

Workaround

Add module replace by commit hash instead of tag name:

➜  git rev-list -n 1 v3.4.9
54ba9589114fc3fa5cc36c313550b3c0c0938c91
➜  go mod edit -replace go.etcd.io/etcd=github.com/etcd-io/etcd@$(git rev-list -n 1 v3.4.9)
➜  cat go.mod 
module bozaro.ru/example

go 1.14

replace go.etcd.io/etcd => github.com/etcd-io/etcd v0.5.0-alpha.5.0.20200520232829-54ba9589114f

Correct solution (unfortunatelly it is breaking change)

  1. Update package name in go.mod by adding v3 suffix:
➜  go mod edit -module go.etcd.io/etcd/v3 go.mod
  1. Update package name in all *.go files:
➜  find . -type f -name '*.go' -exec sed -i -e 's,go.etcd.io/etcd,go.etcd.io/etcd/v3,g' {} \;

References

@bozaro bozaro changed the title Broken go.mod file: version tag not corresponding with package name Broken go.mod file (3.4): version tag not corresponding with package name Jul 3, 2020
@ldelossa
Copy link

ldelossa commented Jul 3, 2020

I also think "go getting" the latest commit hash pulls in the correct code without the need for the replace.

@ptabor
Copy link
Contributor

ptabor commented Jul 4, 2020

I believe this got fixed in 3.5.x branch: #11820 .
I think changes of all imports paths are too big change for backporting to a patch release.

@ptabor
Copy link
Contributor

ptabor commented Jul 4, 2020

Please see #12068 (comment) for summary of the current etcd go.mod situation.

@stale
Copy link

stale bot commented Oct 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 2, 2020
@stale stale bot closed this as completed Oct 23, 2020
@feldgendler
Copy link

@ptabor Hi! This is half a year old, and v3.5.0 is still not released. Can we hope for either a v3.5.0 release, or a fix on the v3.4.x branch?

@ptabor
Copy link
Contributor

ptabor commented Feb 9, 2021

I plan to finalize #12652 (grpc-1.32 - that is code complete) and make experimental 3.5.0-alpha.0 release.
There is no readmap (unfortunately) for final 3.5.0 release.

@feldgendler
Copy link

@ptabor Thanks a lot for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants