-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/go: -pkgdir doesn't respect -installsuffix or its variants #20137
Comments
For Go 1.9 I'm inclined to leave this alone; Go 1.10 will probably make it unnecessary to exercise this kind of control. |
On Mon, Jun 5, 2017 at 7:00 AM, Russ Cox ***@***.***> wrote:
Go 1.10 will probably make it unnecessary to exercise this kind of control.
Can you elaborate? Is this tracked somewhere?
|
@rsc seems to be planning an overhaul of build caching (source 1, source 2, source 3) for Go 1.10, though I can't seem to turn up more information about the project. I too would be quite interested to hear more about what's in store! Build/test caching is one of our bigger pain points over at CockroachDB. |
Change https://golang.org/cl/75473 mentions this issue: |
This CL adds caching of built package files in $GOCACHE, so that a second build with a particular configuration will be able to reuse the work done in the first build of that configuration, even if the first build was only "go build" and not "go install", or even if there was an intervening "go install" that wiped out the installed copy of the first build. The benchjuju benchmark runs go build on a specific revision of jujud 10 times. Before this CL: 102.72u 15.29s 21.98r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 105.99u 15.55s 22.71r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 106.49u 15.70s 22.82r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 107.09u 15.72s 22.94r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 108.19u 15.85s 22.78r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 108.92u 16.00s 23.02r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 109.25u 15.82s 23.05r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 109.57u 15.96s 23.11r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 109.86u 15.97s 23.17r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 110.50u 16.05s 23.37r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... After this CL: 113.66u 17.00s 24.17r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 3.85u 0.68s 3.49r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 3.98u 0.72s 3.63r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 4.07u 0.72s 3.57r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 3.98u 0.70s 3.43r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 4.58u 0.70s 3.58r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 3.90u 0.70s 3.46r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 3.85u 0.71s 3.52r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 3.70u 0.69s 3.64r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... 3.79u 0.68s 3.41r go build -o /tmp/jujud github.com/juju/juju/cmd/jujud ... This CL reduces the overall all.bash time from 4m22s to 4m17s on my laptop. Not much faster, but also not slower. See also #4719, #20137, #20372. Change-Id: I101d5363f8c55bf4825167a5f6954862739bf000 Reviewed-on: https://go-review.googlesource.com/75473 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
Go 1.10 has in fact made it unnecessary to exercise this kind of control. I can't quite tell from the original report why you thought -pkgdir was needed, but it is not needed anymore. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8.1 darwin/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
main.go:
What did you expect to see?
I expected
-pkgdir
to specify the "base" package directory, akin to$GOPATH/pkg
, so that race builds and builds specifying an install suffix are separately cached.What did you see instead?
-pkgdir
caused-race
and-installsuffix
to not affect the package cache directory.-pkgdir
was implemented this way in #10210. Unfortunately, behaviour makes it extremely cumbersome to implement cross compilation toolchains that use cgo since handling of-race
and-installsuffix
must be reimplemented outside of the go tool.If it is not feasible to change the behaviour of
-pkgdir
, perhaps a new flag-rootpkgdir
could be added that would place nice with installsuffixes.@rsc
The text was updated successfully, but these errors were encountered: