<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/runtime/debug/mod.go, branch dev.boringcrypto</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>runtime/debug: replace (*BuildInfo).Marshal methods with Parse and String</title>
<updated>2022-02-09T19:44:03+00:00</updated>
<author>
<name>Bryan C. Mills</name>
<email>bcmills@google.com</email>
</author>
<published>2022-02-08T17:23:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=9cec77ac11b012283e654b423cf85cf9976bedd9'/>
<id>9cec77ac11b012283e654b423cf85cf9976bedd9</id>
<content type='text'>
Since a String method cannot return an error, escape fields that may
contain unsanitized values, and unescape them during parsing.

Add a fuzz test to verify that calling the String method on any
BuildInfo returned by Parse produces a string that parses to the same
BuildInfo. (Note that this doesn't ensure that String always produces
a parseable input: we assume that a user constructing a BuildInfo
provides valid paths and versions, so we don't bother to escape those.
It also doesn't ensure that ParseBuildInfo accepts all inputs that
ought to be valid.)

Fixes #51026

Change-Id: Ida18010ce47622cfedb1494060f32bd7705df014
Reviewed-on: https://go-review.googlesource.com/c/go/+/384154
Trust: Bryan Mills &lt;bcmills@google.com&gt;
Run-TryBot: Bryan Mills &lt;bcmills@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Michael Matloob &lt;matloob@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since a String method cannot return an error, escape fields that may
contain unsanitized values, and unescape them during parsing.

Add a fuzz test to verify that calling the String method on any
BuildInfo returned by Parse produces a string that parses to the same
BuildInfo. (Note that this doesn't ensure that String always produces
a parseable input: we assume that a user constructing a BuildInfo
provides valid paths and versions, so we don't bother to escape those.
It also doesn't ensure that ParseBuildInfo accepts all inputs that
ought to be valid.)

Fixes #51026

Change-Id: Ida18010ce47622cfedb1494060f32bd7705df014
Reviewed-on: https://go-review.googlesource.com/c/go/+/384154
Trust: Bryan Mills &lt;bcmills@google.com&gt;
Run-TryBot: Bryan Mills &lt;bcmills@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Michael Matloob &lt;matloob@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/go: adjust BuildInfo.Settings</title>
<updated>2021-11-30T18:09:02+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2021-10-25T20:02:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=931d80ec17374e52dbc5f9f63120f8deb80b355d'/>
<id>931d80ec17374e52dbc5f9f63120f8deb80b355d</id>
<content type='text'>
Make Settings more closely align with command-line flags
and environment variables.

- Change command-line flags to begin with -

- Change syntax of build lines to use Key=Value instead of Key&lt;tab&gt;Value.

- Change CGO_ENABLED to 0/1, matching environment variable,
  instead of false/true.

- Add GOOS and GOARCH.
  These are technically redundant, in that they can be extracted
  from the binary in other ways most of the time, but not always:
  GOOS=ios and GOOS=darwin may produce binaries that are
  difficult to tell apart. In any case, it's a lot easier to have them
  directly in the settings list than derive them from other parts
  of the binary.

- Add GOEXPERIMENT.
  These could be inferred from the tags list, but the experiments
  are being removed from the tags list.

- Change the tags list to match the -tags command-line argument.

- Add msan and race, echoing the -msan and -race arguments
  (always 'true' when present, omitted when false).

- Add GO$GOARCH when set.

Change-Id: Icb59ef4faa5c22407eadd94147b7e53cf4344ce6
Reviewed-on: https://go-review.googlesource.com/c/go/+/358539
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make Settings more closely align with command-line flags
and environment variables.

- Change command-line flags to begin with -

- Change syntax of build lines to use Key=Value instead of Key&lt;tab&gt;Value.

- Change CGO_ENABLED to 0/1, matching environment variable,
  instead of false/true.

- Add GOOS and GOARCH.
  These are technically redundant, in that they can be extracted
  from the binary in other ways most of the time, but not always:
  GOOS=ios and GOOS=darwin may produce binaries that are
  difficult to tell apart. In any case, it's a lot easier to have them
  directly in the settings list than derive them from other parts
  of the binary.

- Add GOEXPERIMENT.
  These could be inferred from the tags list, but the experiments
  are being removed from the tags list.

- Change the tags list to match the -tags command-line argument.

- Add msan and race, echoing the -msan and -race arguments
  (always 'true' when present, omitted when false).

- Add GO$GOARCH when set.

Change-Id: Icb59ef4faa5c22407eadd94147b7e53cf4344ce6
Reviewed-on: https://go-review.googlesource.com/c/go/+/358539
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/go: stamp VCS revision and uncommitted status into binaries</title>
<updated>2021-10-14T18:44:37+00:00</updated>
<author>
<name>Jay Conrod</name>
<email>jayconrod@google.com</email>
</author>
<published>2021-10-01T18:21:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=a37bebc042672d20837ea348d45e39740568cb77'/>
<id>a37bebc042672d20837ea348d45e39740568cb77</id>
<content type='text'>
When the go command builds a binary, it will now stamp the current
revision from the local Git or Mercurial repository, and it will also
stamp whether there are uncommitted edited or untracked files. Only
Git and Mercurial are supported for now.

If no repository is found containing the current working directory
(where the go command was started), or if either the main package
directory or the containing module's root directory is outside the
repository, no VCS information will be stamped. If the VCS tool is
missing or returns an error, that error is reported on the main
package (hinting that -buildvcs may be disabled).

This change introduces the -buildvcs flag, which is enabled by
default. When disabled, VCS information won't be stamped when it would
be otherwise.

Stamped information may be read using 'go version -m file' or
debug.ReadBuildInfo.

For #37475

Change-Id: I4e7d3159e1c270d85869ad99f10502e546e7582d
Reviewed-on: https://go-review.googlesource.com/c/go/+/353930
Trust: Jay Conrod &lt;jayconrod@google.com&gt;
Run-TryBot: Jay Conrod &lt;jayconrod@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the go command builds a binary, it will now stamp the current
revision from the local Git or Mercurial repository, and it will also
stamp whether there are uncommitted edited or untracked files. Only
Git and Mercurial are supported for now.

If no repository is found containing the current working directory
(where the go command was started), or if either the main package
directory or the containing module's root directory is outside the
repository, no VCS information will be stamped. If the VCS tool is
missing or returns an error, that error is reported on the main
package (hinting that -buildvcs may be disabled).

This change introduces the -buildvcs flag, which is enabled by
default. When disabled, VCS information won't be stamped when it would
be otherwise.

Stamped information may be read using 'go version -m file' or
debug.ReadBuildInfo.

For #37475

Change-Id: I4e7d3159e1c270d85869ad99f10502e546e7582d
Reviewed-on: https://go-review.googlesource.com/c/go/+/353930
Trust: Jay Conrod &lt;jayconrod@google.com&gt;
Run-TryBot: Jay Conrod &lt;jayconrod@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>runtime/debug: add GoVersion to BuildInfo</title>
<updated>2021-10-14T18:44:21+00:00</updated>
<author>
<name>Jay Conrod</name>
<email>jayconrod@google.com</email>
</author>
<published>2021-09-30T17:46:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=85a068fdf21bd2e4475a87ee049af4fbe797bcbe'/>
<id>85a068fdf21bd2e4475a87ee049af4fbe797bcbe</id>
<content type='text'>
BuildInfo now includes the version of Go used to build a binary, as
reported by runtime.Version() or 'go version'.

For #37475

Change-Id: Id07dda357dc70599d64a9202dab894c7288de1de
Reviewed-on: https://go-review.googlesource.com/c/go/+/353888
Trust: Jay Conrod &lt;jayconrod@google.com&gt;
Run-TryBot: Jay Conrod &lt;jayconrod@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BuildInfo now includes the version of Go used to build a binary, as
reported by runtime.Version() or 'go version'.

For #37475

Change-Id: Id07dda357dc70599d64a9202dab894c7288de1de
Reviewed-on: https://go-review.googlesource.com/c/go/+/353888
Trust: Jay Conrod &lt;jayconrod@google.com&gt;
Run-TryBot: Jay Conrod &lt;jayconrod@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>debug/buildinfo: new package with Read and ReadFile</title>
<updated>2021-10-14T18:44:08+00:00</updated>
<author>
<name>Jay Conrod</name>
<email>jayconrod@google.com</email>
</author>
<published>2021-09-30T17:25:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=434cdd0337b9e6c7e0c369c9293cc14fd38dc80d'/>
<id>434cdd0337b9e6c7e0c369c9293cc14fd38dc80d</id>
<content type='text'>
These functions provide access to module information stamped into Go
binaries. In the future, they'll provide access to other information
(like VCS info).

These functions are added in a new package instead of runtime/debug
since they use binary parsing packages like debug/elf, which would
make runtime/debug an unacceptably heavy dependency. The types in
runtime/debug are still used; debug/buildinfo uses them via type
aliases.

This information is already available for the running binary through
debug.ReadBuildInfo and for other binaries with 'go version -m', but
until now, there hasn't been a way to get it for other binaries
without installing cmd/go.

This change copies most of the code in cmd/go/internal/version. A
later CL will migrate 'go version -m' to use this package.

For #37475
Fixes #39301

Change-Id: I0fbe0896e04f12ef81c6d79fb61b20daede86159
Reviewed-on: https://go-review.googlesource.com/c/go/+/353887
Trust: Jay Conrod &lt;jayconrod@google.com&gt;
Run-TryBot: Jay Conrod &lt;jayconrod@google.com&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These functions provide access to module information stamped into Go
binaries. In the future, they'll provide access to other information
(like VCS info).

These functions are added in a new package instead of runtime/debug
since they use binary parsing packages like debug/elf, which would
make runtime/debug an unacceptably heavy dependency. The types in
runtime/debug are still used; debug/buildinfo uses them via type
aliases.

This information is already available for the running binary through
debug.ReadBuildInfo and for other binaries with 'go version -m', but
until now, there hasn't been a way to get it for other binaries
without installing cmd/go.

This change copies most of the code in cmd/go/internal/version. A
later CL will migrate 'go version -m' to use this package.

For #37475
Fixes #39301

Change-Id: I0fbe0896e04f12ef81c6d79fb61b20daede86159
Reviewed-on: https://go-review.googlesource.com/c/go/+/353887
Trust: Jay Conrod &lt;jayconrod@google.com&gt;
Run-TryBot: Jay Conrod &lt;jayconrod@google.com&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/go: move module build info formatting into runtime/debug</title>
<updated>2021-10-14T18:43:59+00:00</updated>
<author>
<name>Jay Conrod</name>
<email>jayconrod@google.com</email>
</author>
<published>2021-09-30T21:37:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=765c9116be44641854f580c19e3589d7b86a3d28'/>
<id>765c9116be44641854f580c19e3589d7b86a3d28</id>
<content type='text'>
Previously, modload.PackageBuildInfo returned a string containing
information about modules used to build an executable. This string is
embedded in the binary and can be read with debug.ReadBuildInfo or
'go version -m'.

With this change, debug.BuildInfo now has a MarshalText method that
returns a string in the same format as modload.PackageBuildInfo.

Package.load now calls Package.setBuildInfo, which constructs a
debug.BuildInfo, formats it with MarshalText, then sets
Package.Internal.BuildInfo. This is equivalent to what
modload.PackageBuildInfo did.

modload.PackageBuildInfo is deleted, since it's no longer used.

For #37475

Change-Id: I5875a98cb64737637fec2a450ab2ffa7f1805707
Reviewed-on: https://go-review.googlesource.com/c/go/+/353886
Trust: Jay Conrod &lt;jayconrod@google.com&gt;
Run-TryBot: Jay Conrod &lt;jayconrod@google.com&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, modload.PackageBuildInfo returned a string containing
information about modules used to build an executable. This string is
embedded in the binary and can be read with debug.ReadBuildInfo or
'go version -m'.

With this change, debug.BuildInfo now has a MarshalText method that
returns a string in the same format as modload.PackageBuildInfo.

Package.load now calls Package.setBuildInfo, which constructs a
debug.BuildInfo, formats it with MarshalText, then sets
Package.Internal.BuildInfo. This is equivalent to what
modload.PackageBuildInfo did.

modload.PackageBuildInfo is deleted, since it's no longer used.

For #37475

Change-Id: I5875a98cb64737637fec2a450ab2ffa7f1805707
Reviewed-on: https://go-review.googlesource.com/c/go/+/353886
Trust: Jay Conrod &lt;jayconrod@google.com&gt;
Run-TryBot: Jay Conrod &lt;jayconrod@google.com&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>all: use bytes.Cut, strings.Cut</title>
<updated>2021-10-06T15:53:04+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2021-09-22T14:46:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=4d8db00641cc9ff4f44de7df9b8c4f4a4f9416ee'/>
<id>4d8db00641cc9ff4f44de7df9b8c4f4a4f9416ee</id>
<content type='text'>
Many uses of Index/IndexByte/IndexRune/Split/SplitN
can be written more clearly using the new Cut functions.
Do that. Also rewrite to other functions if that's clearer.

For #46336.

Change-Id: I68d024716ace41a57a8bf74455c62279bde0f448
Reviewed-on: https://go-review.googlesource.com/c/go/+/351711
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Many uses of Index/IndexByte/IndexRune/Split/SplitN
can be written more clearly using the new Cut functions.
Do that. Also rewrite to other functions if that's clearer.

For #46336.

Change-Id: I68d024716ace41a57a8bf74455c62279bde0f448
Reviewed-on: https://go-review.googlesource.com/c/go/+/351711
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Revert "cmd/go/internal/modload: record the replacement for the module containing package main in BuildInfo""</title>
<updated>2020-02-25T15:43:19+00:00</updated>
<author>
<name>Bryan C. Mills</name>
<email>bcmills@google.com</email>
</author>
<published>2020-02-25T14:58:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=987e4e892325ea91a15a34f7a858ab007fea39c4'/>
<id>987e4e892325ea91a15a34f7a858ab007fea39c4</id>
<content type='text'>
This reverts CL 220722.

Reason for revert: rolling forward with fix.

Fixes #37392

Change-Id: Iba8b0c645267777fbb7019976292d691a10b906a
Reviewed-on: https://go-review.googlesource.com/c/go/+/220898
Run-TryBot: Bryan C. Mills &lt;bcmills@google.com&gt;
Reviewed-by: Jay Conrod &lt;jayconrod@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts CL 220722.

Reason for revert: rolling forward with fix.

Fixes #37392

Change-Id: Iba8b0c645267777fbb7019976292d691a10b906a
Reviewed-on: https://go-review.googlesource.com/c/go/+/220898
Run-TryBot: Bryan C. Mills &lt;bcmills@google.com&gt;
Reviewed-by: Jay Conrod &lt;jayconrod@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "cmd/go/internal/modload: record the replacement for the module containing package main in BuildInfo"</title>
<updated>2020-02-24T23:29:37+00:00</updated>
<author>
<name>Andrew Bonventre</name>
<email>andybons@google.com</email>
</author>
<published>2020-02-24T22:47:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=917c7a6fc9c6843e40da7f8e1a1fcf8605d1383e'/>
<id>917c7a6fc9c6843e40da7f8e1a1fcf8605d1383e</id>
<content type='text'>
This reverts CL 220645 (commit e092fc352ad393a4d2f1f7fa641df2d23572ccff).

Reason for revert: Seems to have broken windows/amd64 longtest

Change-Id: Iffa8c882524250e5845514bc827fcd8927645a44
Reviewed-on: https://go-review.googlesource.com/c/go/+/220722
Run-TryBot: Andrew Bonventre &lt;andybons@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts CL 220645 (commit e092fc352ad393a4d2f1f7fa641df2d23572ccff).

Reason for revert: Seems to have broken windows/amd64 longtest

Change-Id: Iffa8c882524250e5845514bc827fcd8927645a44
Reviewed-on: https://go-review.googlesource.com/c/go/+/220722
Run-TryBot: Andrew Bonventre &lt;andybons@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/go/internal/modload: record the replacement for the module containing package main in BuildInfo</title>
<updated>2020-02-24T20:11:21+00:00</updated>
<author>
<name>Bryan C. Mills</name>
<email>bcmills@google.com</email>
</author>
<published>2020-02-24T16:27:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=e092fc352ad393a4d2f1f7fa641df2d23572ccff'/>
<id>e092fc352ad393a4d2f1f7fa641df2d23572ccff</id>
<content type='text'>
Fixes #37392

Change-Id: I2cb051e6f556b0af95e059611dda3f62e7c1f21a
Reviewed-on: https://go-review.googlesource.com/c/go/+/220645
Run-TryBot: Bryan C. Mills &lt;bcmills@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Jay Conrod &lt;jayconrod@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #37392

Change-Id: I2cb051e6f556b0af95e059611dda3f62e7c1f21a
Reviewed-on: https://go-review.googlesource.com/c/go/+/220645
Run-TryBot: Bryan C. Mills &lt;bcmills@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Jay Conrod &lt;jayconrod@google.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
