-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
formula: set GOPATH #7776
formula: set GOPATH #7776
Conversation
Looks like |
Probably makes sense to set this in brew/Library/Homebrew/formula.rb Lines 1797 to 1808 in d0821de
grep for GOCACHE ).
|
If I understood correctly, those ENV variables in |
Nope, the |
Oh, I was looking at |
So we can cache dependencies and speed up subsequent builds.
@@ -2142,6 +2142,7 @@ def stage | |||
stage_env[:_JAVA_OPTIONS] = | |||
"#{ENV["_JAVA_OPTIONS"]&.+(" ")}-Duser.home=#{HOMEBREW_CACHE}/java_cache" | |||
stage_env[:GOCACHE] = "#{HOMEBREW_CACHE}/go_cache" | |||
stage_env[:GOPATH] = "#{HOMEBREW_CACHE}/go_mod_cache" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth setting in run_test
too or is it basically never going to be used there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm, I don't think we run any go
command often in test blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np, shipit!
Note for the future generation. With the release of Go 1.15, we should change |
brew style
with your changes locally?brew tests
with your changes locally?This change can speed up subsequent builds of formulae using Go Modules.
I think for us, the benefit could be: quicker
go
formula builds on CI or quicker local rebuilds of formulae when applying some changes.Ideally we would wait for: golang/go#34527
and then just set
GOMODCACHE
, which will be a better choice instead ofGOPATH
.