• 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: 's avatarBryan C. Mills <bcmills@google.com>
    9430c1a6
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
cmd Loading commit data...
compress Loading commit data...
container Loading commit data...
context Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
internal Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
os Loading commit data...
path Loading commit data...
plugin Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
vendor/golang_org/x Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
all.rc Loading commit data...
androidtest.bash Loading commit data...
bootstrap.bash Loading commit data...
buildall.bash Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
clean.rc Loading commit data...
cmp.bash Loading commit data...
iostest.bash Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
make.rc Loading commit data...
naclmake.bash Loading commit data...
nacltest.bash Loading commit data...
race.bash Loading commit data...
race.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
run.rc Loading commit data...