1. 19 Jul, 2018 15 commits
    • Russ Cox's avatar
      cmd/go/internal/modfetch: move to new pseudo-version design · 9430c1a6
      Russ Cox authored
      The original pseudo-version design used versions of the form
      
      	v0.0.0-yyyymmddhhmmss-abcdef123456
      
      These were intentionally chosen to be valid semantic versions
      that sort below any explicitly-chosen semantic version (even v0.0.0),
      so that they could be used before anything was tagged but after
      that would essentially only be useful in replace statements
      (because the max operation during MVS would always prefer
      a tagged version).
      
      Then we changed the go command to accept hashes on the
      command line, so that you can say
      
      	go get github.com/my/proj@abcdef
      
      and it will download and use v0.0.0-yyyymmddhhmmss-abcdef123456.
      
      If you were using v1.10.1 before and this commit is just little bit
      newer than that commit, calling it v0.0.0-xxx is confusing but
      also harmful: the go command sees the change from v1.10.1 to
      the v0.0.0 pseudoversion as a downgrade, and it downgrades other
      modules in the build. In particular if some other module has
      a requirement of github.com/my/proj v1.9.0 (or later), the
      pseudo-version appears to be before that, so go get would
      downgrade that module too. It might even remove it entirely,
      if every available version needs a post-v0.0.0 version of my/proj.
      
      This CL introduces new pseudo-version forms that can be used
      to slot in after the most recent explicit tag before the commit.
      If the most recent tagged commit before abcdef is v1.10.1,
      then now we will use
      
      	v1.10.2-0.yyyymmddhhmmss-abcdef123456
      
      This has the right properties for downgrades and the like,
      since it is after v1.10.1 but before almost any possible
      successor, such as v1.10.2, v1.10.2-1, or v1.10.2-pre.
      
      This CL also uses those pseudo-version forms as appropriate
      when mapping a hash to a pseudo-version. This fixes the
      downgrade problem.
      
      Overall, this CL reflects our growing recognition of pseudo-versions
      as being like "untagged prereleases".
      
      Issue #26150 was about documenting best practices for how
      to work around this kind of accidental downgrade problem
      with additional steps. Now there are no additional steps:
      the problem is avoided by default.
      
      Fixes #26150.
      
      Change-Id: I402feeccb93e8e937bafcaa26402d88572e9b14c
      Reviewed-on: https://go-review.googlesource.com/124515Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      9430c1a6
    • Russ Cox's avatar
      cmd/go/internal/module: add new +incompatible version build annotation · 472e9260
      Russ Cox authored
      Repos written before the introduction of semantic import versioning
      introduced tags like v2.0.0, v3.0.0, and so on, expecting that
      (1) the import path would remain unchanged, and perhaps also
      (2) there would be at most one copy of the package in a build.
      
      We've always accommodated these by mapping them into the
      v0/v1 version range, so that if you ran
      
          go get k8s.io/client-go@v8.0.0
      
      it would not complain about v8.x.x being a non-v1 version and
      instead would map that version to a pseudo-version in go.mod:
      
          require k8s.io/client-go v0.0.0-20180628043050-7d04d0e2a0a1
      
      The pseudo-version fails to capture two important facts: first,
      that this really is the v8.0.0 tag, and second, that it should be
      preferred over any earlier v1 tags.
      
      A related problem is that running "go get k8s.io/client-go"
      with no version will choose the latest v1 tag (v1.5.1), which
      is obsolete.
      
      This CL introduces a new version suffix +incompatible that
      indicates that the tag should be considered an (incompatible)
      extension of the v1 version sequence instead of part of its
      own major version with its own versioned module path.
      The requirement above can now be written:
      
          require k8s.io/client-go v8.0.0+incompatible
      
      (The +metadata suffix is a standard part of semantic versioning,
      and that suffix is ignored when comparing two versions for
      precedence or equality. As part of canonicalizing versions
      recorded in go.mod, the go command has always stripped all
      such suffixes. It still strips nearly all: only +incompatible is
      preserved now.)
      
      In addition to recognizing the +incompatible, the code that
      maps a commit hash to a version will use that form when
      appropriate, so that
      
          go get k8s.io/client-go@7d04d0
      
      will choose k8s.io/client-go@v8.0.0+incompatible.
      
      Also, the code that computes the list of available versions from
      a given source code repository also maps old tags to +incompatible
      versions, for any tagged commit in which a go.mod file does not exist.
      Therefore
      
          go list -m -versions k8s.io/client-go@latest
      
      will show
      
          k8s.io/client-go v1.4.0 v1.5.0 v1.5.1 v2.0.0-alpha.0+incompatible ... v8.0.0+incompatible
      
      and similarly
      
          go get k8s.io/client-go
      
      will now choose v8.0.0+incompatible as the meaning of "latest tagged version".
      
      The extraction of +incompatible versions from source code repos
      depends on a codehost.Repo method ReadFileRevs, to do a bulk read
      of multiple revisions of a file. That method is only implemented for git in this CL.
      Future CLs will need to add support for that method to the other repository
      implementations.
      
      Documentation for this change is in CL 124515.
      
      Fixes #26238.
      
      Change-Id: I5bb1d7a46b5fffde34a3c0e6f8d19d9608188cea
      Reviewed-on: https://go-review.googlesource.com/124384
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      472e9260
    • Russ Cox's avatar
      cmd/go: preserve %SYSTEMROOT% in TestScript on Windows · d3ca4c88
      Russ Cox authored
      Windows networking doesn't work without this environment variable (#25210).
      
      Re-enable TestScript on Windows, and fix two minor failures.
      
      Fixes #26457.
      
      Change-Id: Id9bea49dfb58403195c29c3d831a532ef0f9a233
      Reviewed-on: https://go-review.googlesource.com/124858
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      d3ca4c88
    • Austin Clements's avatar
      runtime: don't create heap hints outside TSAN's supported heap · 2d4c1ff7
      Austin Clements authored
      TSAN for Go only supports heap address in the range [0x00c000000000,
      0x00e000000000). However, we currently create heap hints of the form
      0xXXc000000000 for XX between 0x00 and 0x7f. Even for XX=0x01, this
      hint is outside TSAN's supported heap address range.
      
      Fix this by creating a slightly different set of hints in race mode,
      all of which fall inside TSAN's heap address range.
      
      This should fix TestArenaCollision flakes. That test forces the
      runtime to use later heap hints. Currently, this always results in
      TSAN "failed to allocate" failures on Windows (which happens to have a
      slightly more constrained TSAN layout than non-Windows). Most of the
      time we don't notice these failures, but sometimes it crashes TSAN,
      leading to a test failure.
      
      Fixes #25698.
      
      Change-Id: I8926cd61f0ee5ee00efa77b283f7b809c555be46
      Reviewed-on: https://go-review.googlesource.com/123780
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      2d4c1ff7
    • Keith Randall's avatar
      cmd/compile: add test for OPmodify ops clobbering flags · 59d0baeb
      Keith Randall authored
      Code fix was in CL 122556.  This is a corresponding test case.
      
      Fixes #26426
      
      Change-Id: Ib8769f367aed8bead029da0a8d2ddccee1d1dccb
      Reviewed-on: https://go-review.googlesource.com/124535
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      59d0baeb
    • Daniel Martí's avatar
      doc: remove paragraph about text/template/parse · f3582de3
      Daniel Martí authored
      The backwards incompatible changes were undone in CL 120355, while still
      preserving the additions needed for assignments in templates to work.
      
      Change-Id: Ie76a798916ef36509c88e171a04bb2cf2a3d7e8e
      Reviewed-on: https://go-review.googlesource.com/124917Reviewed-by: default avatarAndrew Bonventre <andybons@golang.org>
      f3582de3
    • David Chase's avatar
      cmd/compile: avoid compressed dwarf when testing for gdb on OSX · 2fe2aa09
      David Chase authored
      Until we figure out how to deal with gdb on Darwin (doesn't
      read compressed DWARF from binaries), avoid compressing
      DWARF in that case so that the test will still yield meaningful
      results.
      
      This is also reported to be a problem for Windows.
      
      Problem also exists for lldb, but this test doesn't check
      lldb.
      
      Updates #25925
      
      Change-Id: I85c0e5db75f3329957290500626a3ac7f078f608
      Reviewed-on: https://go-review.googlesource.com/124712
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarHeschi Kreinick <heschi@google.com>
      2fe2aa09
    • Russ Cox's avatar
      cmd/go: skip TestScript/mod_* on Windows · d278f093
      Russ Cox authored
      I don't know why it's failing.
      Filed #26457.
      
      Change-Id: I84833293a572c5a1a25135bd01cb88518fc7441e
      Reviewed-on: https://go-review.googlesource.com/124857
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      d278f093
    • Russ Cox's avatar
      cmd/go/internal/str: simplify HasPathPrefix by epsilon · eec9a895
      Russ Cox authored
      Pointed out in CL 122396.
      An empty prefix has already been handled above.
      
      Change-Id: Ib94df0a9c8c0517f932b90126232111caa9ad289
      Reviewed-on: https://go-review.googlesource.com/124797Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      eec9a895
    • Russ Cox's avatar
      cmd/go: convert still more module tests to scripts · 6140829e
      Russ Cox authored
      Change-Id: I249bb848c9911948dbd84cd88ad043a61ed6ea6b
      Reviewed-on: https://go-review.googlesource.com/124699Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      6140829e
    • Russ Cox's avatar
      cmd/go: convert even more module tests to scripts · e3f15e3b
      Russ Cox authored
      Change-Id: Iba185e00e9df2462e9089566053f6c64e24a6a92
      Reviewed-on: https://go-review.googlesource.com/124698Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      e3f15e3b
    • Russ Cox's avatar
      cmd/go: convert more module tests to scripts · 4d5bf3cc
      Russ Cox authored
      Change-Id: I8a36fad061bdf9a19f40531511f3f5717db13b60
      Reviewed-on: https://go-review.googlesource.com/124697
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      4d5bf3cc
    • Russ Cox's avatar
      cmd/go: convert module tests to scripts · d286d4b1
      Russ Cox authored
      Change-Id: If0976d15027db795f1383ef709c49c838cbb6953
      Reviewed-on: https://go-review.googlesource.com/124696
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      d286d4b1
    • Brad Fitzpatrick's avatar
      net/http: deflake TestClientTimeoutKillsConn_AfterHeaders · c54bc344
      Brad Fitzpatrick authored
      It was flaky on slower machines.
      
      Per report at https://github.com/golang/go/issues/23399#issuecomment-405792381
      
      Change-Id: I7cab02821f78b5ce02ea51089d7eb51723f9705f
      Reviewed-on: https://go-review.googlesource.com/124835
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      c54bc344
    • Rob Pike's avatar
      doc: update the Origins section of the FAQ · 3bb4be79
      Rob Pike authored
      Completely replace the opener, which had become not only stale
      but bad, expand the discussion of the gopher, and generally provide
      prose more connected to the present than to the programming world
      of 2007.
      
      Fixes #26107
      
      Change-Id: I5e72f0c81e71d1237fe142dc26114991329a6996
      Reviewed-on: https://go-review.googlesource.com/124616Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      3bb4be79
  2. 18 Jul, 2018 25 commits