Skip to content

go.mod: docker 5aac513617f072b15322b147052cbda0d451d389 / v22.06-dev#9940

Merged
thaJeztah merged 1 commit into
docker:v2from
thaJeztah:go1.18_compat
Oct 21, 2022
Merged

go.mod: docker 5aac513617f072b15322b147052cbda0d451d389 / v22.06-dev#9940
thaJeztah merged 1 commit into
docker:v2from
thaJeztah:go1.18_compat

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

This restores compatibility with go1.18, which was broken since commit; moby/moby@c062238

cmd.Environ() is new in go1.19, and not needed for this specific case. Without this, trying to use this package in code that uses go1.18 will fail;

builder/remotecontext/git/gitutils.go:216:23: cmd.Environ undefined (type *exec.Cmd has no field or method Environ)

Changing to use os.Environ() instead restores compatibility with go1.18

Full diff: moby/moby@f9cb47a...5aac513

Related issue

(not mandatory) A picture of a cute animal, if possible in relation with what you did

This restores compatibility with go1.18, which was broken since commit;
moby/moby@c062238

cmd.Environ() is new in go1.19, and not needed for this specific case.
Without this, trying to use this package in code that uses go1.18 will fail;

    builder/remotecontext/git/gitutils.go:216:23: cmd.Environ undefined (type *exec.Cmd has no field or method Environ)

Changing to use `os.Environ()` instead restores compatibility with go1.18

Full diff: moby/moby@f9cb47a...5aac513

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah

Copy link
Copy Markdown
Member Author

@milas @StefanScherer @glours PTAL 🤗

@codecov-commenter

codecov-commenter commented Oct 21, 2022

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.56%. Comparing base (e8ea3ad) to head (533abc3).

Additional details and impacted files
@@           Coverage Diff           @@
##               v2    #9940   +/-   ##
=======================================
  Coverage   74.56%   74.56%           
=======================================
  Files           2        2           
  Lines         232      232           
=======================================
  Hits          173      173           
  Misses         51       51           
  Partials        8        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@glours glours left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@thaJeztah

Copy link
Copy Markdown
Member Author

I'll bring this one in, so that it's the first commit after v2.12.1, keeping our options open 👍

@thaJeztah
thaJeztah merged commit f472ce3 into docker:v2 Oct 21, 2022
@thaJeztah
thaJeztah deleted the go1.18_compat branch October 21, 2022 19:37
@milas

milas commented Oct 21, 2022

Copy link
Copy Markdown
Contributor

FWIW we maintain compatibility with compose-go for both actively supported Go versions (and have CI to that effect), but have explicitly not actively supported docker/compose usage as a library thus far

(Agreed that having the change available is good though, thanks for making the updates here)

@thaJeztah

Copy link
Copy Markdown
Member Author

@milas yeah, so in this case, it was because compose depends on (not yet released) v22.06 code (through buildx). v22.06 is intended for go1.19 and above, but the current 20.10 release is still on go1.18. The release pipeline uses that version of go to build the binaries (which currently does not allow for differentiation go versions for each individual binary), causing the build to fail; docker/docker-ce-packaging#775

Perhaps we can add some hacks to install multiple go versions in the container build environment (and some PATH tricks to switch versions), but we didn't have it yet, so having this change in gives use options to either patch the build pipeline, or do a 2.12.2 patch release from the commit from this PR.

@milas

milas commented Oct 21, 2022

Copy link
Copy Markdown
Contributor

Ah right, docker-ce-packaging 🙈

@thaJeztah

Copy link
Copy Markdown
Member Author

I know.. I know. Having all tied together.. complicate "things".

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.

4 participants