Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Run "go mod download" before builds if in modules mode #118

Open
apparentlymart opened this issue Oct 27, 2018 · 0 comments
Open

Run "go mod download" before builds if in modules mode #118

apparentlymart opened this issue Oct 27, 2018 · 0 comments

Comments

@apparentlymart
Copy link

As discussed in golang/go#26794, multiple processes of the go command cannot be safely run concurrently in the case where it installs new modules, since the installations will race. Since gox runs multiple concurrent go build processes, it can potentially encounter this problem.

The recommendation in that other issue is to run go mod download before the build begins in order to populate the local cache of modules, after which it is safe to run concurrent go build as long as no new dependencies have been introduced in the mean time.

Since go mod download doesn't exist in Go versions prior to 1.11, it may be necessary to run it only selectively depending on the Go version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant