cmd/go: Go build (Go 1.9) does not use pack but fails if pkg/tool/$GOOS_$GOARCH/pack does not exist and you build with -x -a #22819
Labels
FrozenDueToAge
GoCommand
cmd/go
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go release branch 1.9
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
What did you do?
This was discovered when using u-root (u-root.tk). In u-root we build a minimal standalone environment which lets us build Go programs. There are only 5 binaries:
/init, go, compile, asm, link
We found that go build was failing with the error
go tool: no such tool "pack"
Although in this case pack is not used; e.g.
/go/pkg/tool/linux_amd64/pack r $WORK/math.a $WORK/math/_obj/asin_amd64.o (lots of .o's elided) # internal
To see for yourself:
Create this file as hello.go:
package main
import "fmt"
func main() {
fmt.Println("hi")
}
go build -x -a hello.go
it works.
Then
cp /path/to/go/pkg/tool/$GOOS_$GOARCH/pack /some/where/safe
go build -x -a hello.go
still works
Then
rm /path/to/go/pkg/tool/$GOOS_$GOARCH/pack
Note: it only fails with -x -a, not with -x or -a.
It may be just something about rebuilding it all, and showing it all?
The special circumstances of u-root may explain why nobody has seen this to date.
The text was updated successfully, but these errors were encountered: