You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ~/go/bin/go1.24rc1 version;~/go/bin/go1.24rc1 test.
go version go1.24rc1 darwin/arm64
# github.com/supranational/blst/bindings/go [github.com/supranational/blst/bindings/go.test]
./blst.go:237:11: cannot define new methods on non-local type SecretKey
./blst.go:324:15: cannot define new methods on non-local type SecretKey
./blst.go:444:11: cannot define new methods on non-local type Fp12
./blst.go:448:11: cannot define new methods on non-local type Fp12
./blst.go:452:11: cannot define new methods on non-local type Fp12
./blst.go:456:11: cannot define new methods on non-local type Fp12
./blst.go:462:12: cannot define new methods on non-local type Fp12
./blst.go:482:11: cannot define new methods on non-local type P1Affine
./blst.go:487:11: cannot define new methods on non-local type P1Affine
./blst.go:495:12: cannot define new methods on non-local type P2Affine
./blst.go:495:12: too many errors
FAIL github.com/supranational/blst/bindings/go [build failed]
FAIL
The compiler already disallowed defining new methods with receiver types that were cgo-generated, but it was possible to circumvent that restriction via an alias type. Go 1.24 now always reports an error if a receiver denotes a cgo-generated type, whether directly or indirectly (through an alias type).
to "normal" type definitions (e.g. type Scalar C.blst_scalar without the = in the middle) and then defining the required methods, including forwarding all the other methods that already exist on the C.blst_scalar type. I think this would avoid breaking any existing usage, but I haven't really used this package yet so it's a bit of a guess on my part.
The text was updated successfully, but these errors were encountered:
Thanks for the heads-up! Unfortunately getting rid of = in type declaration doesn't cut it. Could you test #247, i.e. go1.24 branch in https://github.com/dot-asm/blst, with whatever you're working on?
I tried building Go code that references blst at the latest release, and with go1.24rc1 the blst bindings fail to build.
This failure can be reproduced from the blst repository, in the
bindings/go
directory.Tests run fine with go1.23:
With go1.24rc1, the bindings fail to build:
This appears to be a deliberate change in the Go toolchain, according to the draft Go 1.24 release notes:
The HTML comments at that paragraph indicate golang/go#60725 and golang/go#57926.
The fix is probably changing this set of types:
blst/bindings/go/blst.go
Lines 171 to 182 in bef14ca
to "normal" type definitions (e.g.
type Scalar C.blst_scalar
without the=
in the middle) and then defining the required methods, including forwarding all the other methods that already exist on theC.blst_scalar
type. I think this would avoid breaking any existing usage, but I haven't really used this package yet so it's a bit of a guess on my part.The text was updated successfully, but these errors were encountered: