badfortrains / spotcontrol

open spotify connect controller
MIT License
105 stars 14 forks source link

Unable to compile using gopherjs #12

Open faejr opened 7 years ago

faejr commented 7 years ago

I've made an attempt to compile using the example and writing my own basic code and it keeps failing upon compiling socket for use by the library. Is this a known issue perhaps with your library or gopherjs in general?

spotcontrol git:master ❯ gopherjs build
../../../go/src/golang.org/x/net/internal/socket/cmsghdr.go:9:10: undeclared name: cmsghdr
../../../go/src/golang.org/x/net/internal/socket/cmsghdr.go:10:10: undeclared name: cmsghdr
../../../go/src/golang.org/x/net/internal/socket/cmsghdr.go:11:10: undeclared name: cmsghdr
../../../go/src/golang.org/x/net/internal/socket/cmsghdr_bsd.go:9:10: undeclared name: cmsghdr
../../../go/src/golang.org/x/net/internal/socket/msghdr_bsd.go:11:10: undeclared name: msghdr
../../../go/src/golang.org/x/net/internal/socket/msghdr_bsd.go:11:28: undeclared name: iovec
../../../go/src/golang.org/x/net/internal/socket/msghdr_bsd.go:26:10: undeclared name: msghdr
../../../go/src/golang.org/x/net/internal/socket/msghdr_bsd.go:33:10: undeclared name: msghdr
../../../go/src/golang.org/x/net/internal/socket/msghdr_bsd.go:37:10: undeclared name: msghdr
../../../go/src/golang.org/x/net/internal/socket/msghdr_bsdvar.go:9:10: undeclared name: msghdr
../../../go/src/golang.org/x/net/internal/socket/msghdr_bsdvar.go:9:10: too many errors
badfortrains commented 6 years ago

Hm not sure, I haven't seen that error before. I did run into a compile error with the binding file when I just tried to compile it. Fixed that. I downloaded the latest golang (1.9) and updated gopherjs and it seemed to compile fine.

Could you try pulling down latest master, updating go and updating gopherjs?

faejr commented 6 years ago

Very strange, I keep getting the same issue. I updated go and gopherjs and then made a clean clone of spotcontrol, and made an attempt to compile the spot-chrome example without any success. It's a very strange issue. But perhaps I should try opening an issue with gopherjs and see what they have to say instead

badfortrains commented 6 years ago

I just tried this on a clean ubuntu install and now I'm seeing the same issue you're seeing. Haven't found a fix yet, but looking into it

badfortrains commented 6 years ago

Looks like it's an issue with the mdns library. The mdns feature isn't used in the chrome extension, so I created a branch that removes it and that seems to compile fine (https://github.com/badfortrains/spotcontrol/tree/nodiscovery).

I'll look into why that is failing, but you should be able to use that branch in the meantime.