diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7ef6c58..5005195 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: test: strategy: matrix: - go-version: [1.21.x, 1.22.x] + go-version: [1.22.x] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: diff --git a/go.mod b/go.mod index 20af11e..ff8ddd7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module mvdan.cc/garble -go 1.21 +go 1.22 require ( github.com/bluekeyes/go-gitdiff v0.7.1 diff --git a/go_std_tables.go b/go_std_tables.go index 6d6fc7b..cacd5d3 100644 --- a/go_std_tables.go +++ b/go_std_tables.go @@ -1,6 +1,6 @@ // Code generated by scripts/gen-go-std-tables.sh; DO NOT EDIT. -// Generated from Go version devel go1.23-1400b26852 Thu Feb 8 03:02:00 2024 +0000. +// Generated from Go version go1.22.0. package main @@ -54,8 +54,8 @@ var runtimeLinknamed = []string{ "syscall", "syscall/js", "time", - // Existed in Go 1.21; removed in Go 1.22. - "math/rand", + // The net package linknames to the runtime, not the other way around. + // TODO: support this automatically via our script. "net", } @@ -72,7 +72,6 @@ var compilerIntrinsicsPkgs = map[string]bool{ } var compilerIntrinsicsFuncs = map[string]bool{ - "runtime.mulUintptr": true, // Existed in Go 1.21; removed in Go 1.22. "math.Abs": true, "math/big.mulWW": true, "math/bits.Add": true, diff --git a/internal/linker/patches/go1.21/0001-add-custom-magic-value.patch b/internal/linker/patches/go1.21/0001-add-custom-magic-value.patch deleted file mode 100644 index 394399a..0000000 --- a/internal/linker/patches/go1.21/0001-add-custom-magic-value.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 62c7b9ef34098c1feddb18502331068277479875 Mon Sep 17 00:00:00 2001 -From: pagran -Date: Mon, 9 Jan 2023 13:30:00 +0100 -Subject: [PATCH 1/3] add custom magic value - ---- - cmd/link/internal/ld/pcln.go | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/cmd/link/internal/ld/pcln.go b/cmd/link/internal/ld/pcln.go -index aaf8ddef51..e93532e510 100644 ---- a/cmd/link/internal/ld/pcln.go -+++ b/cmd/link/internal/ld/pcln.go -@@ -249,6 +249,19 @@ func (state *pclntab) generatePCHeader(ctxt *Link) { - if off != size { - panic(fmt.Sprintf("pcHeader size: %d != %d", off, size)) - } -+ -+ // Use garble prefix in variable names to minimize collision risk -+ garbleMagicStr := os.Getenv("GARBLE_LINK_MAGIC") -+ if garbleMagicStr == "" { -+ panic("[garble] magic value must be set") -+ } -+ var garbleMagicVal uint32 -+ // Use fmt package instead of strconv to avoid importing a new package -+ if _, err := fmt.Sscan(garbleMagicStr, &garbleMagicVal); err != nil { -+ panic(fmt.Errorf("[garble] invalid magic value %s: %v", garbleMagicStr, err)) -+ } -+ -+ header.SetUint32(ctxt.Arch, 0, garbleMagicVal) - } - - state.pcheader = state.addGeneratedSym(ctxt, "runtime.pcheader", size, writeHeader) --- -2.40.1 - diff --git a/internal/linker/patches/go1.21/0002-add-unexported-function-name-removing.patch b/internal/linker/patches/go1.21/0002-add-unexported-function-name-removing.patch deleted file mode 100644 index 4a16520..0000000 --- a/internal/linker/patches/go1.21/0002-add-unexported-function-name-removing.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 1e3895a863cb122b8262b5bf51a2984998f0fd3e Mon Sep 17 00:00:00 2001 -From: pagran -Date: Mon, 9 Jan 2023 13:30:36 +0100 -Subject: [PATCH 2/3] add unexported function name removing - ---- - cmd/link/internal/ld/pcln.go | 44 +++++++++++++++++++++++++++++++++++- - 1 file changed, 43 insertions(+), 1 deletion(-) - -diff --git a/cmd/link/internal/ld/pcln.go b/cmd/link/internal/ld/pcln.go -index e93532e510..8b670135de 100644 ---- a/cmd/link/internal/ld/pcln.go -+++ b/cmd/link/internal/ld/pcln.go -@@ -4,6 +4,11 @@ - - package ld - -+import ( -+ "strings" -+ "unicode" -+) -+ - import ( - "cmd/internal/goobj" - "cmd/internal/objabi" -@@ -301,19 +306,56 @@ func walkFuncs(ctxt *Link, funcs []loader.Sym, f func(loader.Sym)) { - func (state *pclntab) generateFuncnametab(ctxt *Link, funcs []loader.Sym) map[loader.Sym]uint32 { - nameOffsets := make(map[loader.Sym]uint32, state.nfunc) - -+ garbleTiny := os.Getenv("GARBLE_LINK_TINY") == "true" -+ - // Write the null terminated strings. - writeFuncNameTab := func(ctxt *Link, s loader.Sym) { - symtab := ctxt.loader.MakeSymbolUpdater(s) -+ if garbleTiny { -+ symtab.AddStringAt(0, "") -+ } -+ - for s, off := range nameOffsets { -+ if garbleTiny && off == 0 { -+ continue -+ } - symtab.AddCStringAt(int64(off), ctxt.loader.SymName(s)) - } - } - - // Loop through the CUs, and calculate the size needed. - var size int64 -+ -+ if garbleTiny { -+ size = 1 // first byte is reserved for empty string used for all non-exportable method names -+ } -+ // Kinds of SymNames found in the wild: -+ // -+ // * reflect.Value.CanAddr -+ // * reflect.(*Value).String -+ // * reflect.w6cEoKc -+ // * internal/abi.(*RegArgs).IntRegArgAddr -+ // * type:.eq.runtime.special -+ // * runtime/internal/atomic.(*Pointer[go.shape.string]).Store -+ // -+ // Checking whether the first rune after the last dot is uppercase seems enough. -+ isExported := func(name string) bool { -+ for _, r := range name[strings.LastIndexByte(name, '.')+1:] { -+ return unicode.IsUpper(r) -+ } -+ return false -+ } -+ - walkFuncs(ctxt, funcs, func(s loader.Sym) { -+ name := ctxt.loader.SymName(s) -+ -+ if garbleTiny && !isExported(name) { -+ nameOffsets[s] = 0 // redirect name to empty string -+ return -+ } -+ - nameOffsets[s] = uint32(size) -- size += int64(len(ctxt.loader.SymName(s)) + 1) // NULL terminate -+ size += int64(len(name) + 1) // NULL terminate - }) - - state.funcnametab = state.addGeneratedSym(ctxt, "runtime.funcnametab", size, writeFuncNameTab) --- -2.40.1 - diff --git a/internal/linker/patches/go1.21/0003-add-entryOff-encryption.patch b/internal/linker/patches/go1.21/0003-add-entryOff-encryption.patch deleted file mode 100644 index 85b1013..0000000 --- a/internal/linker/patches/go1.21/0003-add-entryOff-encryption.patch +++ /dev/null @@ -1,43 +0,0 @@ -From b5524a7c84a994b43027723b4bb05441db365a1e Mon Sep 17 00:00:00 2001 -From: pagran -Date: Sat, 14 Jan 2023 21:36:16 +0100 -Subject: [PATCH 3/3] add entryOff encryption - ---- - cmd/link/internal/ld/pcln.go | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/cmd/link/internal/ld/pcln.go b/cmd/link/internal/ld/pcln.go -index 8b670135de..e4ccfc9330 100644 ---- a/cmd/link/internal/ld/pcln.go -+++ b/cmd/link/internal/ld/pcln.go -@@ -779,6 +779,26 @@ func writeFuncs(ctxt *Link, sb *loader.SymbolBuilder, funcs []loader.Sym, inlSym - sb.SetUint32(ctxt.Arch, dataoff, uint32(ldr.SymValue(fdsym)-gofuncBase)) - } - } -+ -+ // Moving next code higher is not recommended. -+ // Only at the end of the current function no edits between go versions -+ garbleEntryOffKeyStr := os.Getenv("GARBLE_LINK_ENTRYOFF_KEY") -+ if garbleEntryOffKeyStr == "" { -+ panic("[garble] entryOff key must be set") -+ } -+ var garbleEntryOffKey uint32 -+ // Use fmt package instead of strconv to avoid importing a new package -+ if _, err := fmt.Sscan(garbleEntryOffKeyStr, &garbleEntryOffKey); err != nil { -+ panic(fmt.Errorf("[garble] invalid entryOff key %s: %v", garbleEntryOffKeyStr, err)) -+ } -+ -+ garbleData := sb.Data() -+ for _, off := range startLocations { -+ entryOff := ctxt.Arch.ByteOrder.Uint32(garbleData[off:]) -+ nameOff := ctxt.Arch.ByteOrder.Uint32(garbleData[off+4:]) -+ -+ sb.SetUint32(ctxt.Arch, int64(off), entryOff^(nameOff*garbleEntryOffKey)) -+ } - } - - // pclntab initializes the pclntab symbol with --- -2.40.1 - diff --git a/main.go b/main.go index 8b9e103..e3f7c99 100644 --- a/main.go +++ b/main.go @@ -20,6 +20,7 @@ import ( "go/parser" "go/token" "go/types" + "go/version" "io" "io/fs" "log" @@ -40,7 +41,6 @@ import ( "golang.org/x/exp/maps" "golang.org/x/exp/slices" "golang.org/x/mod/module" - "golang.org/x/mod/semver" "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/ssa" "mvdan.cc/garble/internal/ctrlflow" @@ -267,28 +267,21 @@ type errJustExit int func (e errJustExit) Error() string { return fmt.Sprintf("exit: %d", e) } func goVersionOK() bool { - // TODO(mvdan): use go/version once we can require Go 1.22 or later: https://go.dev/issue/62039 - const ( - minGoVersionSemver = "v1.21.0" - suggestedGoVersion = "1.21" - ) + const minGoVersion = "go1.22" - // rxVersion looks for a version like "go1.2" or "go1.2.3" + // rxVersion looks for a version like "go1.2" or "go1.2.3" in `go env GOVERSION`. rxVersion := regexp.MustCompile(`go\d+\.\d+(?:\.\d+)?`) toolchainVersionFull := sharedCache.GoEnv.GOVERSION - toolchainVersion := rxVersion.FindString(toolchainVersionFull) - if toolchainVersion == "" { - // Go 1.15.x and older do not have GOVERSION yet. - // We could go the extra mile and fetch it via 'go toolchainVersion', - // but we'd have to error anyway. - fmt.Fprintf(os.Stderr, "Go version is too old; please upgrade to Go %s or newer\n", suggestedGoVersion) + sharedCache.GoVersion = rxVersion.FindString(toolchainVersionFull) + if sharedCache.GoVersion == "" { + // Go 1.15.x and older did not have GOVERSION yet; they are too old anyway. + fmt.Fprintf(os.Stderr, "Go version is too old; please upgrade to %s or newer\n", minGoVersion) return false } - sharedCache.GoVersionSemver = "v" + strings.TrimPrefix(toolchainVersion, "go") - if semver.Compare(sharedCache.GoVersionSemver, minGoVersionSemver) < 0 { - fmt.Fprintf(os.Stderr, "Go version %q is too old; please upgrade to Go %s or newer\n", toolchainVersionFull, suggestedGoVersion) + if version.Compare(sharedCache.GoVersion, minGoVersion) < 0 { + fmt.Fprintf(os.Stderr, "Go version %q is too old; please upgrade to %s or newer\n", toolchainVersionFull, minGoVersion) return false } @@ -304,10 +297,9 @@ func goVersionOK() bool { // Fall back to not performing the check against the toolchain version. return true } - builtVersionSemver := "v" + strings.TrimPrefix(builtVersion, "go") - if semver.Compare(builtVersionSemver, sharedCache.GoVersionSemver) < 0 { + if version.Compare(builtVersion, sharedCache.GoVersion) < 0 { fmt.Fprintf(os.Stderr, ` -garble was built with %q and is being used with %q; rebuild it with a command like: +garble was built with %q and can't be used with the newer %q; rebuild it with a command like: go install mvdan.cc/garble@latest `[1:], builtVersionFull, toolchainVersionFull) return false diff --git a/scripts/gen-go-std-tables.sh b/scripts/gen-go-std-tables.sh index 30f771e..62cb389 100755 --- a/scripts/gen-go-std-tables.sh +++ b/scripts/gen-go-std-tables.sh @@ -46,8 +46,8 @@ var runtimeLinknamed = []string{ $(for path in ${runtime_linknamed}; do echo "\"${path}\"", done) - // Existed in Go 1.21; removed in Go 1.22. - "math/rand", + // The net package linknames to the runtime, not the other way around. + // TODO: support this automatically via our script. "net", } @@ -58,7 +58,6 @@ done) } var compilerIntrinsicsFuncs = map[string]bool{ - "runtime.mulUintptr": true, // Existed in Go 1.21; removed in Go 1.22. $(while read path name; do echo "\"${path}.${name}\": true," done <<<"${compiler_intrinsics_table}") diff --git a/shared.go b/shared.go index b5b8401..7539191 100644 --- a/shared.go +++ b/shared.go @@ -18,7 +18,6 @@ import ( "time" "golang.org/x/mod/module" - "golang.org/x/mod/semver" ) //go:generate ./scripts/gen-go-std-tables.sh @@ -50,12 +49,12 @@ type sharedCacheType struct { GOGARBLE string - // GoVersionSemver is a semver-compatible version of the Go toolchain - // currently being used, as reported by "go env GOVERSION". + // GoVersion is a version of the Go toolchain currently being used, + // as reported by "go env GOVERSION" and compatible with go/version. // Note that the version of Go that built the garble binary might be newer. // Also note that a devel version like "go1.22-231f290e51" is - // currently represented as "v1.22". - GoVersionSemver string + // currently represented as "go1.22", as the suffix is ignored by go/version. + GoVersion string // Filled directly from "go env". // Keep in sync with fetchGoEnv. @@ -267,8 +266,6 @@ func appendListedPackages(packages []string, mainBuild bool) error { // Some packages in runtimeLinknamed need a build tag to be importable, // like crypto/internal/boring/fipstls with boringcrypto, // so any pkg.Error should be ignored when the build tag isn't set. - } else if pkg.ImportPath == "math/rand/v2" && semver.Compare(sharedCache.GoVersionSemver, "v1.22") < 0 { - // added in Go 1.22, so Go 1.21 runs into a "not found" error. } else { if pkgErrors.Len() > 0 { pkgErrors.WriteString("\n") diff --git a/testdata/script/asm.txtar b/testdata/script/asm.txtar index 65f524e..210dfcb 100644 --- a/testdata/script/asm.txtar +++ b/testdata/script/asm.txtar @@ -33,7 +33,7 @@ binsubstr main$exe 'addJmp' 'AddImpl' -- go.mod -- module test/with.many.dots/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/atomic.txtar b/testdata/script/atomic.txtar index ffc2d65..0b62b55 100644 --- a/testdata/script/atomic.txtar +++ b/testdata/script/atomic.txtar @@ -18,7 +18,7 @@ cmp stderr main.stderr -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/basic.txtar b/testdata/script/basic.txtar index caf0c2a..c294f66 100644 --- a/testdata/script/basic.txtar +++ b/testdata/script/basic.txtar @@ -59,7 +59,7 @@ binsubstr main$exe 'garble_main.go' 'globalVar' 'globalFunc' $gofullversion -- go.mod -- module test/mainfoo -go 1.21 +go 1.22 -- garble_main.go -- package main diff --git a/testdata/script/cache.txtar b/testdata/script/cache.txtar index 2879472..ea2b096 100644 --- a/testdata/script/cache.txtar +++ b/testdata/script/cache.txtar @@ -28,7 +28,7 @@ cmp stderr main.stderr -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/cgo.txtar b/testdata/script/cgo.txtar index ef9d44e..350fc27 100644 --- a/testdata/script/cgo.txtar +++ b/testdata/script/cgo.txtar @@ -29,7 +29,7 @@ binsubstr main$exe 'privateAdd' -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/crossbuild.txtar b/testdata/script/crossbuild.txtar index b2e5208..a6c7f0c 100644 --- a/testdata/script/crossbuild.txtar +++ b/testdata/script/crossbuild.txtar @@ -31,7 +31,7 @@ exec garble build -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/ctrlflow.txtar b/testdata/script/ctrlflow.txtar index a809015..f75e658 100644 --- a/testdata/script/ctrlflow.txtar +++ b/testdata/script/ctrlflow.txtar @@ -30,7 +30,7 @@ grep 'func\(int\) int' $WORK/debug/test/main/GARBLE_controlflow.go -- go.mod -- module test/main -go 1.21 +go 1.22 -- garble_main.go -- package main diff --git a/testdata/script/debugdir.txtar b/testdata/script/debugdir.txtar index 48825f4..c62a2cf 100644 --- a/testdata/script/debugdir.txtar +++ b/testdata/script/debugdir.txtar @@ -18,7 +18,7 @@ stderr 'test/main' # we force rebuilds with -debugdir -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/embed.txtar b/testdata/script/embed.txtar index bf2c097..7418fe3 100644 --- a/testdata/script/embed.txtar +++ b/testdata/script/embed.txtar @@ -11,7 +11,7 @@ cmp stdout main.stdout -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/goenv.txtar b/testdata/script/goenv.txtar index 3e44b86..6dbc72e 100644 --- a/testdata/script/goenv.txtar +++ b/testdata/script/goenv.txtar @@ -46,7 +46,7 @@ exec $NAME/garble$exe build -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/gogarble.txtar b/testdata/script/gogarble.txtar index 3931c9c..38c7c01 100644 --- a/testdata/script/gogarble.txtar +++ b/testdata/script/gogarble.txtar @@ -54,7 +54,7 @@ bincmp out_rebuild out -- go.mod -- module test/main -go 1.21 +go 1.22 -- standalone/main.go -- package main diff --git a/testdata/script/goversion.txtar b/testdata/script/goversion.txtar index 0a457e1..9ef85cc 100644 --- a/testdata/script/goversion.txtar +++ b/testdata/script/goversion.txtar @@ -7,30 +7,30 @@ env PATH=${WORK}/.bin${:}${PATH} # An empty go version. env TOOLCHAIN_GOVERSION='' ! exec garble build -stderr 'Go version is too old; please upgrade to Go 1\.21 or newer' +stderr 'Go version is too old; please upgrade to go1\.22 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 Go 1\.21 or newer' +stderr 'Go version is too old; please upgrade to go1\.22 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 Go 1\.21' +stderr 'Go version "devel go1\.15-.*2020.*" is too old; please upgrade to go1\.22' # A current devel version should be fine. # Note that we don't look at devel version timestamps. -env GARBLE_TEST_GOVERSION='go1.21' -env TOOLCHAIN_GOVERSION='devel go1.21-ad97d204f0 Sun Sep 12 16:46:58 2023 +0000' +env GARBLE_TEST_GOVERSION='go1.22' +env TOOLCHAIN_GOVERSION='devel go1.22-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 Go 1\.21 or newer' +stderr 'Go version "go1\.14" is too old; please upgrade to go1\.22 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,45 +40,45 @@ env TOOLCHAIN_GOVERSION='go1.28.2' stderr 'mocking the real build' # We should accept custom devel strings. -env TOOLCHAIN_GOVERSION='devel go1.22-somecustomversion' +env TOOLCHAIN_GOVERSION='devel go1.23-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.22' -env TOOLCHAIN_GOVERSION='go1.21.3' +env GARBLE_TEST_GOVERSION='go1.23' +env TOOLCHAIN_GOVERSION='go1.22.3' ! exec garble build stderr 'mocking the real build' # The current toolchain may be equal to the one that built garble. -env GARBLE_TEST_GOVERSION='devel go1.21-6673d5d701 Sun Mar 20 16:05:03 2023 +0000' -env TOOLCHAIN_GOVERSION='devel go1.21-6673d5d701 Sun Mar 20 16:05:03 2023 +0000' +env GARBLE_TEST_GOVERSION='devel go1.22-6673d5d701 Sun Mar 20 16:05:03 2023 +0000' +env TOOLCHAIN_GOVERSION='devel go1.22-6673d5d701 Sun Mar 20 16:05:03 2023 +0000' ! 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.21.1' +env TOOLCHAIN_GOVERSION='go1.22.1' ! exec garble build -stderr 'garble was built with "go1\.18" and is being used with "go1\.21\.1"; rebuild ' +stderr 'garble was built with "go1\.18" and can''t be used with the newer "go1\.22\.1"; 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.21.11' -env TOOLCHAIN_GOVERSION='go1.21.14' +env GARBLE_TEST_GOVERSION='go1.22.11' +env TOOLCHAIN_GOVERSION='go1.22.14' ! exec garble build -stderr 'garble was built with "go1\.21\.11" and is being used with "go1\.21\.14"; rebuild ' +stderr 'garble was built with "go1\.22\.11" and can''t be used with the newer "go1\.22\.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.21.3' +env TOOLCHAIN_GOVERSION='go1.22.3' ! exec garble build stderr 'mocking the real build' -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/help.txtar b/testdata/script/help.txtar index 5d627ae..8f25260 100644 --- a/testdata/script/help.txtar +++ b/testdata/script/help.txtar @@ -117,6 +117,6 @@ stderr 'usage: garble version' -- go.mod -- module dummy -go 1.21 +go 1.22 -- dummy.go -- package dummy diff --git a/testdata/script/implement.txtar b/testdata/script/implement.txtar index 36ece4a..8138e51 100644 --- a/testdata/script/implement.txtar +++ b/testdata/script/implement.txtar @@ -13,7 +13,7 @@ cmp stdout main.stdout -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/imports.txtar b/testdata/script/imports.txtar index 73cff4b..d9ccc36 100644 --- a/testdata/script/imports.txtar +++ b/testdata/script/imports.txtar @@ -42,7 +42,7 @@ cmp stdout main.stdout -- go.mod -- module test/main -go 1.21 +go 1.22 require ( gopkg.in/garbletest.v2 v2.999.0 diff --git a/testdata/script/init.txtar b/testdata/script/init.txtar index f1a0d5b..886b8fb 100644 --- a/testdata/script/init.txtar +++ b/testdata/script/init.txtar @@ -12,7 +12,7 @@ cmp stderr main.stderr -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/ldflags.txtar b/testdata/script/ldflags.txtar index a6f2e28..f4cec36 100644 --- a/testdata/script/ldflags.txtar +++ b/testdata/script/ldflags.txtar @@ -28,7 +28,7 @@ binsubstr main$exe 'unexportedVersion' 'ExportedUnset' 'v1.22.33' 'garble_replac -- go.mod -- module domain.test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/linker.txtar b/testdata/script/linker.txtar index 3afa716..8bb48da 100644 --- a/testdata/script/linker.txtar +++ b/testdata/script/linker.txtar @@ -34,7 +34,7 @@ cmp stderr main.stderr -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/linkname.txtar b/testdata/script/linkname.txtar index bc0fa48..a42144b 100644 --- a/testdata/script/linkname.txtar +++ b/testdata/script/linkname.txtar @@ -14,7 +14,7 @@ cmp stderr main.stderr -- go.mod -- module test/main -go 1.21 +go 1.22 replace big.chungus/meme => ./big.chungus/meme @@ -149,7 +149,7 @@ func ByteIndex(s string, c byte) int -- big.chungus/meme/go.mod -- module test/main -go 1.21 +go 1.22 -- big.chungus/meme/dante.go -- package meme diff --git a/testdata/script/list_error.txtar b/testdata/script/list_error.txtar index 9fa3bad..91d922b 100644 --- a/testdata/script/list_error.txtar +++ b/testdata/script/list_error.txtar @@ -8,7 +8,7 @@ imports_missing${/}imports.go:5:8: package test/main/missing is not in std (${GO -- go.mod -- module test/main -go 1.21 +go 1.22 -- broken/broken.go -- package broken diff --git a/testdata/script/literals.txtar b/testdata/script/literals.txtar index 1a14790..e485a7a 100644 --- a/testdata/script/literals.txtar +++ b/testdata/script/literals.txtar @@ -59,7 +59,7 @@ exec garble -literals build std -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/modinfo.txtar b/testdata/script/modinfo.txtar index 32a6d32..d0a1ec4 100644 --- a/testdata/script/modinfo.txtar +++ b/testdata/script/modinfo.txtar @@ -26,7 +26,7 @@ stdout 'build\s*vcs.revision='${HEAD_COMMIT_SHA} -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/plugin.txtar b/testdata/script/plugin.txtar index c33f541..a4e4aa5 100644 --- a/testdata/script/plugin.txtar +++ b/testdata/script/plugin.txtar @@ -26,7 +26,7 @@ cmp stderr main.stderr -- go.mod -- module test/main -go 1.21 +go 1.22 -- plugin/main.go -- package main diff --git a/testdata/script/position.txtar b/testdata/script/position.txtar index 52919ea..0279c8e 100644 --- a/testdata/script/position.txtar +++ b/testdata/script/position.txtar @@ -16,7 +16,7 @@ stdout 'varPositions is sorted' -- go.mod -- module test/main -go 1.21 +go 1.22 -- garble_main.go -- package main diff --git a/testdata/script/reflect.txtar b/testdata/script/reflect.txtar index 0278957..b5ff9e2 100644 --- a/testdata/script/reflect.txtar +++ b/testdata/script/reflect.txtar @@ -14,7 +14,7 @@ cmp stdout main.stdout -- go.mod -- module test/main -go 1.21 +go 1.22 -- garble_main.go -- package main diff --git a/testdata/script/reverse.txtar b/testdata/script/reverse.txtar index 582ed36..a4b8f7d 100644 --- a/testdata/script/reverse.txtar +++ b/testdata/script/reverse.txtar @@ -46,7 +46,7 @@ cmp stdout main-literals.stderr -- go.mod -- module test/main -go 1.21 +go 1.22 -- long_main.go -- package main diff --git a/testdata/script/run.txtar b/testdata/script/run.txtar index 0b9adac..50e818c 100644 --- a/testdata/script/run.txtar +++ b/testdata/script/run.txtar @@ -14,7 +14,7 @@ stdout 'garble_main\.go 9$' -- go.mod -- module test/main -go 1.21 +go 1.22 -- garble_main.go -- package main diff --git a/testdata/script/seed-cache.txtar b/testdata/script/seed-cache.txtar index ac93458..09a7e2e 100644 --- a/testdata/script/seed-cache.txtar +++ b/testdata/script/seed-cache.txtar @@ -32,7 +32,7 @@ cd .. -- mod1/go.mod -- module test/main/mod1 -go 1.21 +go 1.22 require gopkg.in/garbletest.v2 v2.999.0 @@ -52,7 +52,7 @@ func main() { garbletest.Test() } -- mod2/go.mod -- module test/main/mod2 -go 1.21 +go 1.22 require gopkg.in/garbletest.v2 v2.999.0 diff --git a/testdata/script/seed.txtar b/testdata/script/seed.txtar index cd4179b..c447b1a 100644 --- a/testdata/script/seed.txtar +++ b/testdata/script/seed.txtar @@ -97,7 +97,7 @@ cmp stderr importedpkg.stderr -- go.mod -- module test/main -go 1.21 +go 1.22 -- main.go -- package main diff --git a/testdata/script/syntax.txtar b/testdata/script/syntax.txtar index 437f1f3..c3117e5 100644 --- a/testdata/script/syntax.txtar +++ b/testdata/script/syntax.txtar @@ -16,7 +16,7 @@ binsubstr main$exe 'globalVar' # 'globalType' matches on some, but not all, plat -- extra/go.mod -- module private.source/extra -go 1.21 +go 1.22 -- extra/extra.go -- package extra @@ -26,7 +26,7 @@ func Func() string { -- go.mod -- module test/main -go 1.21 +go 1.22 // We include an extra module to obfuscate, included in the same original source // code via a replace directive. diff --git a/testdata/script/test.txtar b/testdata/script/test.txtar index ad312b1..dea0fbd 100644 --- a/testdata/script/test.txtar +++ b/testdata/script/test.txtar @@ -52,7 +52,7 @@ stdout 'package bar_test, func name: test/bar\.OriginalFuncName' -- go.mod -- module test/bar -go 1.21 +go 1.22 -- bar.go -- package bar diff --git a/testdata/script/tiny.txtar b/testdata/script/tiny.txtar index 108c3f4..173e18e 100644 --- a/testdata/script/tiny.txtar +++ b/testdata/script/tiny.txtar @@ -27,7 +27,7 @@ stderr 'funcStructExported false funcStructUnexported false' -- go.mod -- module test/main -go 1.21 +go 1.22 -- garble_main.go -- package main diff --git a/testdata/script/typeparams.txtar b/testdata/script/typeparams.txtar index bbb6d3f..1e80307 100644 --- a/testdata/script/typeparams.txtar +++ b/testdata/script/typeparams.txtar @@ -3,7 +3,7 @@ exec garble build -- go.mod -- module test/main -go 1.21 +go 1.22 -- garble_main.go -- package main