-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go 1.6 cgo new pointer rules #18
Comments
Did you get anywhere with this? Or do we have to downgrade Go to get libspotify working? |
Yes I had to downgrade to 1.5 in https://github.com/fabiofalci/sconsify |
Kind of sketchy, but I used this to get around it by calling the same program with the same env/arg/flags plus the |
@op I've been avoiding this for a long time, but now I had to try to fix as the current version of https://github.com/fabiofalci/sconsify is freezing on macOS Sierra. After some tests, I realised that it doesn't freeze if compiled with go 1.8 - using I must say I'm not fluent in C, not even close, but I had to come up with something: We got 2 places sending these pointers to C: The first one I moved the creation to C and then returning to GO to pass to The second one I removed altogether, not passing anything. Both solutions are based on the assumption that it'll never try to support multi sessions. Decided to go for this solution because of this comment on sp_session_create's libspotify: So the session is kept as a variable and used as needed instead of using the one returning from callbacks. And the callbacks struct is now being created on C instead of GO. Please let me know what you think. Thanks. |
Go 1.6 cgo has new rules about passing pointers.
https://github.com/golang/proposal/blob/master/design/12416-cgo-pointers.md
When compiling go-libspotify with 1.6 I'm getting this error:
Triggered by this line https://github.com/op/go-libspotify/blob/master/spotify/libspotify.go#L238
Just to register as I didn't have too much time to looking into this yet.
The text was updated successfully, but these errors were encountered: