Skip to content

[19.03 backport] Fix bug in gotestsum installer causing dependencies to not be downloaded#40988

Merged
tiborvass merged 1 commit intomoby:19.03from
thaJeztah:19.03_backport_fix_gotestsum_install
May 19, 2020
Merged

[19.03 backport] Fix bug in gotestsum installer causing dependencies to not be downloaded#40988
tiborvass merged 1 commit intomoby:19.03from
thaJeztah:19.03_backport_fix_gotestsum_install

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

backport of the Linux-related changes of #40979
the Windows Dockerfile in the 19.03 branch does not yet install gotestsum, so no changes were needed for Windows

Building gotestsum started to fail after the repository removed some
dependencies on master.

What happens is that first, we go get the package (with go modules disabled);

GO111MODULE=off go get -d gotest.tools/gotestsum

Which gets the latest version from master, and fetches the dependencies used
on master. Then we checkout the version we want to install (for example v0.3.5)
and run go build.

However, v0.3.5 depends on logrus, and given that we ran go get for master,
that dependency was not fetched, and build fails.

This patch modifies the installer to use go modules (alternatively we could
probably run go get . after checking out the v0.3.5 version),

We need to modify all installers, as it looks like this is a standard pattern
we use, but other dependencies were not failing (yet), so this patch only
addresses the immediate failure.

Building gotestsum started to fail after the repository removed some
dependencies on master.

What happens is that first, we `go get` the package (with go modules disabled);

    GO111MODULE=off go get -d gotest.tools/gotestsum

Which gets the latest version from master, and fetches the dependencies used
on master. Then we checkout the version we want to install (for example `v0.3.5`)
and run go build.

However, `v0.3.5` depends on logrus, and given that we ran `go get` for `master`,
that dependency was not fetched, and build fails.

This patch modifies the installer to use go modules (alternatively we could
probably run `go get .` after checking out the `v0.3.5` version),

We need to modify all installers, as it looks like this is a standard pattern
we use, but other dependencies were not failing (yet), so this patch only
addresses the immediate failure.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1d9da1b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 19.03.9 milestone May 17, 2020
@thaJeztah thaJeztah requested a review from tianon as a code owner May 17, 2020 20:56
@thaJeztah
Copy link
Copy Markdown
Member Author

@tiborvass

Copy link
Copy Markdown
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

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

LGTM

@tiborvass tiborvass merged commit c1cc6ec into moby:19.03 May 19, 2020
@thaJeztah thaJeztah deleted the 19.03_backport_fix_gotestsum_install branch May 19, 2020 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants