drop support for Go 1.23

A pretty small patch, given that 1.23 and 1.24 are quite similar
in terms of what garble does.
This commit is contained in:
Daniel Martí
2025-04-13 19:27:48 +01:00
committed by Paul Scheduikat
parent ad998763a2
commit ffed9e5438
9 changed files with 26 additions and 229 deletions

View File

@@ -7,31 +7,31 @@ env PATH=${WORK}/.bin${:}${PATH}
# An empty go version.
env TOOLCHAIN_GOVERSION=''
! exec garble build
stderr 'Go version is too old; please upgrade to go1\.23\.5 or newer'
stderr 'Go version is too old; please upgrade to go1\.24 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'
! exec garble build
stderr 'Go version is too old; please upgrade to go1\.23\.5 or newer'
stderr 'Go version is too old; please upgrade to go1\.24 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'
! exec garble build
stderr 'Go version "devel go1\.15-.*2020.*" is too old; please upgrade to go1\.23'
stderr 'Go version "devel go1\.15-.*2020.*" is too old; please upgrade to go1\.24 or newer'
# A current devel version should be fine.
# Note that we don't look at devel version timestamps.
env GARBLE_TEST_GOVERSION='go1.23.5'
env GARBLE_TEST_GOVERSION='go1.24.5'
# TODO: temporarily disabled while we do not support tip.
# env TOOLCHAIN_GOVERSION='devel go1.23-ad97d204f0 Sun Sep 12 16:46:58 2023 +0000'
# env TOOLCHAIN_GOVERSION='devel go1.24-ad97d204f0 Sun Sep 12 16:46:58 2023 +0000'
# ! exec garble build
# stderr 'mocking the real build'
# We should error on a stable version that's too old.
env TOOLCHAIN_GOVERSION='go1.14'
! exec garble build
stderr 'Go version "go1\.14" is too old; please upgrade to go1\.23\.5 or newer'
stderr 'Go version "go1\.14" is too old; please upgrade to go1\.24 or newer'
# We should reject a future stable version, as we don't have linker patches yet.
# Note that we need to bump the version of Go that supposedly built it, too.
@@ -41,39 +41,39 @@ env TOOLCHAIN_GOVERSION='go1.28.2'
stderr 'Go version "go1\.28\.2" is too new; Go linker patches aren''t available for go1\.25 or later yet'
# We should accept custom devel strings.
env TOOLCHAIN_GOVERSION='devel go1.23.5-somecustomversion'
env TOOLCHAIN_GOVERSION='devel go1.24.5-somecustomversion'
! exec garble build
stderr 'mocking the real build'
# The current toolchain may be older than the one that built garble.
env GARBLE_TEST_GOVERSION='go1.23.22'
env TOOLCHAIN_GOVERSION='go1.23.21'
env GARBLE_TEST_GOVERSION='go1.24.22'
env TOOLCHAIN_GOVERSION='go1.24.21'
! exec garble build
stderr 'mocking the real build'
# The current toolchain may be equal to the one that built garble.
env GARBLE_TEST_GOVERSION='go1.23.25'
env TOOLCHAIN_GOVERSION='go1.23.25'
env GARBLE_TEST_GOVERSION='go1.24.25'
env TOOLCHAIN_GOVERSION='go1.24.25'
! exec garble build
stderr 'mocking the real build'
# The current toolchain must not be newer than the one that built garble.
env GARBLE_TEST_GOVERSION='go1.18'
env TOOLCHAIN_GOVERSION='go1.23.25'
env TOOLCHAIN_GOVERSION='go1.24.25'
! exec garble build
stderr 'garble was built with "go1\.18" and can''t be used with the newer "go1\.23\.25"; rebuild '
stderr 'garble was built with "go1\.18" and can''t be used with the newer "go1\.24\.25"; rebuild '
# 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.23.11'
env TOOLCHAIN_GOVERSION='go1.23.14'
env GARBLE_TEST_GOVERSION='go1.24.11'
env TOOLCHAIN_GOVERSION='go1.24.14'
! exec garble build
stderr 'garble was built with "go1\.23\.11" and can''t be used with the newer "go1\.23\.14"; rebuild '
stderr 'garble was built with "go1\.24\.11" and can''t be used with the newer "go1\.24\.14"; rebuild '
# 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.23.25'
env TOOLCHAIN_GOVERSION='go1.24.25'
! exec garble build
stderr 'mocking the real build'
-- go.mod --