webrtc icon indicating copy to clipboard operation
webrtc copied to clipboard

gomobile build broken

Open kevmo314 opened this issue 2 years ago • 2 comments

Your environment.

  • Version: Release or SHA
  • Browser: include version
  • Other Information - stacktraces, related issues, suggestions how to fix, links for us to have context

What did you do?

Running gomobile bind . no longer seems to work. git bisect reported this commit: https://github.com/pion/webrtc/commit/7edfb701e09e89258d4b3235cded99befc8058fd

I'm not actually sure why, perhaps it has to do with exposing an interface as an API? I will do some research and see if I can figure it out.

What did you expect?

What happened?

kevmo314 avatar Nov 28 '23 14:11 kevmo314

maybe show more error message?

suutaku avatar Dec 29 '23 09:12 suutaku

I discovered that this was due to RTPSender having too complex of type signatures for gobind to correctly bind. Unfortunately the fix is not very easy :(

To work around this, if anyone comes across this issue, you can make a wrapper api and gomobile bind that file, so only that api will get compiled instead of the entire pion repository.

kevmo314 avatar Dec 29 '23 15:12 kevmo314

Thanks for sharing how you fixed it @kevmo314! Would it be worth putting shims in a public repo, or do you think it’s better to do it per project?

I don’t think we should change pion/webrtc for this. Unless the changes are simple I don’t want to negatively impact others users not doing mobile.

Sean-Der avatar Mar 31 '24 14:03 Sean-Der

Thanks for sharing how you fixed it @kevmo314! Would it be worth putting shims in a public repo, or do you think it’s better to do it per project?

I don’t think we should change pion/webrtc for this. Unless the changes are simple I don’t want to negatively impact others users not doing mobile.

It is unfortunately quite hard to fix, so we likely can't fix it directly. I think the shims are actually better per project since you can add logic into the shim which is what I'm doing and that cleans up the calling site.

That being said probably some documentation or examples might be worthwhile.

kevmo314 avatar Mar 31 '24 15:03 kevmo314