trezor / trezord-go

:smiling_imp: Trezor Communication Daemon (written in Go)
GNU Lesser General Public License v3.0
244 stars 146 forks source link

installing from source: go get github.com/trezor/trezord-go doesn't work! #212

Closed sfindeisen closed 3 years ago

sfindeisen commented 3 years ago

The command go get github.com/trezor/trezord-go, given on the main page, floods the screen with thousands of errors.

It looks like this:

$ go build github.com/trezor/trezord-go
# github.com/trezor/trezord-go/usb/lowlevel/libusb
go/src/github.com/trezor/trezord-go/usb/lowlevel/libusb/libusb.go:415:21: could not determine kind of name for C.GoBytes

[... more errors like that ...]

go/src/github.com/trezor/trezord-go/usb/lowlevel/libusb/libusb.go:986:45: could not determine kind of name for C.uint8_t
cgo: 
gcc errors for preamble:
In file included from go/src/github.com/trezor/trezord-go/usb/lowlevel/libusb/libusb.go:45:
go/src/github.com/trezor/trezord-go/usb/lowlevel/libusb/c/libusbi.h: In function 'usbi_log':
go/src/github.com/trezor/trezord-go/usb/lowlevel/libusb/c/libusbi.h:285:49: error: expected declaration specifiers before 'PRINTF_FORMAT'
  const char *function, const char *format, ...) PRINTF_FORMAT(4, 5);
                                                 ^~~~~~~~~~~~~
go/src/github.com/trezor/trezord-go/usb/lowlevel/libusb/c/libusbi.h:406:31: error: storage class specified for parameter 'usbi_default_context'
 extern struct libusb_context *usbi_default_context;
                               ^~~~~~~~~~~~~~~~~~~~

[... thousands of errors ...]

In file included from go/src/github.com/trezor/trezord-go/usb/lowlevel/libusb/libusb.go:45:
go/src/github.com/trezor/trezord-go/usb/lowlevel/libusb/c/libusbi.h:284:6: error: old-style parameter declarations in prototyped function definition
 void usbi_log(struct libusb_context *ctx, enum libusb_log_level level,
      ^~~~~~~~
cgo-generated-wrapper:1: error: expected '{' at end of input

My go version:

$ go version
go version go1.15.6 linux/amd64

What is the recommended way to install from source?

prusnak commented 3 years ago

Right, the PRINTF_FORMAT definition is missing.

Reintroduced in 4e9dbc37477183bd65a21a2b2394e658a072b9a2

The master should build again. Thanks for the report