-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: add bzr based version stamping for binaries
This CL adds support for tagging binaries in a bzr vcs environment. For: #50603 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest Change-Id: I81eb72d9e0e15dbec8778dd06613ca212820a726 Reviewed-on: https://go-review.googlesource.com/c/go/+/627295 Auto-Submit: Sam Thanawalla <[email protected]> Reviewed-by: Michael Matloob <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information
1 parent
400433a
commit 5030146
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ exec bzr whoami 'J.R. Gopher <[email protected]>' | |
go install | ||
go version -m $GOBIN/a$GOEXE | ||
! stdout bzrrevision | ||
stdout '^\tmod\texample.com/a\t\(devel\)' | ||
rm $GOBIN/a$GOEXE | ||
|
||
# If there is a repository, but it can't be used for some reason, | ||
|
@@ -52,6 +53,23 @@ stdout '^\tbuild\tvcs=bzr$' | |
stdout '^\tbuild\tvcs.revision=' | ||
stdout '^\tbuild\tvcs.time=' | ||
stdout '^\tbuild\tvcs.modified=false$' | ||
stdout '^\tmod\texample.com/a\tv0.0.0-\d+-\d+\t+' | ||
rm $GOBIN/a$GOEXE | ||
|
||
# Tag is reflected in the version. | ||
cd .. | ||
cp README README2 | ||
exec bzr add a README2 | ||
exec bzr commit -m 'second commit' | ||
exec bzr tag v1.2.3 | ||
cd a | ||
go install | ||
go version -m $GOBIN/a$GOEXE | ||
stdout '^\tbuild\tvcs=bzr$' | ||
stdout '^\tbuild\tvcs.revision=' | ||
stdout '^\tbuild\tvcs.time=' | ||
stdout '^\tbuild\tvcs.modified=false$' | ||
stdout '^\tmod\texample.com/a\tv1.2.3\t+' | ||
rm $GOBIN/a$GOEXE | ||
|
||
# Building an earlier commit should still build clean. | ||
|