-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
Cannot speed compiling when using go build -mod=vendor
#46944
Comments
go build -mod=vendor
go build -mod=vendor
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only. For questions please refer to https://github.com/golang/go/wiki/Questions |
Thanks for your info, ask it in Slack: https://gophers.slack.com/archives/C029RQSEE/p1624784324040700 |
Asked it again here: https://gophers.slack.com/archives/C9BMAAFFB/p1624841383206400 |
go build -mod=vendor
go build -mod=vendor
go build -mod=vendor
go build -mod=vendor
Reopen it, since I thought this is a prroblem we should fix, at least a feature request. |
/reopen |
I don't think you are correctly describing how the system works. Please use a forum, as suggested above, to see how the system works, and then file an issue describing specific changes to make. In particular the module cache, the build cache, and the temporary work directory are all different things. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I want to use the dependency packages with specific versions, and don't want to depend on the Network. So, we use
go build -mod=vendor
for compiling. To save building time, we want to cache the binary so that it only rebuilds when the source is newer.What did you expect to see?
When using
go build
for building, it saves themod cache
(*.a
files) to the$GOPATH/pkg/mod
. We can reuse this cache and rebuilding the binary faster.But, when using
go build -mod=vendor
, it works/saves the cache(*.a
files) to a random temporary(such as/tmp/go-build1307922253/
)WORK
folder, and remove it once compiling done. So, that means, it will never reuse themod cache
when runninggo build -mod=vendor
for compiling. Is it right?So, how to utilize the
mod cache
to speed the compiling when using thego build -mod=vendor
? Much appreciate!What did you see instead?
The text was updated successfully, but these errors were encountered: