You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Produce a binary with go build and with go install:
Fetch the demo repo from @mark-rushakoff : git clone https://github.com/mark-rushakoff/debug-module-version-demo.git
go install
go build -o demo.osx *.go
Compare the attached build info:
Output from go build
$ go version -m demo.osx
demo.osx: go1.18beta2
path command-line-arguments
dep golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c h1:qgOY6WgZOaTkIIMiVjBQcw93ERBE4m30iBm00nkL0i8=
dep rsc.io/quote v1.5.2 h1:w5fcysjrx7yqtD/aO+QwRjYZOKnaM9Uh2b40tElTs3Y=
dep rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=
build -compiler=gc
build CGO_ENABLED=1
build CGO_CFLAGS=
build CGO_CPPFLAGS=
build CGO_CXXFLAGS=
build CGO_LDFLAGS=
build GOARCH=amd64
build GOOS=darwin
build GOAMD64=v1
Output from go install
$ go version -m /Users/james/go/bin/debug-module-version-demo
/Users/james/go/bin/debug-module-version-demo: go1.18beta2
path github.com/mark-rushakoff/debug-module-version-demo
mod github.com/mark-rushakoff/debug-module-version-demo (devel)
dep golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c h1:qgOY6WgZOaTkIIMiVjBQcw93ERBE4m30iBm00nkL0i8=
dep rsc.io/quote v1.5.2 h1:w5fcysjrx7yqtD/aO+QwRjYZOKnaM9Uh2b40tElTs3Y=
dep rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=
build -compiler=gc
build CGO_ENABLED=1
build CGO_CFLAGS=
build CGO_CPPFLAGS=
build CGO_CXXFLAGS=
build CGO_LDFLAGS=
build GOARCH=amd64
build GOOS=darwin
build GOAMD64=v1
build vcs=git
build vcs.revision=f3f34e10b35e88a6f6998d8c1938a5998c33cb64
build vcs.time=2018-12-13T20:11:42Z
build vcs.modified=true
What did you expect to see?
I expected to see vcs.revision/vcs.modified/etc populated in the runtime/debug.ReadBuildInfo() of the binaries produced by go build -o demo.osx *.go and go install.
What did you see instead?
I saw vcs.revision/vcs.modified/etc populated only in the runtime/debug.ReadBuildInfo() of the binary produced by go install, but not the binary produced by go build -o demo.osx *.go.
The text was updated successfully, but these errors were encountered:
With additional testing, non-population of vcs.revision/etc in runtime/debug.ReadBuildInfo() seems to only affect go build when the specific go files (in this case, *.go) are specified. When they are not specified, the tags are populated as expected.
E.g:
# note *.go not specified
$ go build -o demo.osx
$ go version -m demo.osx
demo.osx: go1.18beta2
path github.com/mark-rushakoff/debug-module-version-demo
mod github.com/mark-rushakoff/debug-module-version-demo (devel)
dep golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c h1:qgOY6WgZOaTkIIMiVjBQcw93ERBE4m30iBm00nkL0i8=
dep rsc.io/quote v1.5.2 h1:w5fcysjrx7yqtD/aO+QwRjYZOKnaM9Uh2b40tElTs3Y=
dep rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=
build -compiler=gc
build CGO_ENABLED=1
build CGO_CFLAGS=
build CGO_CPPFLAGS=
build CGO_CXXFLAGS=
build CGO_LDFLAGS=
build GOARCH=amd64
build GOOS=darwin
build GOAMD64=v1
build vcs=git
build vcs.revision=f3f34e10b35e88a6f6998d8c1938a5998c33cb64
build vcs.time=2018-12-13T20:11:42Z
build vcs.modified=true
So the bug I am reporting may be intended behavior when files are specified, whose description I have just missed in the documentation.
carbocation
changed the title
runtime/debug: vcs.modified populated for go install but not go build
runtime/debug: vcs.modified populated in ReadBuildInfo for go install but not go build
Mar 12, 2022
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Produce a binary with go build and with go install:
git clone https://github.com/mark-rushakoff/debug-module-version-demo.git
go install
go build -o demo.osx *.go
Compare the attached build info:
Output from go build
Output from go install
What did you expect to see?
I expected to see vcs.revision/vcs.modified/etc populated in the
runtime/debug.ReadBuildInfo()
of the binaries produced bygo build -o demo.osx *.go
andgo install
.What did you see instead?
I saw vcs.revision/vcs.modified/etc populated only in the
runtime/debug.ReadBuildInfo()
of the binary produced bygo install
, but not the binary produced bygo build -o demo.osx *.go
.The text was updated successfully, but these errors were encountered: