Skip to content

runtime/debug: BuildInfo doesn't contain VCS info depending on the build command #68084

@EzxD

Description

@EzxD

Go version

go version go1.22.4 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/paulseebach/Library/Caches/go-build'
GOENV='/Users/paulseebach/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/paulseebach/go/pkg/mod'
GONOPROXY='github.com/askrella'
GONOSUMDB='github.com/askrella'
GOOS='darwin'
GOPATH='/Users/paulseebach/go'
GOPRIVATE='github.com/askrella'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/paulseebach/.go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/paulseebach/.go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.4'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/paulseebach/code/askrella/simpleo-backend/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/l5/dt51qvv11wgdwbv18l68867r0000gn/T/go-build2194274985=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

  • added versioning with go's buildinfos
  • built the binary locally with go build ./cmd/local
  • shipped it to dev (with CI/CD)

What did you see happen?

  • VCS info in the BuildInfo locally worked fine
  • VCS info wasn't present on dev
  • comparing the build process and saw CI runs the built like this: go build ./cmd/local/main.go
  • tried it locally with go build ./cmd/local/main.go -> VCS Info wasn't present

What did you expect to see?

  • when building the binary with go build ./cmd/local/main.go the VCS info should be present too

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions