OpenPrinting / ipp-usb

ipp-usb -- HTTP reverse proxy, backed by IPP-over-USB connection to device
BSD 2-Clause "Simplified" License
135 stars 14 forks source link

FTBFS on 2020-12 Debian sid - cannot use int32(err) (type int32) as type _Ctype_int #18

Closed OdyX closed 3 years ago

OdyX commented 3 years ago

A FTBFS bug was reported in Debian: https://bugs.debian.org/978348, with the following error:

src/github.com/OpenPrinting/ipp-usb/usbio_libusb.go:64:43: cannot use int32(err) (type int32) as type _Ctype_int in argument to _Cfunc_libusb_strerror
alexpevzner commented 3 years ago

Hi @OdyX,

I've hopefully fixed this bug, but I can't reproduce it on any system I build for, so please retest and confirm that the fix works for you, and after that I'll release 0.9.16

ghost commented 3 years ago

I also get this error:

user@pc4:~/ipp16$ make gotags -R . > tags go build -ldflags "-s -w" -tags nethttpomithttp2 github.com/OpenPrinting/ipp-usb ./usbio_libusb.go:64:57: cannot use int32(err) (type int32) as type _Ctype_int in argument to _Cfunc_libusb_strerror make: *** [Makefile:13: all] Error 2 Press any key to continue...

user@pc4:~/ipp16$ go version go version go1.15.6 linux/amd64 Press any key to continue...

ghost commented 3 years ago

With this change, it compiles ok:

62 // String returns string representation of error code
63 func (err UsbErrCode) String() string {
64     return C.GoString(C.libusb_strerror(C.int(err)))
65 }
OdyX commented 3 years ago

@alexpevzner sadly, your patch https://github.com/OpenPrinting/ipp-usb/commit/f532e75cc58be1a83f09d1e6c44e7926c2f70510 doesn't build for me. But @heiner99's above does.

alexpevzner commented 3 years ago

Unfortunately, @heiner99's variant doesn't build on 64-bit Fedora :-(

I've made second attempt to fix this problem. Please, test again.

ghost commented 3 years ago

Latest version compiles OK.

OdyX commented 3 years ago

It builds fine indeed! Thanks for your work!

alexpevzner commented 3 years ago

Released as 0.9.16. Thank you guys for your help!