Skip to content
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: build -n gives the wrong command for packing go+asm output #13118

Closed
mikekap opened this issue Nov 1, 2015 · 1 comment
Closed

cmd/go: build -n gives the wrong command for packing go+asm output #13118

mikekap opened this issue Nov 1, 2015 · 1 comment
Milestone

Comments

@mikekap
Copy link

mikekap commented Nov 1, 2015

Go 1.5 darwin/amd64

Running go build -n github.com/pquerna/ffjson gives:

/usr/local/Cellar/go/1.5/libexec/pkg/tool/darwin_amd64/compile -o $WORK/github.com/pquerna/ffjson/fflib/v1.a -trimpath $WORK -p github.com/pquerna/ffjson/fflib/v1 -buildid fc0796fa41ef18caba426bf7158fc430e785f7d9 -D _/Users/mkaplinskiy/gocode/src/github.com/pquerna/ffjson/fflib/v1 -I $WORK -I /Users/mkaplinskiy/gocode/pkg/darwin_amd64 -pack -asmhdr $WORK/github.com/pquerna/ffjson/fflib/v1/_obj/go_asm.h ./buffer.go ./buffer_pool.go ./bytenum.go ./decimal.go ./extfloat.go ./fold.go ./ftoa.go ./iota.go ./jsonstring.go ./lexer.go ./reader.go ./reader_scan_amd64.go
/usr/local/Cellar/go/1.5/libexec/pkg/tool/darwin_amd64/asm -o $WORK/github.com/pquerna/ffjson/fflib/v1/_obj/reader_scan_amd64.o -trimpath $WORK -I $WORK/github.com/pquerna/ffjson/fflib/v1/_obj/ -I /usr/local/Cellar/go/1.5/libexec/pkg/include -D GOOS_darwin -D GOARCH_amd64 ./reader_scan_amd64.s
/usr/local/Cellar/go/1.5/libexec/pkg/tool/darwin_amd64/pack c $WORK/github.com/pquerna/ffjson/fflib/v1.a $WORK/github.com/pquerna/ffjson/fflib/v1/_obj/reader_scan_amd64.o

The pack c part of the command is wrong in this case - it should be pack r.

The cause appears to be @

if _, err := os.Stat(absAfile); err == nil {
. Since we're building in -n mode, the archive produced by the compiler doesn't exist, so the command printed is c instead of r.

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Nov 1, 2015
@gopherbot
Copy link

CL https://golang.org/cl/16761 mentions this issue.

@golang golang locked and limited conversation to collaborators Nov 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants