Skip to content

Bump Go to 1.17.5 and start using modules#218

Closed
errordeveloper wants to merge 2 commits intodocker:masterfrom
errordeveloper:go-mod
Closed

Bump Go to 1.17.5 and start using modules#218
errordeveloper wants to merge 2 commits intodocker:masterfrom
errordeveloper:go-mod

Conversation

@errordeveloper
Copy link
Contributor

@errordeveloper errordeveloper commented Dec 15, 2021

This is needed for moby/moby#43075

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this to fix the vendor failure on that PR? So;

go: finding module for package camlistore.org/pkg/throttle
github.com/docker/docker/libnetwork imports
	github.com/docker/libkv/store/zookeeper imports
	github.com/samuel/go-zookeeper/zk tested by
	github.com/samuel/go-zookeeper/zk.test imports
	camlistore.org/pkg/throttle: module camlistore.org@latest found (v0.0.0-20171230002226-a5a65f0d8b22), but does not contain package camlistore.org/pkg/throttle
github.com/docker/docker/daemon/logger/gcplogs imports
	cloud.google.com/go/logging imports
	cloud.google.com/go tested by
	cloud.google.com/go.test imports
	cloud.google.com/go/bigquery imports
	cloud.google.com/go/internal/detect: module cloud.google.com/go@latest found (v0.99.0, replaced by cloud.google.com/go@v0.44.3), but does not contain package cloud.google.com/go/internal/detect

I'm not strictly against doing this, but overall, we should try to deprecate / replace this package;

the require lines in this repository likely shouldn't affect the Moby PR (as it would already default to picking "latest"), and (as mentioned) the replace directive is non-transitional, so would still be needed in the moby repository; wondering if we should start with adding (if needed) replace lines in the Moby PR 🤔

go.mod Outdated

require (
github.com/coreos/etcd v3.3.25+incompatible
github.com/hashicorp/consul/api v1.1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing this with the current version used in moby; hashicorp/consul@v0.5.2...api/v1.1.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is another problem, go mod tidy trips over this library because v0.5.2 doesn't use models, but new version of it does. Without and there is no issue with this library at all until you run go mod tidy...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.com/docker/docker/libnetwork imports
	github.com/docker/libkv/store/consul imports
	github.com/hashicorp/consul/api loaded from github.com/hashicorp/consul@v0.5.2,
	but go 1.16 would fail to locate it:
	ambiguous import: found package github.com/hashicorp/consul/api in multiple modules:
	github.com/hashicorp/consul v0.5.2 (/Users/ilya/Code/moby/.gopath/pkg/mod/github.com/hashicorp/consul@v0.5.2/api)
	github.com/hashicorp/consul/api v1.1.0 (/Users/ilya/Code/moby/.gopath/pkg/mod/github.com/hashicorp/consul/api@v1.1.0)

@crazy-max and I tried a few different replace options, still the same issue...

go.mod Outdated
require (
github.com/coreos/etcd v3.3.25+incompatible
github.com/hashicorp/consul/api v1.1.0
github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing this one as well samuel/go-zookeeper@d0e0d8e...7117e9e

Comment on lines 6 to 10
github.com/coreos/etcd v3.3.25+incompatible
github.com/hashicorp/consul/api v1.1.0
github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414
github.com/stretchr/testify v1.7.0
go.etcd.io/bbolt v1.3.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sigs.k8s.io/yaml v1.3.0 // indirect
)

replace google.golang.org/grpc => google.golang.org/grpc v1.23.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that replace rules are non-transitive, so this line would still be needed in moby/moby

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>

go:
- 1.8.7
- 1.17.5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI seems broken, I will open a PR to fix it first if you want. SGTY @thaJeztah?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, although don't spend too much time on it; we really need to reduce use of this dependency (it's good to know if things are not broken of course)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a huge jump 1.8 > 1.17, better to do that in a follow-up 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm just being very opportunistic and putting all my trust in Go's backwards compatibility promise 😹
And, to be fair, this has already been built in Moby using all mort recent versions of Go...

@errordeveloper
Copy link
Contributor Author

Was this to fix the vendor failure on that PR?

Yes. Just trying to address the issue with zookeeper client and it's dead camlistore.org dependency... I'm still quite confused about these. Will report back once I have a slightly clearer idea.

@errordeveloper
Copy link
Contributor Author

wondering if we should start with adding (if needed) replace lines in the Moby PR

I tried, and it didn't work. I think I'll need to update this repo to use the new client, make it work and go back to Moby.

It also looks like the issue in Moby PR comes to surface when go mod tidy runs and doesn't actually matter for any other steps of the build.

@thaJeztah
Copy link
Member

I tried, and it didn't work. I think I'll need to update this repo to use the new client, make it work and go back to Moby.

Gotcha; so I didn't initially notice (thanks @crazy-max) that CI wasn't running on this PR, and thought no local changes were needed (besides the go module versions)

@errordeveloper
Copy link
Contributor Author

Gotcha; so I didn't initially notice (thanks @crazy-max) that CI wasn't running on this PR, and thought no local changes were needed (besides the go module versions)

I was hoping CI would run... I ran go test ./... locally, but not sure if failures I'm seeing are to do with lack of proper setup or not. I can dig into it, but I thought of trying to make switch to new ZK client first and see if the code even builds without changes or now.

@crazy-max
Copy link
Member

Gotcha; so I didn't initially notice (thanks @crazy-max) that CI wasn't running on this PR, and thought no local changes were needed (besides the go module versions)

I was hoping CI would run... I ran go test ./... locally, but not sure if failures I'm seeing are to do with lack of proper setup or not. I can dig into it, but I thought of trying to make switch to new ZK client first and see if the code even builds without changes or now.

Yeah zookeeper, etcd and consul bins seems to be required.

@errordeveloper
Copy link
Contributor Author

Can we re-enable Travis for this repo?

"github.com/docker/libkv"
"github.com/docker/libkv/store"
zk "github.com/samuel/go-zookeeper/zk"
zk "github.com/go-zookeeper/zk"
Copy link
Contributor Author

@errordeveloper errordeveloper Dec 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to work without further changes!

@errordeveloper
Copy link
Contributor Author

Coming for now in favour of #219. Switching to modules wasn't as helpful as I originally thought it might be :)

errordeveloper added a commit to errordeveloper/docker that referenced this pull request Dec 15, 2021
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies
errordeveloper added a commit to errordeveloper/docker that referenced this pull request Dec 15, 2021
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
errordeveloper added a commit to errordeveloper/docker that referenced this pull request Dec 16, 2021
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
errordeveloper added a commit to errordeveloper/docker that referenced this pull request Dec 17, 2021
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
errordeveloper added a commit to errordeveloper/docker that referenced this pull request Dec 17, 2021
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
errordeveloper added a commit to errordeveloper/docker that referenced this pull request Dec 17, 2021
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
errordeveloper added a commit to errordeveloper/docker that referenced this pull request Dec 22, 2021
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Dec 22, 2021
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Jan 6, 2022
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Jan 10, 2022
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Jan 12, 2022
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Jan 18, 2022
- use `vendor.mod` instead of `go.mod` to avoid issues to do with
  use of CalVer, not SemVer
- ensure most of the dependency versions do not change
  - only zookeeper client has to change (via docker/libkv#218) as
    previously used version is no longer maintained and has missing
    dependencies

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants