Skip to content

cmd/go build does not append +dirty #71684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andig opened this issue Feb 12, 2025 · 2 comments
Closed

cmd/go build does not append +dirty #71684

andig opened this issue Feb 12, 2025 · 2 comments
Labels
BugReport Issues describing a possible bug in the Go implementation.

Comments

@andig
Copy link
Contributor

andig commented Feb 12, 2025

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

$ go version
go version go1.24.0 darwin/arm64

Does this issue reproduce with the latest release?

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

go env Output
$ go env
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/andig/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/andig/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/sv/rs_453y57xj86xsbz3kw1mbc0000gn/T/go-build735142348=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/andig/htdocs/evcc/go.mod'
GOMODCACHE='/Users/andig/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/andig/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/andig/go/pkg/mod/golang.org/[email protected]'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/Users/andig/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/andig/go/pkg/mod/golang.org/[email protected]/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.0'
GOWORK=''
PKG_CONFIG='pkg-config'
GOROOT/bin/go version: go version go1.24.0 darwin/arm64
GOROOT/bin/go tool compile -V: compile version go1.24.0
uname -v: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:06 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T8103
ProductName:		macOS
ProductVersion:		15.3
BuildVersion:		24D60
lldb --version: lldb-1600.0.39.109
Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)

What did you do?

I have build a main module with dirty tree. According to 1.24 release notes:

The go build command now sets the main module’s version in the compiled binary based on the version control system tag and/or commit. A +dirty suffix will be appended if there are uncommitted changes. Use the -buildvcs=false flag to omit version control information from the binary.

What did you expect to see?

+dirty appended (to commit?).

What did you see instead?

build	vcs=git
build	vcs.revision=29b1c882018c4a177247122f77d1073547707003
build	vcs.time=2025-02-12T12:07:29Z
build	vcs.modified=true

I prefer the vcs.modified over interfering with the commit, but then the release notes are inaccurate.

I also couldn't get a vcs.tag output even when HEAD was tagged.

@seankhliao
Copy link
Member

You're looking at the vcs info, not the module version.

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Feb 12, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation.
Projects
None yet
Development

No branches or pull requests

3 participants