]> Cypherpunks repositories - gostls13.git/log
gostls13.git
5 years agocmd/trace: update to use WebComponents V0 polyfill
Hana (Hyang-Ah) Kim [Wed, 19 Feb 2020 03:41:20 +0000 (22:41 -0500)]
cmd/trace: update to use WebComponents V0 polyfill

Old trace viewer stopped working with Chrome M80+ because the
old trace viewer heavily depended on WebComponents V0 which are deprecated.
Trace viewer recently migrated to use WebComponents V0 polyfill
(crbug.com/1036492). This CL brings in the newly updated trace_viewer_full.html
(sync'd @ 9508452e)
and updates the javascript snippet included in the /trace endpoint
to use the polyfill.

This brings in webcomponents.min.js copied from
https://chromium.googlesource.com/catapult/+/9508452e18f130c98499cb4c4f1e1efaedee8962/third_party/polymer/components/webcomponentsjs/webcomponents.min.js

That is necessary because the /trace endpoint needs to import
the vulcanized trace_viewer_full.html.

It's possible that some features are not working correctly with
this polyfill. In that case, report the issue to crbug.com/1036492.
There will be a warning message in the UI (yellow banner above the timeline)
which can be hidden by clicking the 'hide' button.

This allows to render the trace in browsers other than chrome in theory,
but I observed some buttons and functions still don't work outside
chrome.

Fixes #34374.

Change-Id: Ib575f756f5e6b22ad904ede6e4d224a995ebe259
Reviewed-on: https://go-review.googlesource.com/c/go/+/219997
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
5 years agocmd/compile: normalize whitespace around square brackets
Josh Bleecher Snyder [Tue, 7 Jan 2020 22:30:17 +0000 (14:30 -0800)]
cmd/compile: normalize whitespace around square brackets

I noticed some instances of "[ " and " ]" in the rewrite rules.
Normalizing them helps catch possible future duplicate rules.

Change-Id: I892fd7e9b4019ed304f0a61fa2bb7f7e47ef8f38
Reviewed-on: https://go-review.googlesource.com/c/go/+/213682
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/compile: merge more shifts into stores
Josh Bleecher Snyder [Tue, 7 Jan 2020 21:41:02 +0000 (13:41 -0800)]
cmd/compile: merge more shifts into stores

Updates #36223

(Might fix #36223. I'm not sure whether there are more outstanding.)

This helps a bit, but not as much as I'd expected/hoped.

file                                      before  after   Δ       %
runtime.s                                 477286  477256  -30     -0.006%
bytes.s                                   31089   31085   -4      -0.013%
time.s                                    83561   83547   -14     -0.017%
strings.s                                 43284   43280   -4      -0.009%
compress/flate.s                          51374   51295   -79     -0.154%
math/big.s                                184283  184256  -27     -0.015%
crypto/elliptic.s                         51649   51577   -72     -0.139%
crypto/sha512.s                           8661    8644    -17     -0.196%
crypto/sha1.s                             6975    6959    -16     -0.229%
crypto/sha256.s                           6412    6393    -19     -0.296%
vendor/golang.org/x/text/unicode/bidi.s   27158   27146   -12     -0.044%
vendor/golang.org/x/text/unicode/norm.s   66802   66788   -14     -0.021%
net/http.s                                560936  560929  -7      -0.001%
text/template.s                           96475   96467   -8      -0.008%
go/parser.s                               80284   80280   -4      -0.005%
text/tabwriter.s                          9618    9611    -7      -0.073%
go/printer.s                              78502   78499   -3      -0.004%
go/types.s                                321815  321807  -8      -0.002%
internal/xcoff.s                          23175   23171   -4      -0.017%
image/jpeg.s                              36609   36587   -22     -0.060%
cmd/vendor/golang.org/x/arch/x86/x86asm.s 81274   81001   -273    -0.336%
cmd/internal/obj.s                        115184  115126  -58     -0.050%
cmd/internal/obj/arm64.s                  151502  151487  -15     -0.010%
cmd/internal/obj/s390x.s                  128054  128046  -8      -0.006%
cmd/internal/obj/wasm.s                   44295   44291   -4      -0.009%
cmd/compile/internal/ssa.s                4201992 4209504 +7512   +0.179%
cmd/compile/internal/gc.s                 1555029 1555011 -18     -0.001%
total                                     9792875 9799640 +6765   +0.069%

Change-Id: If4a857c0953a766578e68aa299b112a20d9b2b86
Reviewed-on: https://go-review.googlesource.com/c/go/+/213704
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: use loops to handle commutative ops in rules
Josh Bleecher Snyder [Tue, 7 Jan 2020 06:24:02 +0000 (22:24 -0800)]
cmd/compile: use loops to handle commutative ops in rules

Prior to this change, we generated additional rules at rulegen time
for all possible combinations of args to commutative ops.
This is simple and works well, but leads to lots of generated rules.
This in turn has increased the size of the compiler,
made it hard to compile package ssa on small machines,
and provided a disincentive to mark some ops as commutative.

This change reworks how we handle commutative ops.
Instead of generating a rule per argument permutation,
we generate a series of nested loops, one for each commutative op.
Each loop tries both possible argument orderings.

I also considered attempting to canonicalize the inputs to the
rewrite rules. However, because either or both arguments might be
nothing more than an identifier, and because there can be arbitrary
conditions to evaluate during matching, I did not see how to proceed.

The duplicate rule detection now sorts arguments to commutative ops,
so that it can detect commutative-only duplicates.

There may be further optimizations to the new generated code.
In particular, we may not be removing as many bounds checks as before;
I have not investigated deeply. If more work here is needed,
we could do it with more hints or with improvements to the prove pass.

This change has almost no impact on the generated code.
It does not pass toolstash-check, however. In a handful of functions,
for reasons I do not understand, there are minor position changes.

For the entire series ending at this change,
there is negligible compiler performance impact.

The compiler binary shrinks by about 15%,
and package ssa shrinks by about 25%.
Package ssa also compiles ~25% faster with ~25% less memory.

Change-Id: Ia2ee9ceae7be08a17342319d4e31b0bb238a2ee4
Reviewed-on: https://go-review.googlesource.com/c/go/+/213703
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agogo/internal/gcimporter: rename file to better reflect new meaning
Robert Griesemer [Thu, 18 Oct 2018 00:20:26 +0000 (17:20 -0700)]
go/internal/gcimporter: rename file to better reflect new meaning

Also: Removed unused deref function.

Follow-up on https://golang.org/cl/143023.

Updates #27999.

Change-Id: I088265f0e3ce52029679407f0b84b734191d4d3c
Reviewed-on: https://go-review.googlesource.com/c/go/+/143024
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agodoc/go1.15: create go1.15.html
Bryan C. Mills [Thu, 20 Feb 2020 14:31:04 +0000 (09:31 -0500)]
doc/go1.15: create go1.15.html

Copied from go1.14.html, with changes redacted back to TODOs following
the model of CL 195058.

'relnote -html' does not report any changes at this time.

Updates #33738

Change-Id: I580232805ab7db35935f3e1ba03b720be4796a7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/220278
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/compile: generate commutative rules when a condition is present
Josh Bleecher Snyder [Tue, 7 Jan 2020 07:45:57 +0000 (23:45 -0800)]
cmd/compile: generate commutative rules when a condition is present

The commutative rule generator has an optimization
where given (Add x y) with no other uses of x and y in the matching rule,
it doesn't generate the commutative match (Add y x).

However, if there is also a condition referring to x or y,
such as (Add x y) && isFoo(x), then we should generate the commutative rule.
This change parses the condition, extracts all idents, and takes them
into consideration.

This doesn't yield any new optimizations now.
However, it is the right thing to do;
otherwise we'll have to track it down and fix it again later.

It is also expensive now, in terms of additional generated code.
However, it will be much, much less expensive soon,
once our generated code for commutative ops gets smaller.

Change-Id: I52c2016c884bbc7789bf8dfe9b9c56061bc028ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/213702
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: mark amd64 HMUL ops as not commutative
Josh Bleecher Snyder [Tue, 7 Jan 2020 17:27:18 +0000 (09:27 -0800)]
cmd/compile: mark amd64 HMUL ops as not commutative

HMUL is commutative. However, it has asymmetric register requirements.
There are existing rewrite rules to place arguments in preferable slots.

Due to a bug, the existing rulegen commutativity engine doesn't generate
the commuted form of the HMUL rules.
The commuted form of those rewrite rules cause infinite loops.
In order to fix the rulegen commutativity bug,
we need to choose between eliminating
those rewrite rules and marking HMUL ops as not commutative.

This change chooses the latter, since doing so yields better
optimization results on std+cmd.

Removing the rewrite rules yields only text size regressions:

file                                before  after   Δ       %
runtime.s                           477257  477269  +12     +0.003%
time.s                              83552   83612   +60     +0.072%
encoding/asn1.s                     57378   57382   +4      +0.007%
cmd/go/internal/modfetch/codehost.s 89822   89829   +7      +0.008%
cmd/internal/test2json.s            9459    9466    +7      +0.074%
cmd/go/internal/test.s              57665   57678   +13     +0.023%

Marking HMUL as not commutative actually yields (mostly) improvements:

file                               before   after    Δ       %
runtime.s                          477257   477247   -10     -0.002%
math.s                             35985    35992    +7      +0.019%
strconv.s                          53486    53462    -24     -0.045%
syscall.s                          82483    82446    -37     -0.045%
time.s                             83552    83561    +9      +0.011%
os.s                               52691    52684    -7      -0.013%
archive/zip.s                      42285    42272    -13     -0.031%
encoding/asn1.s                    57378    57329    -49     -0.085%
encoding/base64.s                  12156    12094    -62     -0.510%
net.s                              296286   296276   -10     -0.003%
encoding/base32.s                  9720     9658     -62     -0.638%
net/http.s                         560931   560907   -24     -0.004%
net/smtp.s                         14421    14411    -10     -0.069%
cmd/vendor/golang.org/x/sys/unix.s 74307    74266    -41     -0.055%

The regressions are minor, and are in functions math.cbrt,
time.Time.String, and time.Date.

Change-Id: I9f6d9ee71654e5b70381cac77b0ac26011f4ea12
Reviewed-on: https://go-review.googlesource.com/c/go/+/213701
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: add a flag to print the source line for generated rules
Josh Bleecher Snyder [Mon, 6 Jan 2020 21:43:51 +0000 (13:43 -0800)]
cmd/compile: add a flag to print the source line for generated rules

When working on rulegen, I often find myself
searching the rules files to find the source of
generated code. Add a flag to make that easier.

The flag needs to be off by default,
so that adding a single rule doesn't cause a massive diff.

Change-Id: I5a6f09129dc6fceef7c9cd1ad7eee24f3880ba91
Reviewed-on: https://go-review.googlesource.com/c/go/+/213700
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: delete duplicate rules
Josh Bleecher Snyder [Mon, 6 Jan 2020 21:42:35 +0000 (13:42 -0800)]
cmd/compile: delete duplicate rules

Add logic during rulegen to detect exact duplicates
(after applying commutativity),
and clean up existing duplicates.

Change-Id: I7179f40fc48e236c74b74f429ec9f0f100026530
Reviewed-on: https://go-review.googlesource.com/c/go/+/213699
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: don't generate commutative rules for (Op x x)
Josh Bleecher Snyder [Mon, 6 Jan 2020 21:15:49 +0000 (13:15 -0800)]
cmd/compile: don't generate commutative rules for (Op x x)

If the two commutative arguments are perfectly identical,
then swapping them will never have an effect.

Passes toolstash-check for the relevant architectures,
that is, linux-386, linux-386-387, linux-amd64, linux-s390x.

Change-Id: I19f91644867d8d174bd01f872abe4809013872ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/213698
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: factor out opIsCommutative from commute1
Josh Bleecher Snyder [Mon, 6 Jan 2020 21:14:03 +0000 (13:14 -0800)]
cmd/compile: factor out opIsCommutative from commute1

Change-Id: I989a66c98dcca8168e35dd9834fc1365e0a1d881
Reviewed-on: https://go-review.googlesource.com/c/go/+/213697
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agoRevert "cmd/go: convert TestShadowingLogic to the script framework"
Michael Matloob [Thu, 20 Feb 2020 00:30:48 +0000 (00:30 +0000)]
Revert "cmd/go: convert TestShadowingLogic to the script framework"

This reverts commit 8fa2b6dcde6008c107c097e44eb0ee94a2a8af3d.

Reason for revert: broke the build

Change-Id: Iae703b1b3dad6b363f57541641357eabca45e9e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/220217
Reviewed-by: Robert Griesemer <gri@golang.org>
5 years agocmd/go: convert TestShadowingLogic to the script framework
Michael Matloob [Mon, 13 Jan 2020 18:14:49 +0000 (13:14 -0500)]
cmd/go: convert TestShadowingLogic to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I6db652a4a515daf6e87645d34191dc9a441f5720
Reviewed-on: https://go-review.googlesource.com/c/go/+/214431
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agogo/importer: remove support for defunct binary export format
Robert Griesemer [Wed, 17 Oct 2018 23:53:37 +0000 (16:53 -0700)]
go/importer: remove support for defunct binary export format

Fixes #27999.

Change-Id: I488681eff4fb8e2580cf97a2d7631110d66ab19e
Reviewed-on: https://go-review.googlesource.com/c/go/+/143023
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
5 years agocmd/go: convert TestRelativeGOBINFail to script framework
Michael Matloob [Mon, 13 Jan 2020 16:24:06 +0000 (11:24 -0500)]
cmd/go: convert TestRelativeGOBINFail to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1cb3e2e28700b05b08933f4e24cd996268c1f163
Reviewed-on: https://go-review.googlesource.com/c/go/+/214428
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestBuildDryRunWithCgo to the script framework
Michael Matloob [Mon, 13 Jan 2020 16:14:23 +0000 (11:14 -0500)]
cmd/go: convert TestBuildDryRunWithCgo to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I2d14c07c590cc618c66f27fdc3a2bb8120c6d646
Reviewed-on: https://go-review.googlesource.com/c/go/+/214427
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestIssue11709 to the script framework
Michael Matloob [Mon, 13 Jan 2020 15:51:28 +0000 (10:51 -0500)]
cmd/go: convert TestIssue11709 to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I16fb0910196c96caef6ed380f96010a548407f9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/214424
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: add a few more calls to t.Parallel
Michael Matloob [Mon, 13 Jan 2020 20:53:03 +0000 (15:53 -0500)]
cmd/go: add a few more calls to t.Parallel

Change-Id: If8fe5be9d2cd174862c09bb4ce079f524eb33ff3
Reviewed-on: https://go-review.googlesource.com/c/go/+/214580
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/internal/moddeps: check for consistent versioning among all modules in GOROOT
Bryan C. Mills [Thu, 30 Jan 2020 22:13:01 +0000 (17:13 -0500)]
cmd/internal/moddeps: check for consistent versioning among all modules in GOROOT

Updates #36851
Fixes #36907

Change-Id: I29627729d916e3b8132d46cf458ba856ffb0beeb
Reviewed-on: https://go-review.googlesource.com/c/go/+/217218
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestDotDotDotOutsideGOPATH to script framework
Michael Matloob [Fri, 10 Jan 2020 22:58:20 +0000 (17:58 -0500)]
cmd/go: convert TestDotDotDotOutsideGOPATH to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I2170f427c238e9fe8c029b43b346621d82c5e8fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/214388
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestBuildIDContainsArchModeEnv to the script framework
Michael Matloob [Fri, 10 Jan 2020 22:53:05 +0000 (17:53 -0500)]
cmd/go: convert TestBuildIDContainsArchModeEnv to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I69c69809fb1698c8198ef3ea00103a9acb7b6ce7
Reviewed-on: https://go-review.googlesource.com/c/go/+/214387
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert remaining non-parallel tooSlow tests to script framework
Michael Matloob [Fri, 10 Jan 2020 21:59:02 +0000 (16:59 -0500)]
cmd/go: convert remaining non-parallel tooSlow tests to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ib1c55a48fafb5ce040ac70707bbc2a3ee5e2ddd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/214382
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go/testdata/script: fix typo in get_domain_root.txt
Michael Matloob [Wed, 19 Feb 2020 21:28:26 +0000 (16:28 -0500)]
cmd/go/testdata/script: fix typo in get_domain_root.txt

golang.org/cl/214141 introduced the typo 'skup' for 'skip', which
broke tests. This change fixes it.

Change-Id: I1b3c230b545f1c093d3e0feedc3b41f3f0b41bec
Reviewed-on: https://go-review.googlesource.com/c/go/+/220157
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agoall: update module dependencies
Bryan C. Mills [Mon, 3 Feb 2020 16:38:49 +0000 (11:38 -0500)]
all: update module dependencies

Updates #36905
Updates #36907

Change-Id: I293dcef67800d5c81ff3a254bbd49309c5880710
Reviewed-on: https://go-review.googlesource.com/c/go/+/217517
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agocmd/go: convert TestIssue12096 to the script framework
Michael Matloob [Fri, 10 Jan 2020 23:04:08 +0000 (18:04 -0500)]
cmd/go: convert TestIssue12096 to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I27e52c4eabfcd1782965f17c098719dd0ea7e3ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/214390
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestBadCgoDirectives to the script framework
Michael Matloob [Fri, 10 Jan 2020 21:15:19 +0000 (16:15 -0500)]
cmd/go: convert TestBadCgoDirectives to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1328a87e2481b4555b01df5c898f1a8015412adc
Reviewed-on: https://go-review.googlesource.com/c/go/+/214296
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoBuildOutput to the script framework
Michael Matloob [Fri, 10 Jan 2020 19:48:49 +0000 (14:48 -0500)]
cmd/go: convert TestGoBuildOutput to the script framework

Adds a in-script go binary called inarchive to check that an
archive is produced. A weaker could be done faster using grep,
but this is more faithful to the original test.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I001fa0698063be80fe3da947c81d4eb0829be47f
Reviewed-on: https://go-review.googlesource.com/c/go/+/214295
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestIssue6480 to the script framework
Michael Matloob [Fri, 10 Jan 2020 19:23:27 +0000 (14:23 -0500)]
cmd/go: convert TestIssue6480 to the script framework

This one's a bit complex and required writing support go programs
within the test script.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I9e91225b20b1b043f032b77a55c5825cb9d9a4b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/214292
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestCoverageRuns to the script framework
Michael Matloob [Fri, 10 Jan 2020 18:43:21 +0000 (13:43 -0500)]
cmd/go: convert TestCoverageRuns to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ie46118eddbd7c3ed0bb9ecee4bdc1cb6fdaf06a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/214291
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestSymlink* to the script framework
Michael Matloob [Fri, 10 Jan 2020 17:57:19 +0000 (12:57 -0500)]
cmd/go: convert TestSymlink* to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I0696fa54184514d69c0763ac772d99b12e133eb0
Reviewed-on: https://go-review.googlesource.com/c/go/+/214288
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoTest(Cpu|Mutex)profile.* to script framework
Michael Matloob [Fri, 10 Jan 2020 16:27:08 +0000 (11:27 -0500)]
cmd/go: convert TestGoTest(Cpu|Mutex)profile.* to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ie8b54b272e8a04720e437a37a5e5b0afd73481b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/214285
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert tests using testdata/src/(xtestonly|cgotest) to script framework
Michael Matloob [Fri, 10 Jan 2020 16:15:41 +0000 (11:15 -0500)]
cmd/go: convert tests using testdata/src/(xtestonly|cgotest) to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I3465cad1b0ba0d912067429146f1cb0668d5aa6b
Reviewed-on: https://go-review.googlesource.com/c/go/+/214284
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert some vet tests to the script framework
Michael Matloob [Thu, 9 Jan 2020 22:18:12 +0000 (17:18 -0500)]
cmd/go: convert some vet tests to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1f49a84f91735f39d5922c1347e79298780149c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/214218
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert some go get tests to the script framework
Michael Matloob [Thu, 9 Jan 2020 21:34:29 +0000 (16:34 -0500)]
cmd/go: convert some go get tests to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1de2b428ea7dac5429020742bf12bea910a02079
Reviewed-on: https://go-review.googlesource.com/c/go/+/214141
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert tests using testdata/src/(exclude|empty) to script framework
Michael Matloob [Thu, 9 Jan 2020 20:22:10 +0000 (15:22 -0500)]
cmd/go: convert tests using testdata/src/(exclude|empty) to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Icc14d4188574badf3da71d34857616f2a2ad5862
Reviewed-on: https://go-review.googlesource.com/c/go/+/214138
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoTestJSON to the script framework
Michael Matloob [Thu, 9 Jan 2020 19:28:26 +0000 (14:28 -0500)]
cmd/go: convert TestGoTestJSON to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I72bbba0a20a8731a89e1b4f4c9ac13b21c080cd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/214119
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert two go get tests to the script framework
Michael Matloob [Thu, 9 Jan 2020 17:41:16 +0000 (12:41 -0500)]
cmd/go: convert two go get tests to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ib1ccc72fc717df79214480b48dd98188d6061b46
Reviewed-on: https://go-review.googlesource.com/c/go/+/214117
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoGetUpdateInsecure to the script framework
Michael Matloob [Wed, 8 Jan 2020 21:44:50 +0000 (16:44 -0500)]
cmd/go: convert TestGoGetUpdateInsecure to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1aa423a919e76de5b021d74d6df981d2f7fd43b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/213877
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoGetInsecure to the script framework
Michael Matloob [Wed, 8 Jan 2020 20:21:39 +0000 (15:21 -0500)]
cmd/go: convert TestGoGetInsecure to the script framework

Part of converting all tests to script framework to improve
test parallelism

Updates #36320
Updates #17751

Change-Id: Ic323b643d7149df4fd63b222e820e2dff50686fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/213829
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestBenchTimeout to the script framework
Michael Matloob [Wed, 8 Jan 2020 19:55:08 +0000 (14:55 -0500)]
cmd/go: convert TestBenchTimeout to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I5dc403726f4960482ed7c267d1a333bbcc260087
Reviewed-on: https://go-review.googlesource.com/c/go/+/213828
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoGetNonPkg to the script framework
Michael Matloob [Wed, 8 Jan 2020 19:45:04 +0000 (14:45 -0500)]
cmd/go: convert TestGoGetNonPkg to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ieaddc20aebd0b71189f2ebc8f8e2758f1117bbed
Reviewed-on: https://go-review.googlesource.com/c/go/+/213826
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoBuildDashODevNull to script framework
Michael Matloob [Wed, 8 Jan 2020 19:36:20 +0000 (14:36 -0500)]
cmd/go: convert TestGoBuildDashODevNull to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I85e0d168d4e9862a718872427f56213ddc21fa32
Reviewed-on: https://go-review.googlesource.com/c/go/+/213825
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestFailFast to the script framework
Michael Matloob [Wed, 8 Jan 2020 19:21:15 +0000 (14:21 -0500)]
cmd/go: convert TestFailFast to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ibe1b09490bea72d9143324eae7443e0cf5afe85d
Reviewed-on: https://go-review.googlesource.com/c/go/+/213823
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoBuildTestOnly to the script framework
Michael Matloob [Wed, 8 Jan 2020 19:05:02 +0000 (14:05 -0500)]
cmd/go: convert TestGoBuildTestOnly to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1832e15e6a15301e075d2ec9d5169a77f11328fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/213822
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: delete testdata/testonly dir: it isn't being used anywhere
Michael Matloob [Wed, 8 Jan 2020 19:01:27 +0000 (14:01 -0500)]
cmd/go: delete testdata/testonly dir: it isn't being used anywhere

The TestGoBuildTestOnly test seems to be using files in testonly,
but it's actually creating different files in a tempdir GOPATH
that are completely unrelated.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ie2c6d477bbb2eac7c013ee8dea9330a367b4f663
Reviewed-on: https://go-review.googlesource.com/c/go/+/213821
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert tests using testdata/testinternal* to script framework
Michael Matloob [Wed, 8 Jan 2020 18:49:25 +0000 (13:49 -0500)]
cmd/go: convert tests using testdata/testinternal* to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I94a99c339f527da8ffacc73f1b36a7ac860522ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/213819
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert tests using testdata/testimport dir to script framework
Michael Matloob [Wed, 8 Jan 2020 18:25:08 +0000 (13:25 -0500)]
cmd/go: convert tests using testdata/testimport dir to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I3773508310865b198bc5f06dfc5ee7e34e92cdd0
Reviewed-on: https://go-review.googlesource.com/c/go/+/213818
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestCoverageNoStatements to the script framework.
Michael Matloob [Tue, 7 Jan 2020 21:41:26 +0000 (16:41 -0500)]
cmd/go: convert TestCoverageNoStatements to the script framework.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ie2c60ec0654ef605439beeed92cf5f1c2c8a1dd3
Reviewed-on: https://go-review.googlesource.com/c/go/+/213681
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert all tests using testdata/standalone_* to script framework
Michael Matloob [Tue, 7 Jan 2020 21:07:20 +0000 (16:07 -0500)]
cmd/go: convert all tests using testdata/standalone_* to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Iea6ba91d37c6f0d4994ae64e629c349c4eae511a
Reviewed-on: https://go-review.googlesource.com/c/go/+/213678
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert some generate tests to the script framework
Michael Matloob [Mon, 6 Jan 2020 18:30:37 +0000 (13:30 -0500)]
cmd/go: convert some generate tests to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I7110e460e18542aff90a7ae078b996ec45816d81
Reviewed-on: https://go-review.googlesource.com/c/go/+/213424
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: rewrite tests using testdata/example[12]_test.go to scripts
Michael Matloob [Fri, 3 Jan 2020 21:35:19 +0000 (16:35 -0500)]
cmd/go: rewrite tests using testdata/example[12]_test.go to scripts

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I81476ae6716903135781e5da135345456a36b026
Reviewed-on: https://go-review.googlesource.com/c/go/+/213219
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestListTests to the script framework
Michael Matloob [Thu, 2 Jan 2020 20:24:21 +0000 (15:24 -0500)]
cmd/go: convert TestListTests to the script framework

The original test has four subtests. I think it's okay to just have
one corresponding script test instead of having four different
tests.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I97bc2cbb3ad5a297d7457476b8c831ee6e0f49b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/213126
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert some coverage tests to the script framework
Michael Matloob [Fri, 27 Dec 2019 00:24:41 +0000 (19:24 -0500)]
cmd/go: convert some coverage tests to the script framework

This change converts TestCoverageFunc, TestCoverageDashC,
TestCoverageSyncAtomicImport, TestCoverageErrorLine,
TestCoverageDepLoop, TestCoverageDotImport, and
TestTestBuildFailureOutput to the script framework.

It adds a -exec modifier to the script framework's [exists] check
to check that a file is executable.

Updates #17751

Change-Id: Idc1e36c3702c94918631936f637510a6679d18a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/212624
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestCgoConsistentResults to the script framework
Michael Matloob [Thu, 26 Dec 2019 23:19:58 +0000 (18:19 -0500)]
cmd/go: convert TestCgoConsistentResults to the script framework

The call to tooSlow is rewritten into a check for [short].

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1f3e7664d575219b6fc525bd88babed15d1bd3b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/212622
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go/testdata/script: skip cover_cgo.* tests in short mode
Michael Matloob [Tue, 14 Jan 2020 18:58:50 +0000 (13:58 -0500)]
cmd/go/testdata/script: skip cover_cgo.* tests in short mode

The original tests called tooSlow, but I neglected to skip in short
mode on golang.org/cl/212621

Change-Id: Ifb5b8a405094b2ba53419184fa358b1e51e7b123
Reviewed-on: https://go-review.googlesource.com/c/go/+/214698
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agodoc/go1.14: highlight the addition of hash/maphash package
Dmitri Shuralyov [Tue, 18 Feb 2020 15:03:22 +0000 (10:03 -0500)]
doc/go1.14: highlight the addition of hash/maphash package

Given that it's a package that did not exist before, was a proposal
in issue #28322, got accepted and implemented for 1.14, it seems to
be more than a minor change to the library. Highlight it accordingly.

Also specify the results are 64-bit integers, as done in CL 219340.

Updates #36878
Updates #28322

Change-Id: Idefe63d4c47a02cdcf8be8ab08c40cdb94ff2098
Reviewed-on: https://go-review.googlesource.com/c/go/+/219877
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Toshihiro Shiino <shiino.toshihiro@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agodoc/go1.14: remove TODO comment for CL 200439
Dmitri Shuralyov [Tue, 18 Feb 2020 18:28:35 +0000 (18:28 +0000)]
doc/go1.14: remove TODO comment for CL 200439

Based on https://golang.org/issue/36878#issuecomment-587533153
and https://golang.org/issue/36878#issuecomment-587549692,
this is not a CL that needs to be mentioned in the release notes.

Updates #36878

Change-Id: Icaa9153da7481a1d3ebabc237411539dd770cef2
Reviewed-on: https://go-review.googlesource.com/c/go/+/219898
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/link, runtime: skip holes in func table
Cherry Zhang [Sun, 16 Feb 2020 21:18:04 +0000 (16:18 -0500)]
cmd/link, runtime: skip holes in func table

On PPC64 when external linking, for large binaries we split the
text section to multiple sections, so the external linking may
insert trampolines between sections. These trampolines are within
the address range covered by the func table, but not known by Go.
This causes runtime.findfunc to return a wrong function if the
given PC is from such trampolines.

In this CL, we generate a marker between text sections where
there could potentially be a hole in the func table. At run time,
we skip the hole if we see such a marker.

Fixes #37216.

Change-Id: I95ab3875a84b357dbaa65a4ed339a19282257ce0
Reviewed-on: https://go-review.googlesource.com/c/go/+/219717
Reviewed-by: David Chase <drchase@google.com>
5 years agodoc/go1.14: add missing period at sentence end
Alberto Donizetti [Mon, 17 Feb 2020 08:50:21 +0000 (09:50 +0100)]
doc/go1.14: add missing period at sentence end

Change-Id: I82050f16906e7d34555a592e96b7855515a1726a
Reviewed-on: https://go-review.googlesource.com/c/go/+/219641
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
5 years agotesting: remove obsolete comment in testing.(*T) docs
Ian Lance Taylor [Sat, 15 Feb 2020 04:35:59 +0000 (20:35 -0800)]
testing: remove obsolete comment in testing.(*T) docs

We now only accumulate logs when not using -v. Just drop the sentence
entirely rather than try to describe the current situation.

Updates #24929
Updates #37203

Change-Id: Ie3bf37894ab68b5b129eff54637893c7a129da03
Reviewed-on: https://go-review.googlesource.com/c/go/+/219540
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agoruntime: correct caller PC/SP offsets in walltime1/nanotime1
Cherry Zhang [Tue, 11 Feb 2020 20:09:39 +0000 (15:09 -0500)]
runtime: correct caller PC/SP offsets in walltime1/nanotime1

In walltime1/nanotime1, we save the caller's PC and SP for stack
unwinding. The code does that assumed zero frame size. Now that
the frame size is not zero, correct the offset. Rewrite it in a
way that doesn't depend on hard-coded frame size.

May fix #37127.

Change-Id: I47d6d54fc3499d7d5946c3f6a2dbd24fbd679de1
Reviewed-on: https://go-review.googlesource.com/c/go/+/219118
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
5 years agoruntime: zero upper bit of Y registers in asyncPreempt on darwin/amd64
Cherry Zhang [Tue, 11 Feb 2020 23:54:30 +0000 (18:54 -0500)]
runtime: zero upper bit of Y registers in asyncPreempt on darwin/amd64

Apparently, the signal handling code path in darwin kernel leaves
the upper bits of Y registers in a dirty state, which causes many
SSE operations (128-bit and narrower) become much slower. Clear
the upper bits to get to a clean state.

We do it at the entry of asyncPreempt, which is immediately
following exiting from the kernel's signal handling code, if we
actually injected a call. It does not cover other exits where we
don't inject a call, e.g. failed preemption, profiling signal, or
other async signals. But it does cover an important use case of
async signals, preempting a tight numerical loop, which we
introduced in this cycle.

Running the benchmark in issue #37174:

name    old time/op  new time/op  delta
Fast-8  90.0ns ± 1%  46.8ns ± 3%  -47.97%  (p=0.000 n=10+10)
Slow-8   188ns ± 5%    49ns ± 1%  -73.82%  (p=0.000 n=10+9)

There is no more slowdown due to preemption signals.

For #37174.

Change-Id: I8b83d083fade1cabbda09b4bc25ccbadafaf7605
Reviewed-on: https://go-review.googlesource.com/c/go/+/219131
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agohash/maphash: mention the results are 64-bit integers
Keith Randall [Thu, 13 Feb 2020 18:24:41 +0000 (10:24 -0800)]
hash/maphash: mention the results are 64-bit integers

Change-Id: I0d2ba52d79c34d77d475ec8d673286d0e56b826b
Reviewed-on: https://go-review.googlesource.com/c/go/+/219340
Reviewed-by: Alan Donovan <adonovan@google.com>
5 years agoruntime: fix fallback logic for aeshash on 32/64 bit
Keith Randall [Thu, 13 Feb 2020 15:37:28 +0000 (07:37 -0800)]
runtime: fix fallback logic for aeshash on 32/64 bit

We were using the fallback hash unconditionally.  Oops.

Fixes #37212

Change-Id: Id37d4f5c08806fdda12a3148ba4dbc46676eeb54
Reviewed-on: https://go-review.googlesource.com/c/go/+/219337
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agocmd/go: eliminate empty '()' when passing -mod=readonly explicitly to 'go list'
Bryan C. Mills [Wed, 12 Feb 2020 18:03:18 +0000 (13:03 -0500)]
cmd/go: eliminate empty '()' when passing -mod=readonly explicitly to 'go list'

Discovered while investigating #37197.

Updates #33326
Updates #34822

Change-Id: I38b136a4ee762a580a554125066b9778491295f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/219237
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/go/internal/modcmd: remove dead function addModFlag
Jay Conrod [Wed, 12 Feb 2020 15:14:12 +0000 (10:14 -0500)]
cmd/go/internal/modcmd: remove dead function addModFlag

This function is never called and should have been removed
earlier. work.AddModCommonFlags defines the -modfile flag instead.

Fixes #37189

Change-Id: I73ad2a727013a849cba44bf70de04160f37c97dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/219197
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go/internal/web: fix a typo
Kanta Ebihara [Tue, 11 Feb 2020 23:17:30 +0000 (08:17 +0900)]
cmd/go/internal/web: fix a typo

dependenicies -> dependencies

Change-Id: I0b8f06c04cf397c6330ffb43ac3ae5c2f7cf3138
Reviewed-on: https://go-review.googlesource.com/c/go/+/219157
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agogo/build: populate partial package information in importGo
Dmitri Shuralyov [Mon, 10 Feb 2020 00:51:22 +0000 (19:51 -0500)]
go/build: populate partial package information in importGo

This is a followup to CL 199840 and CL 203820. Cumulatively, they caused
a previously known bug to trigger more often while also nearly fixing it.

This change is a small fixup to CL 199840 that resolves the known bug
and prevents it from causing an additional regression in Go 1.14.

Part 1

The intention in CL 199840 was to return the same error that 'go list'
reported when the package wasn't located, so an early return was added.
However, to determine whether the package was located or not, p.Dir was
unintentionally checked instead of dir.

p is initialized to &Package{ImportPath: path} at top of Context.Import,
and its Dir field is never set before that line in importGo is reached.
So return errors.New(errStr) was always executed whenever errStr != "".

Originally, in CL 125296, the "go list" invocation did not include an
'-e' flag, so it would return a non-zero exit code on packages where
build constraints exclude all Go files, and importGo would return an
error like "go/build: importGo import/path: unexpected output: ...".

CL 199840 added an '-e' flag to the "go list" invocation, but checking
the wrong dir variable caused partial package information to never get
populated, and thus issue #31603 continued to occur, although with a
different error message (which ironically included the location of the
package that was supposedly "not found").

Now that the right dir is checked, issue #31603 is fixed.

Part 2

importGo checks whether it can use the go command to find the directory
of a package. In Go 1.13.x and earlier, one of the conditions to use the
go command was that the source directory must be provided.

CL 203820 made a change such that knowing the source directory was
no longer required:

 // To invoke the go command,
-// we must know the source directory,
 // ...

That meant build.Import invocations where srcDir is the empty string:

build.Import(path, "", build.FindOnly)

Started using the go command to find the directory of the package, and
started to run into issue #31603 as well. That's the #37153 regression.

Since this change fixes issue #31603, it also fixes issue #37153.

Part 3

There is one more thing. Delete the debugImportGo constant, it's unused.

Updates #26504 (CL 125296)
Updates #34752 (CL 199840)
Updates #34860 (CL 203820)
Fixes #31603
Fixes #37153

Change-Id: Iaa7dcc45ba0f708a978950c75fa4c836b87006f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/218817
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agohash/maphash: mention that hash values do not persist in package docs
Ian Lance Taylor [Thu, 6 Feb 2020 19:18:22 +0000 (11:18 -0800)]
hash/maphash: mention that hash values do not persist in package docs

Updates #36878
Fixes #37040

Change-Id: Ib0bd21481e5d9c3b3966c116966ecfe071243a24
Reviewed-on: https://go-review.googlesource.com/c/go/+/218297
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
5 years agocrypto/elliptic: document the Name and names of each curve
Filippo Valsorda [Mon, 10 Feb 2020 22:29:13 +0000 (17:29 -0500)]
crypto/elliptic: document the Name and names of each curve

See https://tools.ietf.org/html/rfc8422#appendix-A for a helpful table.

Also, commit to keeping them singletons, as that assumption is already
made all over the place in the ecosystem.

Fixes #34193

Change-Id: I2ec50fa18bb80e11d6101f2562df60b5e27d4f66
Reviewed-on: https://go-review.googlesource.com/c/go/+/218921
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.14: add a couple minor crypto release notes
Filippo Valsorda [Mon, 10 Feb 2020 19:48:58 +0000 (14:48 -0500)]
doc/go1.14: add a couple minor crypto release notes

These were left out of CL 216759 because they are trivial, but I was
advised to be thorough.

Updates #36878

Change-Id: Id4fd3a84866a82265e3f89abfdad6e3d231b507c
Reviewed-on: https://go-review.googlesource.com/c/go/+/218918
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agogo/doc: clarify that NewFromFiles caller must filter by GOOS/GOARCH
Dmitri Shuralyov [Fri, 7 Feb 2020 16:15:11 +0000 (11:15 -0500)]
go/doc: clarify that NewFromFiles caller must filter by GOOS/GOARCH

The most well known and important build constraints to take into
account when rendering package documentation are the GOOS/GOARCH
values. Make it more clear in the NewFromFiles documentation that
they are a part of all build constraints that the caller is
responsible for filtering out.

Also suggest the "go/build".Context.MatchFile method for performing
file matching. The logic to perform build context file matching is
subtle and has many rules that aren't well known (for example,
taking the gc or gccgo compiler into account). It is currently the
only exported API in the standard library that implements this logic,
and it would be unfortunate if people attempt to re-create it because
they don't realize it is already available.

Updates #23864

Change-Id: I3c5901e7081acf79125b2d429ec3aa3b58416ed7
Reviewed-on: https://go-review.googlesource.com/c/go/+/218477
Reviewed-by: Robert Griesemer <gri@golang.org>
5 years agodoc: move doc/modules.md to x/website
Jay Conrod [Thu, 6 Feb 2020 19:14:03 +0000 (14:14 -0500)]
doc: move doc/modules.md to x/website

Moved /doc/modules.md from GOROOT to x/website. The corresponding
change in x/website is CL 218239. See explanation there.

Updates #33637

Change-Id: I329935624e6e264873bc68b6487405a63d3e7030
Reviewed-on: https://go-review.googlesource.com/c/go/+/218240
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agodoc/go1.14: rearrange in alphabetical order
Toshihiro Shiino [Sat, 8 Feb 2020 15:46:14 +0000 (15:46 +0000)]
doc/go1.14: rearrange in alphabetical order

"Minor changes to the library" are basically arranged in alphabetical
order, but there are some mistakes so we will correct them.

Updates #36878

Change-Id: I8498563b739eff9f1b0a76ead3cf290191e0ce36
Reviewed-on: https://go-review.googlesource.com/c/go/+/218638
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agodoc/go1.14: add link to TempFile in io/ioutil
Toshihiro Shiino [Sat, 8 Feb 2020 10:41:30 +0000 (10:41 +0000)]
doc/go1.14: add link to TempFile in io/ioutil

For convenience, TempFile in io/ioutil now has a link to the document.

Updates #36878

Change-Id: I5c22f57c886badd8ca423e34527c4b4bb029847b
Reviewed-on: https://go-review.googlesource.com/c/go/+/218637
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
5 years agodoc/go1.14: fix inconsistent markup
Toshihiro Shiino [Wed, 5 Feb 2020 11:25:01 +0000 (11:25 +0000)]
doc/go1.14: fix inconsistent markup

Unlike the others, the dt tag of reflect is not next to the dl tag.
The dd's closing tags may or may not have been omitted. They were unified without omission.

Updates #36878

Change-Id: I4e24f93fe8763ae8a1e4392db72e0b4818884f44
Reviewed-on: https://go-review.googlesource.com/c/go/+/217701
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agoruntime/race: update reference to compiler-rt sources
Ian Lance Taylor [Wed, 5 Feb 2020 14:50:46 +0000 (06:50 -0800)]
runtime/race: update reference to compiler-rt sources

Change-Id: Iabe46677f24fef6e482a4beca774dbfc553026a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/217778
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
5 years agoruntime: avoid double notewakeup in netpoll stub code
Ian Lance Taylor [Fri, 7 Feb 2020 18:49:33 +0000 (10:49 -0800)]
runtime: avoid double notewakeup in netpoll stub code

Otherwise we can see
- goroutine 1 calls netpollBreak, the atomic.Cas succeeds, then suspends
- goroutine 2 calls noteclear, sets netpollBroken to 0
- goroutine 3 calls netpollBreak, the atomic.Cas succeeds, calls notewakeup
- goroutine 1 wakes up calls notewakeup, crashes due to double wakeup

This doesn't happen on Plan 9 because it only runs one thread at a time.
But Fuschia wants to use this code too.

Change-Id: Ib636e4f327bb15e44a2c40fd681aae9a91073a30
Reviewed-on: https://go-review.googlesource.com/c/go/+/218537
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
5 years agodoc: fill in 'go mod init' section of module documentation
Jay Conrod [Fri, 10 Jan 2020 21:00:29 +0000 (16:00 -0500)]
doc: fill in 'go mod init' section of module documentation

Updates #33637

Change-Id: I9c1345d0fa7a1b6c98c33b8b0837706e5261d5b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/214381
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
5 years agodoc: fill in 'go mod download' section of module documentation
Jay Conrod [Fri, 10 Jan 2020 20:59:29 +0000 (15:59 -0500)]
doc: fill in 'go mod download' section of module documentation

Updates #33637

Change-Id: I963c04639201b32e0513a235306a03eae51222b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/214380
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
5 years agodoc: fill in 'go list -m' section in module documentation
Jay Conrod [Fri, 10 Jan 2020 20:57:47 +0000 (15:57 -0500)]
doc: fill in 'go list -m' section in module documentation

Updates #33637

Change-Id: I14ba3198375b98a270bbce2cd60234b071a6b974
Reviewed-on: https://go-review.googlesource.com/c/go/+/214379
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
5 years agodoc: fill in 'Module-aware commands' section in module documentation
Jay Conrod [Fri, 10 Jan 2020 20:52:05 +0000 (15:52 -0500)]
doc: fill in 'Module-aware commands' section in module documentation

Updates #33637

Change-Id: I6332fcdbd4c35a11cd84504f28ee594f1831ccaa
Reviewed-on: https://go-review.googlesource.com/c/go/+/214378
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
5 years agodoc: add section on module paths to module documentation
Jay Conrod [Fri, 10 Jan 2020 20:46:34 +0000 (15:46 -0500)]
doc: add section on module paths to module documentation

Updates #33637

Change-Id: I2197b20c2da2a5f57aacd40cc14611c5e6e25c5f
Reviewed-on: https://go-review.googlesource.com/c/go/+/214377
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
5 years agodoc: add section on go.mod file syntax
Jay Conrod [Fri, 6 Dec 2019 23:24:29 +0000 (18:24 -0500)]
doc: add section on go.mod file syntax

Updates #33637

Change-Id: I265e4fda863b871a3ce0ca7b6c926081dadbf5a6
Reviewed-on: https://go-review.googlesource.com/c/go/+/210799
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agoRevert "cmd/link: code cleanup in macho_combine_dwarf.go"
Than McIntosh [Fri, 7 Feb 2020 16:47:23 +0000 (16:47 +0000)]
Revert "cmd/link: code cleanup in macho_combine_dwarf.go"

This reverts commit 494dd1dddceb2df533feddd483b7cb05310f1085.

Reason for revert: Not suitable for Go 1.14, will send to Go 1.15 instead.

Change-Id: Iedc04fe6a9ace29a16498046eef9420afbaf4636
Reviewed-on: https://go-review.googlesource.com/c/go/+/218482
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
5 years agocmd/link: code cleanup in macho_combine_dwarf.go
Tamir Duberstein [Tue, 14 Jan 2020 15:43:55 +0000 (10:43 -0500)]
cmd/link: code cleanup in macho_combine_dwarf.go

- remove global variables
- add missing error checks
- add missing (*os.File).Close calls
- null-check text section correctly
- reduce some variable scopes
- use bytes.Buffer instead of appended slice
- reduce integer casting

Change-Id: I4f6899923d0b26627308beb5c5c3ee9e6c68c41d
Reviewed-on: https://go-review.googlesource.com/c/go/+/214657
Reviewed-by: Than McIntosh <thanm@google.com>
5 years agotesting: make Cleanup work for benchmarks too.
Roger Peppe [Thu, 6 Feb 2020 08:47:20 +0000 (08:47 +0000)]
testing: make Cleanup work for benchmarks too.

Fixes #37073.

Change-Id: I6fb24a3f9d7b7adf3213ac6a8bcbf5fb43975b7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/218117
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agodoc/go1.14: disable text/template processing in HTML page
Dmitri Shuralyov [Thu, 6 Feb 2020 00:24:55 +0000 (19:24 -0500)]
doc/go1.14: disable text/template processing in HTML page

HTML pages served by the website have the option to opt-in to template
processing, by including "Template: true" in the page metadata.
This functionality is documented at
https://github.com/golang/tools/blob/403f1254bdfd3da27c92a0e9e37dd180a9a82b3c/godoc/template.go#L5-L30.

Historically, the Go 1 release notes have used template processing
to a great extent, but release notes for all subsequent major Go
releases have not.

Since this feature is generally not used and not very well known,
it tends to do more harm than good by making it possible for errors
in the template to prevent the release notes from showing up at all.

Disable this feature for Go 1.14 release notes and onwards.
We can consider enabling it when there's a stronger need for it.

Fixes #37072
Updates #37070

Change-Id: If93553d52df12544b46c4edcf3aa5eddc2a155ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/218058
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.14: quote {{ and }} in text/template note
Ian Lance Taylor [Wed, 5 Feb 2020 23:34:50 +0000 (15:34 -0800)]
doc/go1.14: quote {{ and }} in text/template note

Fixes #37070

Change-Id: I543957df264367e56c71a25bfaea5cf7935d438f
Reviewed-on: https://go-review.googlesource.com/c/go/+/217979
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agodoc/go1.14: mention better error checking in text/template
Ian Lance Taylor [Wed, 5 Feb 2020 22:12:04 +0000 (14:12 -0800)]
doc/go1.14: mention better error checking in text/template

This caused 35 test failures in Google internal code,
so it's worth mentioning in the release notes.

Updates #31810
Updates #36878
Fixes #37066

Change-Id: I2faa6bce4c7d735107eceaef7d95223844846454
Reviewed-on: https://go-review.googlesource.com/c/go/+/217978
Reviewed-by: Rob Pike <r@golang.org>
5 years agodoc/go1.14: document io/ioutil.TempDir's predictable prefix+suffix
Emmanuel T Odeke [Wed, 5 Feb 2020 19:36:00 +0000 (11:36 -0800)]
doc/go1.14: document io/ioutil.TempDir's predictable prefix+suffix

Documents io/ioutil.TempDir's new ability to create
predictable prefixes and suffixes, derived from the argument
'pattern', separated by the last '*' in it.

References: CL 198488

Updates #36878

Change-Id: I92c52fcc7d480ce74746e99e6e85a04efb87294f
Reviewed-on: https://go-review.googlesource.com/c/go/+/217780
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocrypto/x509: fix godoc for MarshalPKCS8PrivateKey
Katie Hockman [Wed, 5 Feb 2020 19:18:20 +0000 (14:18 -0500)]
crypto/x509: fix godoc for MarshalPKCS8PrivateKey

Fixes #36735

Change-Id: I93f005d78f4bfac773272995b165172461bae92f
Reviewed-on: https://go-review.googlesource.com/c/go/+/217917
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
5 years agoruntime: rewrite a comment in malloc.go
Jerrin Shaji George [Wed, 5 Feb 2020 01:21:11 +0000 (01:21 +0000)]
runtime: rewrite a comment in malloc.go

This commit changes the wording of a comment in malloc.go that describes
how span objects are zeroed to make it more clear.

Change-Id: I07722df1e101af3cbf8680ad07437d4a230b0168
GitHub-Last-Rev: 0e909898c709a9119cea7dbd80c25d9d7a73e22b
GitHub-Pull-Request: golang/go#37008
Reviewed-on: https://go-review.googlesource.com/c/go/+/217618
Reviewed-by: Austin Clements <austin@google.com>
5 years agomath/big: reintroduce pre-Go 1.14 mention in GCD docs
Filippo Valsorda [Wed, 5 Feb 2020 20:24:30 +0000 (15:24 -0500)]
math/big: reintroduce pre-Go 1.14 mention in GCD docs

It was removed in CL 217302 but was intentionally added in CL 217104.

Change-Id: I1a478d80ad1ec4f0a0184bfebf8f1a5e352cfe8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/217941
Reviewed-by: Robert Griesemer <gri@golang.org>
5 years agodoc/go1.14: document http.ServeFile large file fix for Windows
Emmanuel T Odeke [Wed, 5 Feb 2020 19:09:34 +0000 (11:09 -0800)]
doc/go1.14: document http.ServeFile large file fix for Windows

Document that for Windows, net/http.ServeFile can now
correctly serve files >2GB after we fixed internal/poll.SendFile
to transmit files larger than the default Windows limit of 2GB.

References: CL 192518, CL 194218

Updates #36878

Change-Id: Ibefc8b2841bc0cee3a89884a680085f99d2b6928
Reviewed-on: https://go-review.googlesource.com/c/go/+/217779
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/go/internal/vet: only set work.VetExplicit if the list of explicit flags is non...
Bryan C. Mills [Wed, 5 Feb 2020 18:36:53 +0000 (13:36 -0500)]
cmd/go/internal/vet: only set work.VetExplicit if the list of explicit flags is non-empty

Updates #35837
Fixes #37030

Change-Id: Ifd3435803622a8624bab55a0f3fbc8855025282f
Reviewed-on: https://go-review.googlesource.com/c/go/+/217897
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agodoc/install.html: streamline the “Test your installation” step and make it module...
Bryan C. Mills [Wed, 5 Feb 2020 15:22:07 +0000 (10:22 -0500)]
doc/install.html: streamline the “Test your installation” step and make it module-agnostic

In CL 199417, we updated “How to Write Go Code” to give a basic
introduction to modules and to include module-mode commands.
However, most new users will end up reading “Getting Started”
(doc/install.html) before “How to Write Go Code”, and we forgot to
update the handful of commands there for module mode.

Before this change, the “Test your installation” section also covered
quite a few operations beoyond merely testing the installation: it
included setting up a GOPATH, building a binary, and installing and
cleaning binaries. Those are valuable operations to learn, but they
arguably belong in “How to Write Go Code”, not “Test your
installation” — and having all that extra detail in the install
instructions may well discourage folks from further essential reading.

Rather than updating all of those operations here, I've removed them.
A companion CL will update “How to Write Go Code” to ensure that it
mentions GOPATH (as the location of the module cache and the default
install location for binaries) and 'go clean -i'.

Updates #37042

Change-Id: I157f21ccbe3896575fa1115dc821abf6c71ed15e
Reviewed-on: https://go-review.googlesource.com/c/go/+/217840
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
5 years agodoc/go1.14: add remarks about range inference and check removal
David Chase [Wed, 15 Jan 2020 22:19:17 +0000 (17:19 -0500)]
doc/go1.14: add remarks about range inference and check removal

Mentions CLs 174704 and 196784.

Change-Id: Ia8f821a3d90a4e08c895a6f091dbf07311e885ba
Reviewed-on: https://go-review.googlesource.com/c/go/+/214946
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
5 years agodoc: rename HTML element IDs to avoid duplicates
Dmitri Shuralyov [Wed, 5 Feb 2020 10:23:42 +0000 (05:23 -0500)]
doc: rename HTML element IDs to avoid duplicates

These 3 release notes have had an element ID collision because both
the runtime changes and changes to the package "runtime" used the
same ID. Fix it by using a "pkg-" prefix for the runtime package.

Move the "runtime-again" ID from CL 129635 to a nearby <dt> element
so that existing links to https://golang.org/doc/go1.11#runtime-again
don't break.

Fixes #37036
Updates #36878

Change-Id: Ib68d93acfac802fd84c0a57485937e45dea2064a
Reviewed-on: https://go-review.googlesource.com/c/go/+/217797
Reviewed-by: Toshihiro Shiino <shiino.toshihiro@gmail.com>
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>