|
|
@ -7,30 +7,30 @@ env PATH=${WORK}/.bin${:}${PATH}
|
|
|
|
# An empty go version.
|
|
|
|
# An empty go version.
|
|
|
|
env TOOLCHAIN_GOVERSION=''
|
|
|
|
env TOOLCHAIN_GOVERSION=''
|
|
|
|
! garble build
|
|
|
|
! 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.
|
|
|
|
# We should error on a devel version that's too old.
|
|
|
|
# Note that they lacked the "goN.M-" prefix.
|
|
|
|
# Note that they lacked the "goN.M-" prefix.
|
|
|
|
env TOOLCHAIN_GOVERSION='devel +afb5fca Sun Aug 07 00:00:00 2020 +0000'
|
|
|
|
env TOOLCHAIN_GOVERSION='devel +afb5fca Sun Aug 07 00:00:00 2020 +0000'
|
|
|
|
! garble build
|
|
|
|
! 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.
|
|
|
|
# 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'
|
|
|
|
env TOOLCHAIN_GOVERSION='devel go1.15-afb5fca Sun Aug 07 00:00:00 2020 +0000'
|
|
|
|
! garble build
|
|
|
|
! 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.
|
|
|
|
# A current devel version should be fine.
|
|
|
|
# Note that we don't look at devel version timestamps.
|
|
|
|
# Note that we don't look at devel version timestamps.
|
|
|
|
env GARBLE_TEST_GOVERSION='go1.18'
|
|
|
|
env GARBLE_TEST_GOVERSION='go1.20'
|
|
|
|
env TOOLCHAIN_GOVERSION='devel go1.18-ad97d204f0 Sun Sep 12 16:46:58 2021 +0000'
|
|
|
|
env TOOLCHAIN_GOVERSION='devel go1.20-ad97d204f0 Sun Sep 12 16:46:58 2021 +0000'
|
|
|
|
! garble build
|
|
|
|
! garble build
|
|
|
|
stderr 'mocking the real build'
|
|
|
|
stderr 'mocking the real build'
|
|
|
|
|
|
|
|
|
|
|
|
# We should error on a stable version that's too old.
|
|
|
|
# We should error on a stable version that's too old.
|
|
|
|
env TOOLCHAIN_GOVERSION='go1.14'
|
|
|
|
env TOOLCHAIN_GOVERSION='go1.14'
|
|
|
|
! garble build
|
|
|
|
! 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.
|
|
|
|
# We should accept a future stable version.
|
|
|
|
# Note that we need to bump the version of Go that supposedly built it, too.
|
|
|
|
# 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'
|
|
|
|
stderr 'mocking the real build'
|
|
|
|
|
|
|
|
|
|
|
|
# We should accept custom devel strings.
|
|
|
|
# We should accept custom devel strings.
|
|
|
|
env TOOLCHAIN_GOVERSION='devel go1.18-somecustomversion'
|
|
|
|
env TOOLCHAIN_GOVERSION='devel go1.20-somecustomversion'
|
|
|
|
! garble build
|
|
|
|
! garble build
|
|
|
|
stderr 'mocking the real build'
|
|
|
|
stderr 'mocking the real build'
|
|
|
|
|
|
|
|
|
|
|
|
# The current toolchain may be older than the one that built garble.
|
|
|
|
# The current toolchain may be older than the one that built garble.
|
|
|
|
env GARBLE_TEST_GOVERSION='go1.19'
|
|
|
|
env GARBLE_TEST_GOVERSION='go1.20'
|
|
|
|
env TOOLCHAIN_GOVERSION='go1.18.3'
|
|
|
|
env TOOLCHAIN_GOVERSION='go1.19.3'
|
|
|
|
! garble build
|
|
|
|
! garble build
|
|
|
|
stderr 'mocking the real 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.
|
|
|
|
# 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.
|
|
|
|
# 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 GARBLE_TEST_GOVERSION='go1.19.11'
|
|
|
|
env TOOLCHAIN_GOVERSION='go1.18.14'
|
|
|
|
env TOOLCHAIN_GOVERSION='go1.19.14'
|
|
|
|
! garble build
|
|
|
|
! 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.
|
|
|
|
# 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.
|
|
|
|
# As a fallback, we drop the comparison against the toolchain's version.
|
|
|
|
env GARBLE_TEST_GOVERSION='bogus version'
|
|
|
|
env GARBLE_TEST_GOVERSION='bogus version'
|
|
|
|
env TOOLCHAIN_GOVERSION='go1.18.3'
|
|
|
|
env TOOLCHAIN_GOVERSION='go1.19.3'
|
|
|
|
! garble build
|
|
|
|
! garble build
|
|
|
|
stderr 'mocking the real build'
|
|
|
|
stderr 'mocking the real build'
|
|
|
|
|
|
|
|
|
|
|
|
-- go.mod --
|
|
|
|
-- go.mod --
|
|
|
|
module test/main
|
|
|
|
module test/main
|
|
|
|
|
|
|
|
|
|
|
|
go 1.18
|
|
|
|
go 1.19
|
|
|
|
-- main.go --
|
|
|
|
-- main.go --
|
|
|
|
package main
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
|
|