Skip to content

go1.18+ default -buildvcs=auto soft dependency on git or export GOFLAGS="-buildvcs=false" #128

@jfkw

Description

@jfkw

New default behavior (link) -buildvcs=auto in go1.18 detects VCS data in sources e.g. .git/. If active, go tool invocations including go build and go test will call vcs tools (typically git) to encode VCS info into the built binary or tool output.

Mitigation:

  • In each RPM section where go tool will be called (%build, %check), add export GOFLAGS="-buildvcs=false".

Follow up:
In go1.18.1, go test will revert to -buildvcs=off behaviour per:

Alternatives:

  • Add BuildRequires dependency on git
  • go1.18+ 'go version -m ./binaryname' also provides build info

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions