1. 05 May, 2019 2 commits
  2. 04 May, 2019 1 commit
    • Damien Neil's avatar
      all: add Unwrap and Is methods to various error types · 170b8b4b
      Damien Neil authored
      Add Unwrap methods to types which wrap an underlying error:
      
        "encodinc/csv".ParseError
        "encoding/json".MarshalerError
        "net/http".transportReadFromServerError
        "net".OpError
        "net".DNSConfigError
        "net/url".Error
        "os/exec".Error
        "signal/internal/pty".PtyError
        "text/template".ExecError
      
      Add os.ErrTemporary. A case could be made for putting this error
      value in package net, since no exported error types in package os
      include a Temporary method. However, syscall errors returned from
      the os package do include this method.
      
      Add Is methods to error types with a Timeout or Temporary method,
      making errors.Is(err, os.Err{Timeout,Temporary}) equivalent to
      testing the corresponding method:
      
        "context".DeadlineExceeded
        "internal/poll".TimeoutError
        "net".adrinfoErrno
        "net".OpError
        "net".DNSError
        "net/http".httpError
        "net/http".tlsHandshakeTimeoutError
        "net/pipe".timeoutError
        "net/url".Error
      
      Updates #30322
      Updates #29934
      
      Change-Id: I409fb20c072ea39116ebfb8c7534d493483870dc
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170037
      Run-TryBot: Damien Neil <dneil@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMarcel van Lohuizen <mpvl@golang.org>
      170b8b4b
  3. 03 May, 2019 14 commits
  4. 02 May, 2019 13 commits
  5. 01 May, 2019 10 commits
    • Heschi Kreinick's avatar
      cmd/go/internal/web: fix log message · e5f0d144
      Heschi Kreinick authored
      The web package is now used for proxy fetches, so its logs shouldn't
      start with "Parsing meta tags".
      
      Change-Id: I22a7dce09e3a681544ee4b860f93c63336e547ca
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174740
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      e5f0d144
    • LE Manh Cuong's avatar
      cmd/compile: fix maplit init panics for dynamic entry · aaf40f8f
      LE Manh Cuong authored
      golang.org/cl/174498 removes dynamic map entry handling in maplit, by
      filtering the static entry only. It panics if it see a dynamic entry.
      It relies on order to remove all dynamic entries.
      
      But after recursively call order on the statics, some static entries
      become dynamic, e.g OCONVIFACE node:
      
      	type i interface {
      		j()
      	}
      	type s struct{}
      
      	func (s) j() {}
      
      	type foo map[string]i
      
      	var f = foo{
      		"1": s{},
      	}
      
      To fix it, we recursively call order on each static entry, if it changed
      to dynamic, put entry to dynamic then.
      
      Fixes #31777
      
      Change-Id: I1004190ac8f2d1eaa4beb6beab989db74099b025
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174777
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      aaf40f8f
    • Russ Cox's avatar
      cmd/go: sort vendor/modules.txt package lists · 40a6d0e0
      Russ Cox authored
      Right now they are in a deterministic order
      but one that depends on the shape of the import graph.
      Sort them instead.
      
      Change-Id: Ia0c076a0d6677a511e52acf01f38353e9895dec2
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174527
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      40a6d0e0
    • Martin Möhrmann's avatar
      strings, bytes: add ToValidUTF8 · 3259bc44
      Martin Möhrmann authored
      The newly added functions create a copy of their input with all bytes in
      invalid UTF-8 byte sequences mapped to the UTF-8 byte sequence
      given as replacement parameter.
      
      Fixes #25805
      
      Change-Id: Iaf65f65b40c0581c6bb000f1590408d6628321d0
      Reviewed-on: https://go-review.googlesource.com/c/go/+/142003
      Run-TryBot: Martin Möhrmann <moehrmann@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3259bc44
    • Elias Naur's avatar
      misc/cgo/testcarchive: skip TestExtar on self-hosted iOS · 07f68942
      Elias Naur authored
      iOS cannot (directly) run shell scripts.
      
      Updates #31722
      
      Change-Id: I69473e9339c50a77338d391c73b4e146bce3fa89
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174700
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      07f68942
    • Elias Naur's avatar
      cmd/dist: only build exec wrappers when cross compiling · f0c383b8
      Elias Naur authored
      Updates #31722
      
      Change-Id: Ib44b46e628e364fff6eacda2b26541db2f0a4261
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174701
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      f0c383b8
    • Hana Kim's avatar
      cmd/go/internal/get: fix strayed verbose output on stdout · fad365ba
      Hana Kim authored
      Fixes #31768
      
      Change-Id: I3cc0ebc4be34d7c2d2d4fd655bfd0c2515ff3021
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174739Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      fad365ba
    • Pontus Leitzler's avatar
      cmd/go/internal/modfetch/codehost: fix pseudoversions for non-semver tags and... · cbe2b14d
      Pontus Leitzler authored
      cmd/go/internal/modfetch/codehost: fix pseudoversions for non-semver tags and tags on other branches
      
      Pseudoversion determination depends in part on the results from gitRepo.RecentTag, which currently invokes:
      
      git describe --first-parent --always --abbrev=0 --match <prefix>v[0-9]*.[0-9]*.[0-9]* --tags <rev>
      
      The comment at https://github.com/golang/go/issues/27171#issuecomment-470134255 describes some problems with the current approach.
      
      One problem is Docker and other repos can have tags that are not valid semver tags but that still match a glob pattern of v[0-9]*.[0-9]*.[0-9]* which are found by 'git describe' but then rejected by cmd/go, and hence those repos currently can end up with v0.0.0 pseudoversions instead of finding a proper semver tag to use as input to building a pseudoversion  (when then causes problems when the v0.0.0 pseudoversion is fed into MVS). An example problematic tag is a date-based tag such as 'v18.06.16', which matches the glob pattern, but is not a valid semver tag (due to the leading 0 in '06').
      
      Issues #31673, #31287, and #27171 also describe problems where the '--first-parent' argument to 'git describe' cause the current approach to miss relevant semver tags that were created on a separate branch and then subsequently merged to master.
      
      In #27171, Bryan described the base tag that is supposed to be used for pseudoversions as:
      
      "It is intended to be the semantically-latest tag that appears on any commit that is a (transitive) parent of the commit with the given hash, regardless of branches. (The pseudo-version is supposed to sort after every version — tagged or otherwise — that came before it, but before the next tag that a human might plausibly want to apply to the branch.)"
      
      This CL solves the glob problem and tags-on-other-branches problem more directly than the current approach: this CL gets the full list of tags that have been merged into the specific revision of interest, and then sorts and filters the results in cmd/go to select the semantically-latest valid semver tag.
      
      Fixes #31673
      Fixes #31287
      Updates #27171
      
      Change-Id: I7c3e6b46b2b21dd60562cf2893b6bd2afaae61d5
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174061
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      cbe2b14d
    • David Chase's avatar
      runtime: look for idle p to run current goroutine when switching to GC or traceReader · e56c73f1
      David Chase authored
      This repairs one of the several causes of pauses uncovered
      by a GC microbenchmark.  A pause can occur when a goroutine's
      quantum expires "at the same time" a GC is needed.  The
      current M switches to running a GC worker, which means that
      the amount of available work has expanded by one.  The GC
      worker, however, does not call ready, and does not itself
      conditionally wake a P (a "normal" thread would do this).
      
      This is also true if M switches to a traceReader.
      
      This is problem 4 in this list:
      https://github.com/golang/go/issues/27732#issuecomment-423301252
      
      Updates #27732.
      
      Change-Id: I6905365cac8504cde6faab2420f4421536551f0b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/146817
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      e56c73f1
    • Russ Cox's avatar
      index/suffixarray: add 32-bit implementation · 45be3530
      Russ Cox authored
      The original index/suffixarray used 32-bit ints on 64-bit machines,
      because that's what 'int' meant in Go at the time. When we changed
      the meaning of int, that doubled the space overhead of suffix arrays
      for all uses, even though the vast majority of them describe less
      than 2 GB of text.
      
      The space overhead of a suffix array compared to the text is not
      insignificant: there's a big difference for many uses between 4X and 8X.
      
      This CL adjusts names in qsufsort.go so that a global search and
      replace s/32/64/g produces a working 64-bit implementation,
      and then it modifies suffixarray.go to choose between the 32-bit
      and 64-bit implementation as appropriate depending on the input size.
      The 64-bit implementation is generated by 'go generate'.
      
      This CL also restructures the benchmarks, to test different
      input sizes, different input texts, and 32-bit vs 64-bit.
      
      The serialized form uses varint-encoded numbers and is unchanged,
      so on-disk suffix arrays written by older versions of Go will be
      readable by this version, and vice versa.
      
      The 32-bit version runs a up to 17% faster than the 64-bit version
      on real inputs, but more importantly it uses 50% less memory.
      
      I have a followup CL that also implements a faster algorithm
      on top of these improvements, but these are a good first step.
      
      name                                  64-bit speed   32-bit speed    delta
      New/text=opticks/size=100K/bits=*-12  4.44MB/s ± 0%  4.64MB/s ± 0%   +4.41%  (p=0.008 n=5+5)
      New/text=opticks/size=500K/bits=*-12  3.70MB/s ± 1%  3.82MB/s ± 0%   +3.30%  (p=0.008 n=5+5)
      New/text=go/size=100K/bits=*-12       4.40MB/s ± 0%  4.61MB/s ± 0%   +4.82%  (p=0.008 n=5+5)
      New/text=go/size=500K/bits=*-12       3.66MB/s ± 0%  3.77MB/s ± 0%   +3.01%  (p=0.016 n=4+5)
      New/text=go/size=1M/bits=*-12         3.29MB/s ± 0%  3.55MB/s ± 0%   +7.90%  (p=0.016 n=5+4)
      New/text=go/size=5M/bits=*-12         2.25MB/s ± 1%  2.65MB/s ± 0%  +17.81%  (p=0.008 n=5+5)
      New/text=go/size=10M/bits=*-12        1.82MB/s ± 0%  2.09MB/s ± 1%  +14.36%  (p=0.008 n=5+5)
      New/text=go/size=50M/bits=*-12        1.35MB/s ± 0%  1.51MB/s ± 1%  +12.33%  (p=0.008 n=5+5)
      New/text=zero/size=100K/bits=*-12     3.42MB/s ± 0%  3.32MB/s ± 0%   -2.74%  (p=0.000 n=5+4)
      New/text=zero/size=500K/bits=*-12     3.00MB/s ± 1%  2.97MB/s ± 0%   -1.13%  (p=0.016 n=5+4)
      New/text=zero/size=1M/bits=*-12       2.81MB/s ± 0%  2.78MB/s ± 2%     ~     (p=0.167 n=5+5)
      New/text=zero/size=5M/bits=*-12       2.46MB/s ± 0%  2.53MB/s ± 0%   +3.18%  (p=0.008 n=5+5)
      New/text=zero/size=10M/bits=*-12      2.35MB/s ± 0%  2.42MB/s ± 0%   +2.98%  (p=0.016 n=4+5)
      New/text=zero/size=50M/bits=*-12      2.12MB/s ± 0%  2.18MB/s ± 0%   +3.02%  (p=0.008 n=5+5)
      New/text=rand/size=100K/bits=*-12     6.98MB/s ± 0%  7.22MB/s ± 0%   +3.38%  (p=0.016 n=4+5)
      New/text=rand/size=500K/bits=*-12     5.53MB/s ± 0%  5.64MB/s ± 0%   +1.92%  (p=0.008 n=5+5)
      New/text=rand/size=1M/bits=*-12       4.62MB/s ± 1%  5.06MB/s ± 0%   +9.61%  (p=0.008 n=5+5)
      New/text=rand/size=5M/bits=*-12       3.09MB/s ± 0%  3.43MB/s ± 0%  +10.94%  (p=0.016 n=4+5)
      New/text=rand/size=10M/bits=*-12      2.68MB/s ± 0%  2.95MB/s ± 0%  +10.39%  (p=0.008 n=5+5)
      New/text=rand/size=50M/bits=*-12      1.92MB/s ± 0%  2.06MB/s ± 1%   +7.41%  (p=0.008 n=5+5)
      SaveRestore/bits=*-12                  243MB/s ± 1%   259MB/s ± 0%   +6.68%  (p=0.000 n=9+10)
      
      name                               64-bit alloc/op  32-bit alloc/op  delta
      New/text=opticks/size=100K/bits=*-12    1.62MB ± 0%    0.81MB ± 0%  -50.00%  (p=0.000 n=5+4)
      New/text=opticks/size=500K/bits=*-12    8.07MB ± 0%    4.04MB ± 0%  -49.89%  (p=0.008 n=5+5)
      New/text=go/size=100K/bits=*-12         1.62MB ± 0%    0.81MB ± 0%  -50.00%  (p=0.008 n=5+5)
      New/text=go/size=500K/bits=*-12         8.07MB ± 0%    4.04MB ± 0%  -49.89%  (p=0.029 n=4+4)
      New/text=go/size=1M/bits=*-12           16.1MB ± 0%     8.1MB ± 0%  -49.95%  (p=0.008 n=5+5)
      New/text=go/size=5M/bits=*-12           80.3MB ± 0%    40.2MB ± 0%     ~     (p=0.079 n=4+5)
      New/text=go/size=10M/bits=*-12           160MB ± 0%      80MB ± 0%  -50.00%  (p=0.008 n=5+5)
      New/text=go/size=50M/bits=*-12           805MB ± 0%     402MB ± 0%  -50.06%  (p=0.029 n=4+4)
      New/text=zero/size=100K/bits=*-12       3.02MB ± 0%    1.46MB ± 0%     ~     (p=0.079 n=4+5)
      New/text=zero/size=500K/bits=*-12       19.7MB ± 0%     8.7MB ± 0%  -55.98%  (p=0.008 n=5+5)
      New/text=zero/size=1M/bits=*-12         39.0MB ± 0%    19.7MB ± 0%  -49.60%  (p=0.000 n=5+4)
      New/text=zero/size=5M/bits=*-12          169MB ± 0%      85MB ± 0%  -49.46%  (p=0.029 n=4+4)
      New/text=zero/size=10M/bits=*-12         333MB ± 0%     169MB ± 0%  -49.43%  (p=0.000 n=5+4)
      New/text=zero/size=50M/bits=*-12        1.63GB ± 0%    0.74GB ± 0%  -54.61%  (p=0.008 n=5+5)
      New/text=rand/size=100K/bits=*-12       1.61MB ± 0%    0.81MB ± 0%  -50.00%  (p=0.000 n=5+4)
      New/text=rand/size=500K/bits=*-12       8.07MB ± 0%    4.04MB ± 0%  -49.89%  (p=0.000 n=5+4)
      New/text=rand/size=1M/bits=*-12         16.1MB ± 0%     8.1MB ± 0%  -49.95%  (p=0.029 n=4+4)
      New/text=rand/size=5M/bits=*-12         80.7MB ± 0%    40.3MB ± 0%  -50.06%  (p=0.008 n=5+5)
      New/text=rand/size=10M/bits=*-12         161MB ± 0%      81MB ± 0%  -50.03%  (p=0.008 n=5+5)
      New/text=rand/size=50M/bits=*-12         806MB ± 0%     403MB ± 0%  -50.00%  (p=0.016 n=4+5)
      SaveRestore/bits=*-12                   9.47MB ± 0%    5.28MB ± 0%  -44.29%  (p=0.000 n=9+8)
      
      https://perf.golang.org/search?q=upload:20190126.1+|+bits:64+vs+bits:32
      
      Fixes #6816.
      
      Change-Id: Ied2fbea519a202ecc43719debcd233344ce38847
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174097
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      45be3530