On 3 February 2016 at 19:02, Tianon Gravi <admwig...@gmail.com> wrote: >> + # On linux/amd64 run.bash installs some race enabled standard library >> + # packages. Delete them again to avoid accidentally including them in >> + # the package. >> + rm -rf "$(GOROOT)/pkg/linux_amd64_race/" > > This seems like the most correct solution to me, but I'm a little > confused about why we're hard-coding "linux_amd64" here -- shouldn't > this be "$(GOOS)_$(GOARCH)" so that it's whatever architecture we > build on? Or perhaps "$(GOROOT)"/pkg/*_race/ ?
It's because the race detector is only supported on amd64 (and I alternate between forgetting about and not caring about Debian/kFreeBSD, I guess). GOOS and GOARCH are not defined in debian/rules any more, but I guess we could shell out to go tool dist env like the invocation of run.bash does. I tried to use the wildcard at first but it's annoying because make is not shell. Attaching a new, slightly cleaner, patch. Cheers, mwh
diff --git a/debian/rules b/debian/rules index ae235c7..e7d994c 100755 --- a/debian/rules +++ b/debian/rules @@ -34,6 +34,13 @@ ifeq (true, $(RUN_TESTS)) export PATH="$(GOROOT)/bin:$$PATH"; \ eval "$$(go tool dist env)"; \ bash run.bash --no-rebuild; + # On linux/amd64 run.bash installs some race enabled standard library + # packages. Delete them again to avoid accidentally including them in + # the package. + set -ex; \ + export PATH="$(GOROOT)/bin:$$PATH"; \ + eval "$$(go tool dist env)"; \ + rm -rf "$(GOROOT)/pkg/$${GOOS}_$${GOARCH}_race/" else # skip the tests on platforms where they fail endif