Skip to content
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

Grpc.Core will be deprecated soon #30

Open
arthurkehrwald opened this issue Nov 7, 2024 · 9 comments
Open

Grpc.Core will be deprecated soon #30

arthurkehrwald opened this issue Nov 7, 2024 · 9 comments

Comments

@arthurkehrwald
Copy link
Contributor

https://grpc.io/blog/grpc-csharp-future/

We should move to gprc-dotnet

@arthurkehrwald
Copy link
Contributor Author

I tried to replace Grpc.Core with grpc-dotnet and couldn't get it to work. Unity lacks support for HTTP/2, which the old Grpc.Core provided through native code, but grpc-dotnet relies on .NET to do it and the version of .NET Unity runs is too old. So it seems we're stuck with Grpc.Core until Unity moves to at least .NET 6
Useful links:

@freezy
Copy link
Member

freezy commented Nov 8, 2024

At some point (planned for next major), Unity is going to move from Mono to the current .NET runtime. Maybe that will be enough?

Otherwise there seem to be a few workarounds in that other GitHub thread.

@martijnbreet-tomtom
Copy link

martijnbreet-tomtom commented Dec 2, 2024

You can use YetAnotherHttpHandler in combination with grpc-dotnet. One limitation is that Unix Domain Sockets are not supported.

@arthurkehrwald
Copy link
Contributor Author

Thanks for the tip!

@arthurkehrwald
Copy link
Contributor Author

I got a simple hello world client going in Unity with YetAnotherHttpHandler and grpc-dotnet. Haven't tested it with MPF yet. The question is how we package YetAnotherHttpHandler. It's a UPM package, but GRPC and a bunch of other things we need are nuget packages. The current implementation compiles all the nuget stuff into a library that links to Unity. I see three possibilities:

  • We move everything into the Unity project and use https://github.com/xoofx/UnityNuGet to install all the NuGet dependencies. This would require table authors who want to use MPF to add another scoped registry though.
  • We keep the NuGet stuff in a linked library and pass in the HTTP handler from the Unity side. I don't event know if this compiles but why not right? The problem is that YetAnotherHttpHandler has two NuGet dependencies of its own, so we still kind of need that scoped registry.
  • We compile YetAnotherHttpHandler into the library. Most straightforward, but I think we'd have to just copy the code into this repo. Not very elegant.

@freezy What do you think?

@freezy
Copy link
Member

freezy commented Jan 12, 2025

I need to look into how exactly, but you can proxy stuff with Verdaccio, the registry running at registry.visualpinball.org. So we could go point one but through our own registry? What do you think?

I need to spend some time on infrastructure, GitHub just blocked the assetlib repo because of too much traffic. I'll probably set up a self-hosted Gitea instance for this, and update the Verdaccio instance at the same time.

@arthurkehrwald
Copy link
Contributor Author

Yep sounds good. I'll set it up with UnityNuGet for now and then I'll tell you what exactly you need to proxy when it's all working.

@arthurkehrwald
Copy link
Contributor Author

Look like @jsm174 already worked on this before. I just found his misc/grpc-dotnet branch. Why was this not merged? Did it not work?

@jsm174
Copy link
Contributor

jsm174 commented Jan 13, 2025

Hello! I just looked through my notes and some of my discord conversations, and I couldn't find anything on where I was at. (I think it was almost 3 years ago). I do remember that I spent countless hours on this. 😄

It's possible grpc-dotnet wasn't quite working with arm64 at the time. (I do my dev on macos). I'm assuming that it's been so long now all that stuff is probably figured out and working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants