From 85cbdda5a6d8525973580776c835e725452db898 Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Thu, 14 Oct 2021 15:40:44 -0700 Subject: [PATCH] doc/go1.18: add release notes for build and VCS info Fixes #37475 For #39301 Change-Id: I765bc667004931ff8973b947f2e95624a4a0375d Reviewed-on: https://go-review.googlesource.com/c/go/+/356013 Reviewed-by: Bryan C. Mills Trust: Jay Conrod --- doc/go1.18.html | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/doc/go1.18.html b/doc/go1.18.html index f4d097d06bc..d95e55e1ad1 100644 --- a/doc/go1.18.html +++ b/doc/go1.18.html @@ -65,6 +65,30 @@ Do not send CLs removing the interior tags from such phrases. and installs packages, as before.

+

+ The go command now embeds version control information in + binaries including the currently checked-out revision and a flag indicating + whether edited or untracked files are present. Version control information + is embedded if the go command is invoked in a directory within a + Git or Mercurial repository, and the main package and its + containing main module are in the same repository. This information may be + omitted using the flag -buildvcs=false. +

+ +

+ Additionally, the go command embeds information about the build + including build and tool tags (set with -tags), compiler, + assembler, and linker flags (like -gcflags), whether cgo was + enabled, and if it was, the values of the cgo environment variables + (like CGO_CFLAGS). This information may be omitted using the + flag -buildinfo=false. Both VCS and build information may be + read together with module information using go + version -m file or + runtime/debug.ReadBuildInfo (for the currently running binary) + or the new debug/buildinfo + package. +

+

TODO: complete this section, or delete if not needed

@@ -114,6 +138,19 @@ Do not send CLs removing the interior tags from such phrases. TODO: complete this section

+
debug/buildinfo
+
+

+ This new package provides access to module versions, version control + information, and build flags embedded in executable files built by + the go command. The same information is also available via + runtime/debug.ReadBuildInfo + for the currently running binary and via go + version -m on the command line. +

+
+
+
image/draw