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

Request to change vendored libuv commit to one of libuv's release tags #38

Open
owenlamont opened this issue Jan 12, 2025 · 9 comments
Open

Comments

@owenlamont
Copy link

owenlamont commented Jan 12, 2025

Hi @Vizonex - thanks so much for creating this package. I've also wanted a Windows version of uvloop for a long time and was stoked to find you actually implemented it.

I've added it as a dependency for my package uv-secure. Now I'm in the process of wanting to create a conda packaged version of uv-secure but I hit a snag in that there's no conda packaged version of winloop yet.

Following the conda-forge guide to contribute it as a package I've created this PR in their staged-recipes repo. I think one recommended and potentially big improvement I could make in that recipe would be to remove the vendored libuv and instead add a dependency to the conda-forge built libuv.

I think/hope that will work but I realised the current vendored commit doesn't correspond to a release tag of libuv - so to skip to the end I was requesting could we update the git submodule of libuv to reference a release tag commit now (and going forward)?

@lschoe
Copy link
Collaborator

lschoe commented Jan 13, 2025

Hi @owenlamont, we're happy to see you're using winloop with your package. So, we started using libuv as a submodule since b11403b. I've now set it to v1.49.2 of libuv, and tested it with Python 3.8-13 without problems. (For a while we've used our own fork of libuv, but that is not needed anymore.)

Does this suit your purposes?

@owenlamont
Copy link
Author

That'd be great. That should work for the conda package... Not sure if you needed any code changes to work with that version of libuv. If so, I will need to wait for you to release to PyPi as conda-forge takes the source distribution from there and rebuilds it in their CI.

@owenlamont
Copy link
Author

My plan on conda-forge was to delete the vendored libuv at build time and add a dependency to the conda-forge built version of libuv... Which I hope will work.

@lschoe
Copy link
Collaborator

lschoe commented Jan 13, 2025

Winloop version 0.1.8 is now on PyPi, built with libuv v1.49.2. This didn't require any changes to the source code.

Hopefully this will let you work with conda-forge easily.

@owenlamont
Copy link
Author

Thank you very much for actioning this so quickly! I mentioned Winloop to Michael Kennedy and it got a shout out today on Python Bytes - hopefully you'll get a bunch more users and contributors soon.

@lschoe
Copy link
Collaborator

lschoe commented Jan 14, 2025

Awesome! I checked it out, looks great.

@owenlamont
Copy link
Author

owenlamont commented Jan 14, 2025

Thanks again, I think you can close this issue. It met the scope of what I requested.

I'm still having problems with my conda-forge recipe... maybe I'll see if someone else can help or attempt it instead of me, I haven't worked at the C / C++ layer for many years.

I realise the conda-forge libuv is compiles to a pre-built dll and .h files, with this sort of file structure:

image

The conda-forge recipe for the libuv library is here

The way winloop is setup it needs the vendor directory and compiles libuv from source right? I don't know if it's possible to get it to work with a prebuilt libuv DLL or if that is impractical.

@lschoe
Copy link
Collaborator

lschoe commented Jan 14, 2025

Well, by default, we want to keep things the same as uvloop, which links libuv statically. But on Windows we're already using some .lib files anyway, relying on standard Windows DLLs, so dynamic linking of libuv might be an option in this respect.

Question is maybe how uvloop is packaged on Conda for Linux. That also works with libuv linked statically in the uvloop .so file.

@owenlamont
Copy link
Author

owenlamont commented Jan 14, 2025

I looked at the uvloop conda-forge recipe - looks like they have some build options to switch between statically or dynamically linking against libuv (as they do use the conda-forge libuv) in their recipe. e.g.

--build-option=--use-system-libuv"

That sounds like the scope of a whole separate task though... shall I raise that and you can debate the merits with the other maintainers?

The configuration setting is here in uvloop but I haven't followed it through to see where and how it is used.

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

2 participants