-
Notifications
You must be signed in to change notification settings - Fork 9.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
go.mod:incorrect pacakge dependency in etcd 3.3 without go.mod #12068
Comments
test and verify:exec cmd:
It was fixed. @gyuho Can you release a new version for this issue? |
Still broken in etcd 3.4: #12109 |
Shouldn't we be concerned that this change is introducing inconsistent approaches between branches: A) release-3.2 -> legacy - no go.mod at all B) release-3.3. -> was no go.mod (as 3.2), but this PR introduces >> module go.etcd.io/etcd Moreover release-3.3. still using github.com/coreos/etcd package naming, so the module name C) release-3.4 -> Is using module go.etcd.io/etcd violating the go versioning rules. D) release-3.5 in particular with #11820 introduces:
State A) is proper legacy state (+incompatible) according to go modules:
State D) is proper go.mod state.
works and resolves to
The referenced 15884e9 is fresh commit. State B) & D) are not supported and causing problems for tools:
Some workaround is to do:
That leads to awkward binding of:
Options forwardA) Revert this change and preserve the supported legacy behavior of 3.2 on 3.3 branch. B) Backport #11820 to 3.3. & 3.4 patch, changing the module name to: go.etcd.io/etcd/v3 and import paths. C) (might by combined with A) Accelerate release of 3.5.0 branch to give customers a proper go-mod compatible dependency. |
About option A, If revert this change ,The problem still appears like tihs issue. some package dependency incorrect.. In by the way,I am also confused module name with |
Have you tried playing with replace() [1] in your go.mod ? Kubernetes is using: replace ( While in theory, following directives would be a cleaner representation: replace ( |
Yeah,I know it. But use go mod replace is an extra operation. and many people do not know how to solve this who encounter this problem. |
etcd rewrote its import path from coreos/etcd to go.etcd.io/etcd/v3. Changed the imports path in this commit. This lets us remove the github.com/ugorji/go/codec dependency, which was pinned to a fairly old version. The net change is a loss of 30,000 lines of code in the vendor directory. (I first noticed this problem because the outdated go/codec dependency was causing a dependency failure when I tried to put Terraform and another project in the same vendor directory.) One oddity is that the commit shows up in go.mod as 3.3.0 but is actually after 3.4.9, there's some discussion of that (and how to resolve it) here. etcd-io/etcd#12068 (comment)
The proper way is to release a new v4 for go.mod. For any version > 1, pre and post go.mod are not compatible. Any workaround such as |
George: I assume that the plan is that at the time etcd will release: go.etcd.io/etcd/v3 (that represents branch 3.5) that is proper v3 module that holds the package compatibility rule. So all the etcd/v3 packages will be compatible... they will just start late in the history. I don't think we can afford major version (v4) any time soon. CFC4N: Extra steps are unfortunate, but they can be solved for 3.2 & 3.3 by proper documentation. I think current change grows the complexity. |
I don't think so. and I think this change makes it easy to use client v3. |
etcd rewrote its import path from coreos/etcd to go.etcd.io/etcd/v3. Changed the imports path in this commit. This lets us remove the github.com/ugorji/go/codec dependency, which was pinned to a fairly old version. The net change is a loss of 30,000 lines of code in the vendor directory. (I first noticed this problem because the outdated go/codec dependency was causing a dependency failure when I tried to put Terraform and another project in the same vendor directory.) One oddity is that the commit shows up in go.mod as 3.3.0 but is actually after 3.4.9, there's some discussion of that (and how to resolve it) here. etcd-io/etcd#12068 (comment)
@hexfusion is there any focus on fixing these import issues? I am trying to incorporate ectd into several projects and this is becoming pretty painful. |
@ldelossa are you using a workaround other than using a fork? |
@mohdahmad17 im importing via the latest commit hash directly. |
@ptabor, I notice that there are not currently any Option (E) is: change the |
@bcmills That would be my preference. I would tag the unreleased branch (master) as 0.3.2, 0.3.3, 0.3.4 (or 0.32.0, 0.33.0, 0.34.0) to indicate no promise of backward compatibility between them, |
@ptabor By the way you can use "-" to indecate pre-release versions
|
etcd rewrote its import path from coreos/etcd to go.etcd.io/etcd/v3. Changed the imports path in this commit. This lets us remove the github.com/ugorji/go/codec dependency, which was pinned to a fairly old version. The net change is a loss of 30,000 lines of code in the vendor directory. (I first noticed this problem because the outdated go/codec dependency was causing a dependency failure when I tried to put Terraform and another project in the same vendor directory.) One oddity is that the commit shows up in go.mod as 3.3.0 but is actually after 3.4.9, there's some discussion of that (and how to resolve it) here. etcd-io/etcd#12068 (comment)
etcd rewrote its import path from coreos/etcd to go.etcd.io/etcd/v3. Changed the imports path in this commit. This lets us remove the github.com/ugorji/go/codec dependency, which was pinned to a fairly old version. The net change is a loss of 30,000 lines of code in the vendor directory. (I first noticed this problem because the outdated go/codec dependency was causing a dependency failure when I tried to put Terraform and another project in the same vendor directory.) One oddity is that the commit shows up in go.mod as 3.3.0 but is actually after 3.4.9, there's some discussion of that (and how to resolve it) here. etcd-io/etcd#12068 (comment)
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. |
There are many developers on the web, confused by how to install etcd v3 for the development of go project. A number of similar errors were encountered, as follows: etcd-io#13108 ``` ➜ ~ go version go version go1.16.5 darwin/amd64 ➜ ~ go get go.etcd.io/etcd/clientv3 go: downloading golang.org/x/net v0.0.0-20201021035429-f5854403a974 # github.com/coreos/etcd/clientv3/balancer/picker go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions # github.com/coreos/etcd/clientv3/balancer/resolver/endpoint go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption ``` There are many examples of confusion here: - etcd-io#12577 - etcd-io#12181 - etcd-io#12068 - etcd-io#11931 ...... So, As suggested by @lilic , I submitted Readme update.
There are many developers on the web, confused by how to install etcd v3 for the development of go project. A number of similar errors were encountered, as follows: etcd-io#13108 ``` ➜ ~ go version go version go1.16.5 darwin/amd64 ➜ ~ go get go.etcd.io/etcd/clientv3 go: downloading golang.org/x/net v0.0.0-20201021035429-f5854403a974 # github.com/coreos/etcd/clientv3/balancer/picker go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions # github.com/coreos/etcd/clientv3/balancer/resolver/endpoint go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption ``` There are many examples of confusion here: - etcd-io#12577 - etcd-io#12181 - etcd-io#12068 - etcd-io#11931 ...... So, As suggested by @lilic , I submitted Readme update.
There are many developers on the web, confused by how to install etcd v3 for the development of go project. A number of similar errors were encountered, as follows: etcd-io#13108 ``` ➜ ~ go version go version go1.16.5 darwin/amd64 ➜ ~ go get go.etcd.io/etcd/clientv3 go: downloading golang.org/x/net v0.0.0-20201021035429-f5854403a974 # github.com/coreos/etcd/clientv3/balancer/picker go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions # github.com/coreos/etcd/clientv3/balancer/resolver/endpoint go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption ``` There are many examples of confusion here: - etcd-io#12577 - etcd-io#12181 - etcd-io#12068 - etcd-io#11931 ...... So, As suggested by @lilic , I submitted Readme update.
There are many developers on the web, confused by how to install etcd v3 for the development of go project. A number of similar errors were encountered, as follows: etcd-io#13108 ``` ➜ ~ go version go version go1.16.5 darwin/amd64 ➜ ~ go get go.etcd.io/etcd/clientv3 go: downloading golang.org/x/net v0.0.0-20201021035429-f5854403a974 # github.com/coreos/etcd/clientv3/balancer/picker go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions # github.com/coreos/etcd/clientv3/balancer/resolver/endpoint go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption ``` There are many examples of confusion here: - etcd-io#12577 - etcd-io#12181 - etcd-io#12068 - etcd-io#11931 ...... So, As suggested by @lilic , I submitted Readme update.
There are many developers on the web, confused by how to install etcd v3 for the development of go project. A number of similar errors were encountered, as follows: etcd-io#13108 ``` ➜ ~ go version go version go1.16.5 darwin/amd64 ➜ ~ go get go.etcd.io/etcd/clientv3 go: downloading golang.org/x/net v0.0.0-20201021035429-f5854403a974 # github.com/coreos/etcd/clientv3/balancer/picker go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions # github.com/coreos/etcd/clientv3/balancer/resolver/endpoint go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption ``` There are many examples of confusion here: - etcd-io#12577 - etcd-io#12181 - etcd-io#12068 - etcd-io#11931 ...... So, As suggested by @lilic , I submitted Readme update.
There are many developers on the web, confused by how to install etcd v3 for the development of go project. A number of similar errors were encountered, as follows: etcd-io#13108 ``` ➜ ~ go version go version go1.16.5 darwin/amd64 ➜ ~ go get go.etcd.io/etcd/clientv3 go: downloading golang.org/x/net v0.0.0-20201021035429-f5854403a974 # github.com/coreos/etcd/clientv3/balancer/picker go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions # github.com/coreos/etcd/clientv3/balancer/resolver/endpoint go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption ``` There are many examples of confusion here: - etcd-io#12577 - etcd-io#12181 - etcd-io#12068 - etcd-io#11931 ...... So, As suggested by @lilic , I submitted Readme update.
shell:
and type code with:
condition 1
condition 2
error logs:
rootcause
There is not
go.mod
in https://github.com/etcd-io/etcd/tree/v3.3.22 . via https://pkg.go.dev/go.etcd.io/etcd/?tab=doc .go mod will get lastest version package default.
If we build project in etcd repo ,it works. because go mod will translate package version from glide.lock with correct version.
but if used clientv3 sdk ,it will failed ,go mod will not translate package for indirect package .and error logs with this issue.
other issue
#12028
#12009
#11931
#11829
#11808
#11772
#11749
#11721
#11707
and other complain : https://colobu.com/2020/04/09/accidents-of-etcd-and-go-module/ 🤣
solution
go.mod
andgo.sum
into etcd 3.3 repo forGO111MODULE=on
( build this project andgo get go.etcd.io/etcd
for other project )glide.lock
andglide.yaml
forGO111MODULE=off
/cc @gyuho @mitake @spzala
The text was updated successfully, but these errors were encountered: