]> Cypherpunks repositories - gostls13.git/commit
cmd/buildid: add new tool factoring out code needed by go command
authorRuss Cox <rsc@golang.org>
Fri, 6 Oct 2017 18:03:55 +0000 (14:03 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 11 Oct 2017 18:16:02 +0000 (18:16 +0000)
commit9ad2319bbca45b0750366e99b79db8889f0dfc5b
tree2e8b606a92b962dce1d397cf9eb5600b24965eb0
parent0bede7f34e20a77052b433a3c8ee402aa731183e
cmd/buildid: add new tool factoring out code needed by go command

This CL does a few things.

1. It moves the existing "read a build ID" code out of the go command
and into cmd/internal/buildid.

2. It adds new code there to "write a build ID".

3. It adds better tests.

4. It encapsulates cmd/internal/buildid into a new standalone program
"go tool buildid".

The go command is going to use the new "write a build ID" functionality
in a future CL. Adding the separate "go tool buildid" gives "go build -x"
a printable command to explain what it is doing in that new step.
(This is similar to the go command printing "go tool pack" commands
equivalent to the actions it is taking, even though it's not invoking pack
directly.) Keeping go build -x honest means that other build systems can
potentially keep up with the go command.

Change-Id: I01c0a66e30a80fa7254e3f2879283d3cd7aa03b4
Reviewed-on: https://go-review.googlesource.com/69053
Reviewed-by: David Crawshaw <crawshaw@golang.org>
16 files changed:
misc/nacl/testzip.proto
src/cmd/buildid/buildid.go [new file with mode: 0644]
src/cmd/buildid/doc.go [new file with mode: 0644]
src/cmd/dist/deps.go
src/cmd/dist/mkdeps.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/work/build.go
src/cmd/go/note_test.go
src/cmd/internal/buildid/buildid.go [moved from src/cmd/go/internal/buildid/buildid.go with 69% similarity]
src/cmd/internal/buildid/buildid_test.go [new file with mode: 0644]
src/cmd/internal/buildid/note.go [moved from src/cmd/go/internal/buildid/note.go with 88% similarity]
src/cmd/internal/buildid/rewrite.go [new file with mode: 0644]
src/cmd/internal/buildid/testdata/a.elf [new file with mode: 0755]
src/cmd/internal/buildid/testdata/a.macho [new file with mode: 0755]
src/cmd/internal/buildid/testdata/a.pe [new file with mode: 0755]
src/cmd/internal/buildid/testdata/p.a [new file with mode: 0644]