bugst / go-serial

A cross-platform serial library for go-lang.
BSD 3-Clause "New" or "Revised" License
617 stars 188 forks source link

Doesn't compile with Go 1.21 on macOS #162

Closed aykevl closed 10 months ago

aykevl commented 12 months ago

I found that go-serial doesn't compile with Go 1.21-rc2 on darwin:

# go.bug.st/serial/enumerator
../go-serial/enumerator/usb_darwin.go:142:11: cannot define new methods on non-local type C.CFStringRef
../go-serial/enumerator/usb_darwin.go:148:11: cannot define new methods on non-local type C.CFTypeRef
../go-serial/enumerator/usb_darwin.go:154:11: cannot define new methods on non-local type *C.io_registry_entry_t
../go-serial/enumerator/usb_darwin.go:165:11: cannot define new methods on non-local type *C.io_registry_entry_t
../go-serial/enumerator/usb_darwin.go:175:11: cannot define new methods on non-local type *C.io_registry_entry_t
../go-serial/enumerator/usb_darwin.go:194:11: cannot define new methods on non-local type *C.io_registry_entry_t
../go-serial/enumerator/usb_darwin.go:214:11: cannot define new methods on non-local type *C.io_iterator_t
../go-serial/enumerator/usb_darwin.go:218:11: cannot define new methods on non-local type *C.io_iterator_t
../go-serial/enumerator/usb_darwin.go:222:11: cannot define new methods on non-local type *C.io_iterator_t
../go-serial/enumerator/usb_darwin.go:229:11: cannot define new methods on non-local type *C.io_object_t
../go-serial/enumerator/usb_darwin.go:233:11: cannot define new methods on non-local type *C.io_object_t

This is with the latest commit, e381f2c1332081ea593d73e97c71342026876857.

deadprogram commented 11 months ago

Please see https://tip.golang.org/doc/go1.21#cgo for why this is now failing.

deadprogram commented 11 months ago

Pull request #163 should address this issue.