Skip to content

Commit ffed9e5

Browse files
mvdanlu4p
authored andcommitted
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.
1 parent ad99876 commit ffed9e5

9 files changed

+26
-229
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
go install mvdan.cc/garble@latest
44

5-
Obfuscate Go code by wrapping the Go toolchain. Requires Go 1.23.5 or later.
5+
Obfuscate Go code by wrapping the Go toolchain. Requires Go 1.24 or later.
66

77
garble build [build flags] [packages]
88

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module mvdan.cc/garble
22

3-
// Before the .5 bugfix release, alias tracking via go/types
4-
// was broken; see https://go.dev/issue/70517.
5-
go 1.23.5
3+
go 1.24
64

75
require (
86
github.com/bluekeyes/go-gitdiff v0.8.1

go_std_tables.go

Lines changed: 1 addition & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/linker/patches/go1.23/0001-add-custom-magic-value.patch

Lines changed: 0 additions & 47 deletions
This file was deleted.

internal/linker/patches/go1.23/0002-add-unexported-function-name-removing.patch

Lines changed: 0 additions & 85 deletions
This file was deleted.

internal/linker/patches/go1.23/0003-add-entryOff-encryption.patch

Lines changed: 0 additions & 43 deletions
This file was deleted.

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ func (e errJustExit) Error() string { return fmt.Sprintf("exit: %d", e) }
291291

292292
func goVersionOK() bool {
293293
const (
294-
minGoVersion = "go1.23.5" // the minimum Go version we support; could be a bugfix release if needed
295-
unsupportedGo = "go1.25" // the first major version we don't support
294+
minGoVersion = "go1.24" // the minimum Go version we support; could be a bugfix release if needed
295+
unsupportedGo = "go1.25" // the first major version we don't support
296296
)
297297

298298
// rxVersion looks for a version like "go1.2" or "go1.2.3" in `go env GOVERSION`.

scripts/gen_go_std_tables.go

Lines changed: 4 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

testdata/script/goversion.txtar

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@ env PATH=${WORK}/.bin${:}${PATH}
77
# An empty go version.
88
env TOOLCHAIN_GOVERSION=''
99
! exec garble build
10-
stderr 'Go version is too old; please upgrade to go1\.23\.5 or newer'
10+
stderr 'Go version is too old; please upgrade to go1\.24 or newer'
1111

1212
# We should error on a devel version that's too old.
1313
# Note that they lacked the "goN.M-" prefix.
1414
env TOOLCHAIN_GOVERSION='devel +afb5fca Sun Aug 07 00:00:00 2020 +0000'
1515
! exec garble build
16-
stderr 'Go version is too old; please upgrade to go1\.23\.5 or newer'
16+
stderr 'Go version is too old; please upgrade to go1\.24 or newer'
1717

1818
# Another form of old version; with an old "goN.M-" prefix.
1919
env TOOLCHAIN_GOVERSION='devel go1.15-afb5fca Sun Aug 07 00:00:00 2020 +0000'
2020
! exec garble build
21-
stderr 'Go version "devel go1\.15-.*2020.*" is too old; please upgrade to go1\.23'
21+
stderr 'Go version "devel go1\.15-.*2020.*" is too old; please upgrade to go1\.24 or newer'
2222

2323
# A current devel version should be fine.
2424
# Note that we don't look at devel version timestamps.
25-
env GARBLE_TEST_GOVERSION='go1.23.5'
25+
env GARBLE_TEST_GOVERSION='go1.24.5'
2626
# TODO: temporarily disabled while we do not support tip.
27-
# env TOOLCHAIN_GOVERSION='devel go1.23-ad97d204f0 Sun Sep 12 16:46:58 2023 +0000'
27+
# env TOOLCHAIN_GOVERSION='devel go1.24-ad97d204f0 Sun Sep 12 16:46:58 2023 +0000'
2828
# ! exec garble build
2929
# stderr 'mocking the real build'
3030

3131
# We should error on a stable version that's too old.
3232
env TOOLCHAIN_GOVERSION='go1.14'
3333
! exec garble build
34-
stderr 'Go version "go1\.14" is too old; please upgrade to go1\.23\.5 or newer'
34+
stderr 'Go version "go1\.14" is too old; please upgrade to go1\.24 or newer'
3535

3636
# We should reject a future stable version, as we don't have linker patches yet.
3737
# 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'
4141
stderr 'Go version "go1\.28\.2" is too new; Go linker patches aren''t available for go1\.25 or later yet'
4242

4343
# We should accept custom devel strings.
44-
env TOOLCHAIN_GOVERSION='devel go1.23.5-somecustomversion'
44+
env TOOLCHAIN_GOVERSION='devel go1.24.5-somecustomversion'
4545
! exec garble build
4646
stderr 'mocking the real build'
4747

4848
# The current toolchain may be older than the one that built garble.
49-
env GARBLE_TEST_GOVERSION='go1.23.22'
50-
env TOOLCHAIN_GOVERSION='go1.23.21'
49+
env GARBLE_TEST_GOVERSION='go1.24.22'
50+
env TOOLCHAIN_GOVERSION='go1.24.21'
5151
! exec garble build
5252
stderr 'mocking the real build'
5353

5454
# The current toolchain may be equal to the one that built garble.
55-
env GARBLE_TEST_GOVERSION='go1.23.25'
56-
env TOOLCHAIN_GOVERSION='go1.23.25'
55+
env GARBLE_TEST_GOVERSION='go1.24.25'
56+
env TOOLCHAIN_GOVERSION='go1.24.25'
5757
! exec garble build
5858
stderr 'mocking the real build'
5959

6060
# The current toolchain must not be newer than the one that built garble.
6161
env GARBLE_TEST_GOVERSION='go1.18'
62-
env TOOLCHAIN_GOVERSION='go1.23.25'
62+
env TOOLCHAIN_GOVERSION='go1.24.25'
6363
! exec garble build
64-
stderr 'garble was built with "go1\.18" and can''t be used with the newer "go1\.23\.25"; rebuild '
64+
stderr 'garble was built with "go1\.18" and can''t be used with the newer "go1\.24\.25"; rebuild '
6565

6666
# We'll error even if the difference is a minor (bugfix) level.
6767
# In practice it probably wouldn't matter, but in theory it could still lead to tricky bugs.
68-
env GARBLE_TEST_GOVERSION='go1.23.11'
69-
env TOOLCHAIN_GOVERSION='go1.23.14'
68+
env GARBLE_TEST_GOVERSION='go1.24.11'
69+
env TOOLCHAIN_GOVERSION='go1.24.14'
7070
! exec garble build
71-
stderr 'garble was built with "go1\.23\.11" and can''t be used with the newer "go1\.23\.14"; rebuild '
71+
stderr 'garble was built with "go1\.24\.11" and can''t be used with the newer "go1\.24\.14"; rebuild '
7272

7373
# If garble builds itself and is then used, it won't know what version built it.
7474
# As a fallback, we drop the comparison against the toolchain's version.
7575
env GARBLE_TEST_GOVERSION='bogus version'
76-
env TOOLCHAIN_GOVERSION='go1.23.25'
76+
env TOOLCHAIN_GOVERSION='go1.24.25'
7777
! exec garble build
7878
stderr 'mocking the real build'
7979
-- go.mod --

0 commit comments

Comments
 (0)