8000 cmd/go: vcs info not stamped when built listing .go files directly · Issue #51279 · golang/go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
cmd/go: vcs info not stamped when built listing .go files directly #51279
Open
@mlcdf

Description

@mlcdf

What version of Go are you using (go version)?

$ go version
go version go1.18rc1 windows/amd64

Does this issue reproduce with the latest release?

N/A

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\max\AppData\Local\go-build
set GOENV=C:\Users\max\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\max\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\max\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Users\max\sdk\go1.18rc1
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\max\sdk\go1.18rc1\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.18rc1
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\max\Code\go-vcs-issue-repro\go.mod
set GOWORK=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\max\AppData\Local\Temp\go-build2053103368=/tmp/go-build -gno-record-gcc-switches

What did you do?

git clone https://github.com/mlcdf/go-vcs-issue-repro.git
cd go-vcs-issue-repro
go1.18rc1 build main.go
.\main.exe

What did you expect to see?

VCS info appearing in the console :
[{-compiler gc} {CGO_ENABLED 1} {CGO_CFLAGS } {CGO_CPPFLAGS } {CGO_CXXFLAGS } {CGO_LDFLAGS } {GOARCH amd64} {GOOS windows} {GOAMD64 v1} {vcs git} {vcs.revision 2d1c081410d0f5f23fd1dd7e08794041955a2119} {vcs.time 2022-02-20T11:01:47Z} {vcs.modified false}]

What did you see instead?

[{-compiler gc} {CGO_ENABLED 1} {CGO_CFLAGS } {CGO_CPPFLAGS } {CGO_CXXFLAGS } {CGO_LDFLAGS } {GOARCH amd64} {GOOS windows} {GOAMD64 v1}]

If I run go1.18rc1 build instead of go1.18rc1 build main.go and run the .\go-vcs-issue-repro.exe binary, it works fine. Is it expected behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wantedmodules

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0