drop support for Go 1.18.x

With Go 1.19 having been out for two months,
and Go 1.20's first beta coming out in two months,
it is now time to move forward again.
pull/591/head
Daniel Martí 2 years ago
parent 5d926a8011
commit 58b2d64784

@ -22,7 +22,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.18.x, 1.19.x]
go-version: [1.19.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:

@ -1,6 +1,6 @@
module mvdan.cc/garble
go 1.18
go 1.19
require (
github.com/frankban/quicktest v1.14.3

@ -253,8 +253,8 @@ var toolchainVersionSemver string
func goVersionOK() bool {
const (
minGoVersionSemver = "v1.18.0"
suggestedGoVersion = "1.18.x"
minGoVersionSemver = "v1.19.0"
suggestedGoVersion = "1.19.x"
)
// rxVersion looks for a version like "go1.2" or "go1.2.3"

@ -28,11 +28,10 @@ go build
exec ./main
cmp stderr main.stderr
binsubstr main$exe 'privateAdd' 'PublicAdd'
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -56,11 +56,10 @@ cmp stderr main.stderr
# Only check $WORK on non-windows, because it's difficult to do it there.
binsubstr main$exe 'garble_main.go' 'globalVar' 'globalFunc' $gofullversion
[!windows] binsubstr main$exe ${WORK}
-- go.mod --
module test/mainfoo
go 1.18
go 1.19
-- garble_main.go --
package main

@ -34,11 +34,10 @@ go build
exec ./main
cmp stdout main.stdout
binsubstr main$exe 'privateAdd'
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -11,11 +11,10 @@
# A fairly average Go build, importing some std libraries.
env GOGARBLE='*'
garble build
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -14,11 +14,10 @@ cp $WORK/debug1/test/main/main.go $WORK/debug1/some_file_from_prev_build.go
garble -debugdir ./debug1 build -v
stderr 'test/main' # we force rebuilds with -debugdir
! exists $WORK/debug1/some_file_from_prev_build.go
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -10,12 +10,10 @@ cmp stdout main.stdout
go build
exec ./main
cmp stdout main.stdout
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -43,11 +43,10 @@ exec $NAME/garble$exe build
[!windows] sleep $CP_EXEC_SLEEP
[!windows] ! exec $NAME/garble$exe build
[!windows] stderr 'cannot be quoted'
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -46,11 +46,10 @@ env GOCACHE=${WORK}/gocache-empty
garble build -a runtime
garble build -o=out_rebuild ./stdimporter
bincmp out_rebuild out
-- go.mod --
module test/main
go 1.18
go 1.19
-- standalone/main.go --
package main

@ -7,30 +7,30 @@ env PATH=${WORK}/.bin${:}${PATH}
# An empty go version.
env TOOLCHAIN_GOVERSION=''
! garble build
stderr 'Go version is too old; please upgrade to Go 1\.18\.x or newer'
stderr 'Go version is too old; please upgrade to Go 1\.19\.x or newer'
# We should error on a devel version that's too old.
# Note that they lacked the "goN.M-" prefix.
env TOOLCHAIN_GOVERSION='devel +afb5fca Sun Aug 07 00:00:00 2020 +0000'
! garble build
stderr 'Go version is too old; please upgrade to Go 1\.18\.x or newer'
stderr 'Go version is too old; please upgrade to Go 1\.19\.x or newer'
# Another form of old version; with an old "goN.M-" prefix.
env TOOLCHAIN_GOVERSION='devel go1.15-afb5fca Sun Aug 07 00:00:00 2020 +0000'
! garble build
stderr 'Go version "devel go1\.15-.*2020.*" is too old; please upgrade to Go 1\.18\.x'
stderr 'Go version "devel go1\.15-.*2020.*" is too old; please upgrade to Go 1\.19\.x'
# A current devel version should be fine.
# Note that we don't look at devel version timestamps.
env GARBLE_TEST_GOVERSION='go1.18'
env TOOLCHAIN_GOVERSION='devel go1.18-ad97d204f0 Sun Sep 12 16:46:58 2021 +0000'
env GARBLE_TEST_GOVERSION='go1.20'
env TOOLCHAIN_GOVERSION='devel go1.20-ad97d204f0 Sun Sep 12 16:46:58 2021 +0000'
! garble build
stderr 'mocking the real build'
# We should error on a stable version that's too old.
env TOOLCHAIN_GOVERSION='go1.14'
! garble build
stderr 'Go version "go1\.14" is too old; please upgrade to Go 1\.18\.x or newer'
stderr 'Go version "go1\.14" is too old; please upgrade to Go 1\.19\.x or newer'
# We should accept a future stable version.
# Note that we need to bump the version of Go that supposedly built it, too.
@ -40,13 +40,13 @@ env TOOLCHAIN_GOVERSION='go1.28.2'
stderr 'mocking the real build'
# We should accept custom devel strings.
env TOOLCHAIN_GOVERSION='devel go1.18-somecustomversion'
env TOOLCHAIN_GOVERSION='devel go1.20-somecustomversion'
! garble build
stderr 'mocking the real build'
# The current toolchain may be older than the one that built garble.
env GARBLE_TEST_GOVERSION='go1.19'
env TOOLCHAIN_GOVERSION='go1.18.3'
env GARBLE_TEST_GOVERSION='go1.20'
env TOOLCHAIN_GOVERSION='go1.19.3'
! garble build
stderr 'mocking the real build'
@ -64,22 +64,21 @@ stderr 'garble was built with "go1\.18" and is being used with "go1\.19\.1"; ple
# We'll error even if the difference is a minor (bugfix) level.
# In practice it probably wouldn't matter, but in theory it could still lead to tricky bugs.
env GARBLE_TEST_GOVERSION='go1.18.11'
env TOOLCHAIN_GOVERSION='go1.18.14'
env GARBLE_TEST_GOVERSION='go1.19.11'
env TOOLCHAIN_GOVERSION='go1.19.14'
! garble build
stderr 'garble was built with "go1\.18\.11" and is being used with "go1\.18\.14"; please rebuild garble with the newer version'
stderr 'garble was built with "go1\.19\.11" and is being used with "go1\.19\.14"; please rebuild garble with the newer version'
# If garble builds itself and is then used, it won't know what version built it.
# As a fallback, we drop the comparison against the toolchain's version.
env GARBLE_TEST_GOVERSION='bogus version'
env TOOLCHAIN_GOVERSION='go1.18.3'
env TOOLCHAIN_GOVERSION='go1.19.3'
! garble build
stderr 'mocking the real build'
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -118,5 +118,7 @@ stderr 'usage: garble version'
# We need a dummy module for "garble build -badflag".
-- go.mod --
module dummy
go 1.19
-- dummy.go --
package dummy

@ -12,11 +12,10 @@ cmp stdout main.stdout
go build
exec ./main
cmp stdout main.stdout
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -41,11 +41,10 @@ cmp stdout main.stdout
garble -literals build --tags=buildtag
exec ./main
cmp stdout main.stdout
-- go.mod --
module test/main
go 1.18
go 1.19
require (
gopkg.in/garbletest.v2 v2.999.0

@ -9,11 +9,10 @@ cmp stderr main.stderr
go build
exec ./main
cmp stderr main.stderr
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -27,11 +27,10 @@ go build -ldflags=${LDFLAGS}
exec ./main
cmp stdout main.stdout
binsubstr main$exe 'unexportedVersion' 'ExportedUnset' 'v1.22.33' 'garble_replaced'
-- go.mod --
module domain.test/main
go 1.18
go 1.19
-- main.go --
package main

@ -11,18 +11,14 @@ cmp stderr main.stderr
go build
exec ./main
cmp stderr main.stderr
-- go.mod --
module test/main
go 1.18
go 1.19
replace big.chungus/meme => ./big.chungus/meme
require (
big.chungus/meme v0.0.0
)
require big.chungus/meme v0.0.0
-- a.go --
package main
@ -99,8 +95,7 @@ func ByteIndex(s string, c byte) int
-- big.chungus/meme/go.mod --
module test/main
go 1.18
go 1.19
-- big.chungus/meme/dante.go --
package meme

@ -54,11 +54,10 @@ grep '^\s+\w+ = .*\bappend\(\w+,(\s+\w+\[\d+\][\^\-+]\w+\[\d+\],?)+\)$' debug1/t
# Analogous to gogarble.txt.
env GOGARBLE='*'
garble -literals build std
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -25,11 +25,10 @@ stdout 'path\s*test/main'
stdout 'mod\s*test/main\s*\(devel\)'
stdout 'build\s*-tags=veryuniquebuildtag'
stdout 'build\s*vcs.revision='${HEAD_COMMIT_SHA}
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -25,11 +25,10 @@ binsubstr plugin.so 'PublicVar' 'PublicFunc' 'privateFunc'
go build
exec ./main
cmp stderr main.stderr
-- go.mod --
module test/main
go 1.18
go 1.19
-- plugin/main.go --
package main

@ -15,11 +15,10 @@ stdout 'garble_other_filename'
stdout ':19: main'
stdout 'initPositions is sorted'
stdout 'varPositions is sorted'
-- go.mod --
module test/main
go 1.18
go 1.19
-- garble_main.go --
package main

@ -13,11 +13,10 @@ binsubstr main$exe 'ReflectInDefined' 'ExportedField2' 'unexportedField2' 'Indir
go build
exec ./main
cmp stdout main.stdout
-- go.mod --
module test/main
go 1.18
go 1.19
-- garble_main.go --
package main

@ -52,11 +52,10 @@ cmp stdout reverse.stdout
stdin main-literals.stderr
! garble reverse .
cmp stdout main-literals.stderr
-- go.mod --
module test/main
go 1.18
go 1.19
-- long_main.go --
package main

@ -30,11 +30,10 @@ cp stdout ../buildid-mod2
cd ..
! bincmp buildid-mod1 buildid-mod2
-- mod1/go.mod --
module test/main/mod1
go 1.18
go 1.19
require gopkg.in/garbletest.v2 v2.999.0
@ -54,7 +53,7 @@ func main() { garbletest.Test() }
-- mod2/go.mod --
module test/main/mod2
go 1.18
go 1.19
require gopkg.in/garbletest.v2 v2.999.0

@ -95,11 +95,10 @@ exec ./main$exe test/main
cmp stderr mainpkg.stderr
exec ./main$exe test/main/imported
cmp stderr importedpkg.stderr
-- go.mod --
module test/main
go 1.18
go 1.19
-- main.go --
package main

@ -15,11 +15,10 @@ cmp stderr main.stderr
binsubstr main$exe 'globalVar' # 'globalType' matches on some, but not all, platforms
! binsubstr main$exe 'localName' 'globalConst' 'remoteIntReturn' 'intReturn'
-- extra/go.mod --
module private.source/extra
go 1.18
go 1.19
-- extra/extra.go --
package extra
@ -29,7 +28,7 @@ func Func() string {
-- go.mod --
module test/main
go 1.18
go 1.19
// We include an extra module to obfuscate, included in the same original source
// code via a replace directive.

@ -47,11 +47,10 @@ stdout 'PASS.*TestFoo'
stdout 'PASS.*TestSeparateFoo'
stdout 'package bar, func name: test/bar\.OriginalFuncName'
stdout 'package bar_test, func name: test/bar\.OriginalFuncName'
-- go.mod --
module test/bar
go 1.18
go 1.19
-- bar.go --
package bar

@ -23,11 +23,10 @@ garble build
stderr '^caller: [0-9a-zA-Z_]+\.go [1-9]'
stderr '^recovered: ya like jazz?'
stderr 'panic: oh noes'
-- go.mod --
module test/main
go 1.18
go 1.19
-- garble_main.go --
package main

@ -2,12 +2,10 @@ env GOGARBLE=*
garble build
! binsubstr main$exe ${WORK} 'garble_main.go' 'GenericFunc' 'GenericVector' 'PredeclaredSignedInteger' 'StringableSignedInteger' 'CombineEmbeds' 'GenericParam'
-- go.mod --
module test/main
go 1.18
go 1.19
-- garble_main.go --
package main

Loading…
Cancel
Save