Skip to content

Commit

Permalink
update third party projects to test to support Go 1.23
Browse files Browse the repository at this point in the history
In particular, wireguard had Go runtime hacks that broke with Go 1.23,
and the latest master version resolves this issue.
  • Loading branch information
mvdan committed Sep 4, 2024
1 parent 48fac78 commit b6cd5a0
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 50 deletions.
5 changes: 5 additions & 0 deletions scripts/cached_modfiles/github.com_andybalholm_brotli.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module test

go 1.23.0

require github.com/andybalholm/brotli v1.1.0 // indirect
2 changes: 2 additions & 0 deletions scripts/cached_modfiles/github.com_andybalholm_brotli.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=

This file was deleted.

This file was deleted.

8 changes: 8 additions & 0 deletions scripts/cached_modfiles/github.com_samber_lo.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module test

go 1.23.0

require (
github.com/samber/lo v1.47.0 // indirect
golang.org/x/text v0.16.0 // indirect
)
4 changes: 4 additions & 0 deletions scripts/cached_modfiles/github.com_samber_lo.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc=
github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
8 changes: 0 additions & 8 deletions scripts/cached_modfiles/github.com_samber_lo_v1.21.0.mod

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/cached_modfiles/github.com_samber_lo_v1.21.0.sum

This file was deleted.

14 changes: 14 additions & 0 deletions scripts/cached_modfiles/golang.zx2c4.com_wireguard.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module test

go 1.23.0

require (
github.com/google/btree v1.0.1 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 // indirect
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259 // indirect
)
16 changes: 16 additions & 0 deletions scripts/cached_modfiles/golang.zx2c4.com_wireguard.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 h1:/jFs0duh4rdb8uIfPMv78iAJGcPKDeqAFnaLBropIC4=
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA=
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259 h1:TbRPT0HtzFP3Cno1zZo7yPzEEnfu8EjLfl6IU9VfqkQ=
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259/go.mod h1:AVgIgHMwK63XvmAzWG9vLQ41YnVHN0du0tEC46fI7yY=

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module test

go 1.20
go 1.23.0

require (
github.com/golang/protobuf v1.5.0 // indirect
github.com/google/go-cmp v0.5.5 // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
16 changes: 10 additions & 6 deletions scripts/check-third-party.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,23 @@
# Also remember that the standard library already provides significant cover.
modules=(
# Protobuf helps cover encoding libraries and reflection.
google.golang.org/protobuf v1.28.1
google.golang.org/protobuf v1.34.2

# Wireguard helps cover networking and cryptography.
golang.zx2c4.com/wireguard 0.0.20220316
# Note that the latest tag does not build on Go 1.23.
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173

# Lo helps cover generics.
# TODO: would be nice to find a more popular alternative,
# at least once generics are more widespread.
github.com/samber/lo v1.21.0
github.com/samber/lo v1.47.0

# Brotli is a compression algorithm popular with HTTP.
# It's also transpiled from C with a gitlab.com/cznic/ccgo,
# so this helps stress garble with Go code that few humans would write.
# Unlike other ccgo-generated projects, like modernc.org/sqlite,
# it's relatively small without any transitive dependencies.
github.com/andybalholm/brotli v1.0.4
github.com/andybalholm/brotli v1.1.0

# TODO: consider github.com/mattn/go-sqlite3 to cover a DB and more cgo

Expand All @@ -44,7 +45,10 @@ exit_code=0

show() {
echo "> ${@}"
"${@}"
if ! "${@}"; then
echo "FAIL"
return 1
fi
}

BASE_GOFLAGS="$(go env GOFLAGS)"
Expand All @@ -64,7 +68,7 @@ for ((i = 0; i < ${#modules[@]}; i += 2)); do
# Use the custom go.mod file for the rest of the commands via GOFLAGS.
# We should delete these cached modfiles with major Go updates,
# to recreate their "tidy" version with newer Go toolchains.
cached_modfile="${module}_${version}"
cached_modfile="${module}"
cached_modfile="${CACHED_MODFILES}/${cached_modfile//[^A-Za-z0-9._-]/_}.mod"
export GOFLAGS="${BASE_GOFLAGS} -modfile=${cached_modfile}"

Expand Down

0 comments on commit b6cd5a0

Please sign in to comment.