Skip to content

images/maker: fix building Go deps (again) #129

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

Merged
merged 1 commit into from
Jun 30, 2021
Merged

Conversation

errordeveloper
Copy link
Contributor

There appears to be a subtle difference between go mod download
and go mod download all. This change fixes the following error:

 #25 0.469 + mkdir -p /out/usr/local/bin
 #25 0.471 + go mod download
 #25 86.44 + go build -ldflags '-s -w' -o /out/usr/local/bin/docker-credential-env github.com/errordeveloper/docker-credential-env
 #25 86.50 missing go.sum entry for module providing package github.com/errordeveloper/docker-credential-env; to add:
 #25 86.50 	go mod download github.com/errordeveloper/docker-credential-env

@errordeveloper errordeveloper requested a review from a team as a code owner June 29, 2021 15:24
@errordeveloper errordeveloper requested a review from twpayne June 29, 2021 15:24
There appears to be a subtle difference between `go mod download`
and `go mod download all`. This change fixes the following error:

  #25 0.469 + mkdir -p /out/usr/local/bin
  #25 0.471 + go mod download
  #25 86.44 + go build -ldflags '-s -w' -o /out/usr/local/bin/docker-credential-env github.com/errordeveloper/docker-credential-env
  #25 86.50 missing go.sum entry for module providing package github.com/errordeveloper/docker-credential-env; to add:
  #25 86.50 	go mod download github.com/errordeveloper/docker-credential-env

Previous fix was implemented in #117.

Signed-off-by: Ilya Dmitrichenko <[email protected]>
@twpayne
Copy link
Contributor

twpayne commented Jun 30, 2021

Is this change correct? I don't see go mod download all mentioned in the documentation for go mod download.

@qmonnet
Copy link
Member

qmonnet commented Jun 30, 2021

The help message says the two commands are equivalent.

$ go help mod download
usage: go mod download [-x] [-json] [modules]

Download downloads the named modules, which can be module patterns selecting
dependencies of the main module or module queries of the form path@version.
With no arguments, download applies to all dependencies of the main module
(equivalent to 'go mod download all').

This file (is it up-to-date?) also seems to indicate that they do the same. I wonder how the two commands actually differ 🤔.

Note that I found this issue that might be relevant with future versions of Go.

@errordeveloper
Copy link
Contributor Author

This does fix build failure when I tested it, I don't know the issue to be honest, but the docs for this command seem rather limited...

@qmonnet qmonnet merged commit 7fce8df into master Jun 30, 2021
@qmonnet qmonnet deleted the go-mod-download-all branch June 30, 2021 16:04
@qmonnet
Copy link
Member

qmonnet commented Jun 30, 2021

Image build is fixed indeed 🎉

@twpayne
Copy link
Contributor

twpayne commented Jul 1, 2021

For info, I tested this on a personal repo yesterday evening and found that go mod download all does indeed have different behavior. It populates more of go.sum than a simple go mod download. PR: twpayne/chezmoi#1281.

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