From 67100809b399b60e58490fa8b1c0a72be75ac820 Mon Sep 17 00:00:00 2001 From: kim Date: Sun, 10 Aug 2025 15:05:54 +0200 Subject: [chore] update dependencies (#4361) - codeberg.org/gruf/go-kv/v2 v2.0.5 => v2.0.6 - github.com/coreos/go-oidc/v3 v3.14.1 => v3.15.0 - github.com/miekg/dns v1.1.67 => v1.1.68 - github.com/tdewolff/minify/v2 v2.23.9 => v2.23.11 - github.com/yuin/goldmark v1.7.12 => v1.7.13 - golang.org/x/crypto v0.40.0 => v0.41.0 - golang.org/x/image v0.29.0 => v0.30.0 - golang.org/x/net v0.42.0 => v0.43.0 - golang.org/x/sys v0.34.0 => v0.35.0 - golang.org/x/text v0.27.0 => v0.28.0 - modernc.org/sqlite v1.38.0 => v1.38.2 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4361 Co-authored-by: kim Co-committed-by: kim --- vendor/codeberg.org/gruf/go-xunsafe/LICENSE | 9 ++ vendor/codeberg.org/gruf/go-xunsafe/README.md | 3 + vendor/codeberg.org/gruf/go-xunsafe/abi.go | 109 +++++++++++++++++ vendor/codeberg.org/gruf/go-xunsafe/reflect.go | 157 +++++++++++++++++++++++++ vendor/codeberg.org/gruf/go-xunsafe/types.go | 49 ++++++++ 5 files changed, 327 insertions(+) create mode 100644 vendor/codeberg.org/gruf/go-xunsafe/LICENSE create mode 100644 vendor/codeberg.org/gruf/go-xunsafe/README.md create mode 100644 vendor/codeberg.org/gruf/go-xunsafe/abi.go create mode 100644 vendor/codeberg.org/gruf/go-xunsafe/reflect.go create mode 100644 vendor/codeberg.org/gruf/go-xunsafe/types.go (limited to 'vendor/codeberg.org/gruf/go-xunsafe') diff --git a/vendor/codeberg.org/gruf/go-xunsafe/LICENSE b/vendor/codeberg.org/gruf/go-xunsafe/LICENSE new file mode 100644 index 000000000..d6f08d0ab --- /dev/null +++ b/vendor/codeberg.org/gruf/go-xunsafe/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) gruf + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/codeberg.org/gruf/go-xunsafe/README.md b/vendor/codeberg.org/gruf/go-xunsafe/README.md new file mode 100644 index 000000000..9c8031e17 --- /dev/null +++ b/vendor/codeberg.org/gruf/go-xunsafe/README.md @@ -0,0 +1,3 @@ +# go-xunsafe + +xunafe as in EXTRA UNSAFE. this exposes reflect and internal ABI package data structures in a manner that is kept up-to-date and version gated by the compile-time Go version. This package performs no validity checks on the data you provide to it, it is expected that you know what you are doing. Not to mention that some of the internal ABI data must only be exposed VERY carefully given that it is in non garbage-collected memory. diff --git a/vendor/codeberg.org/gruf/go-xunsafe/abi.go b/vendor/codeberg.org/gruf/go-xunsafe/abi.go new file mode 100644 index 000000000..d492f5681 --- /dev/null +++ b/vendor/codeberg.org/gruf/go-xunsafe/abi.go @@ -0,0 +1,109 @@ +//go:build go1.24 && !go1.26 + +package xunsafe + +import ( + "reflect" + "unsafe" +) + +func init() { + // TypeOf(reflect.Type{}) == *struct{ abi.Type{} } + t := reflect.TypeOf(reflect.TypeOf(0)).Elem() + if t.Size() != unsafe.Sizeof(Abi_Type{}) { + panic("Abi_Type{} not in sync with abi.Type{}") + } +} + +const ( + // see: go/src/internal/abi/type.go + Abi_KindDirectIface uint8 = 1 << 5 + Abi_KindMask uint8 = (1 << 5) - 1 +) + +// Abi_Type is a copy of the memory layout of abi.Type{}. +// +// see: go/src/internal/abi/type.go +type Abi_Type struct { + _ uintptr + PtrBytes uintptr + _ uint32 + _ uint8 + _ uint8 + _ uint8 + Kind_ uint8 + _ func(unsafe.Pointer, unsafe.Pointer) bool + _ *byte + _ int32 + _ int32 +} + +// Abi_EmptyInterface is a copy of the memory layout of abi.EmptyInterface{}, +// which is to say also the memory layout of any method-less interface. +// +// see: go/src/internal/abi/iface.go +type Abi_EmptyInterface struct { + Type *Abi_Type + Data unsafe.Pointer +} + +// Abi_NonEmptyInterface is a copy of the memory layout of abi.NonEmptyInterface{}, +// which is to say also the memory layout of any interface containing method(s). +// +// see: go/src/internal/abi/iface.go on 1.25+ +// see: go/src/reflect/value.go on 1.24 +type Abi_NonEmptyInterface struct { + ITab uintptr + Data unsafe.Pointer +} + +// see: go/src/internal/abi/type.go Type.Kind() +func Abi_Type_Kind(t reflect.Type) uint8 { + iface := (*Abi_NonEmptyInterface)(unsafe.Pointer(&t)) + atype := (*Abi_Type)(unsafe.Pointer(iface.Data)) + return atype.Kind_ & Abi_KindMask +} + +// see: go/src/internal/abi/type.go Type.IfaceIndir() +func Abi_Type_IfaceIndir(t reflect.Type) bool { + iface := (*Abi_NonEmptyInterface)(unsafe.Pointer(&t)) + atype := (*Abi_Type)(unsafe.Pointer(iface.Data)) + return atype.Kind_&Abi_KindDirectIface == 0 +} + +// PackIface packs a new reflect.nonEmptyInterface{} using shielded +// itab and data pointer, returning a pointer for caller casting. +func PackIface(itab uintptr, word unsafe.Pointer) unsafe.Pointer { + return unsafe.Pointer(&Abi_NonEmptyInterface{ + ITab: itab, + Data: word, + }) +} + +// GetIfaceITab generates a new value of given type, +// casts it to the generic param interface type, and +// returns the .itab portion of the abi.NonEmptyInterface{}. +// this is useful for later calls to PackIface for known type. +func GetIfaceITab[I any](t reflect.Type) uintptr { + s := reflect.New(t).Elem().Interface().(I) + i := (*Abi_NonEmptyInterface)(unsafe.Pointer(&s)) + return i.ITab +} + +// UnpackEface returns the .Data portion of an abi.EmptyInterface{}. +func UnpackEface(a any) unsafe.Pointer { + return (*Abi_EmptyInterface)(unsafe.Pointer((&a))).Data +} + +// see: go/src/internal/unsafeheader/unsafeheader.go +type Unsafeheader_Slice struct { + Data unsafe.Pointer + Len int + Cap int +} + +// see: go/src/internal/unsafeheader/unsafeheader.go +type Unsafeheader_String struct { + Data unsafe.Pointer + Len int +} diff --git a/vendor/codeberg.org/gruf/go-xunsafe/reflect.go b/vendor/codeberg.org/gruf/go-xunsafe/reflect.go new file mode 100644 index 000000000..de40b2c89 --- /dev/null +++ b/vendor/codeberg.org/gruf/go-xunsafe/reflect.go @@ -0,0 +1,157 @@ +//go:build go1.24 && !go1.26 + +package xunsafe + +import ( + "reflect" + "unsafe" +) + +// see: go/src/reflect/value.go +type Reflect_flag uintptr + +const ( + // see: go/src/reflect/value.go + Reflect_flagKindWidth = 5 // there are 27 kinds + Reflect_flagKindMask Reflect_flag = 1<