Skip to content

building on MSYS2#60

Closed
totaam wants to merge 0 commit intoVizonex:mainfrom
totaam:main
Closed

building on MSYS2#60
totaam wants to merge 0 commit intoVizonex:mainfrom
totaam:main

Conversation

@totaam
Copy link
Contributor

@totaam totaam commented Jul 21, 2025

No description provided.

@totaam totaam mentioned this pull request Jul 21, 2025
@Vizonex Vizonex self-requested a review July 21, 2025 15:52
@Vizonex
Copy link
Owner

Vizonex commented Jul 21, 2025

_ No description provided. _

be sure to put down -'fixes #60' in the first comment description, so that the issue automatically closes out. Other than that, thanks for opening :)

@Vizonex
Copy link
Owner

Vizonex commented Jul 21, 2025

@totaam The workflows will help. They all use msvc by default so this way if they fail you'll be able to figure out why.

@totaam
Copy link
Contributor Author

totaam commented Jul 21, 2025

This PR can't work as it is, so it's no surprise that the checks fail.
FWIW: you could easily build on MSYS2: https://github.com/msys2/setup-msys2

@Vizonex
Copy link
Owner

Vizonex commented Jul 21, 2025

This PR can't work as it is, so it's no surprise that the checks fail. FWIW: you could easily build on MSYS2: https://github.com/msys2/setup-msys2

It's ok I'm offering code suggestions to help you :)

@@ -250,19 +250,16 @@ def build_extensions(self):
"winloop/loop.pyx"
],
include_dirs=[
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
include_dirs=[
if not ('GCC' in sys.version):
include_dirs=[
"vendor/libuv/src",
"vendor/libuv/src/win",
"vendor/libuv/include"
]

We need to remember to retain compatibility with MSVC. This should be a start...

"vendor/libuv/src/win",
"vendor/libuv/include"
],
extra_link_args=[ # subset of libuv Windows libraries
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
extra_link_args=[ # subset of libuv Windows libraries
extra_link_args=[ # subset of libuv Windows libraries
"Shell32.lib",
"Ws2_32.lib",
"Advapi32.lib",
"iphlpapi.lib",
"Userenv.lib",
"User32.lib",
"Dbghelp.lib",
"Ole32.lib"
] if not ('GCC' in sys.version) else [
"-lShell32",
"-lWs2_32",
"-lAdvapi32",
"-liphlpapi",
"-lUserenv",
"-lUser32",
"-lDbghelp",
"-lOle32",
]

This should help.

winloop/loop.pyx Outdated
def _get_backend_id(self):
"""This method is used by uvloop tests and is not part of the API."""
return uv.uv_backend_fd(self.uvloop)
return int(<uintptr_t> uv.uv_backend_fd(<uv.uv_loop_t*> self.uvloop))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return int(<uintptr_t> uv.uv_backend_fd(<uv.uv_loop_t*> self.uvloop))
return int(<uintptr_t> uv.uv_backend_fd(self.uvloop))

Not sure if recasting self.uvloop is a good idea. it's already defined as uv.uv_loop_t* in the pxd file. But I appreciate your attempt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, this part is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And neither was the re-definition of uv.pipe_t via a cdef extern.

setup.py Outdated
def initialize_options(self):
super().initialize_options()
self.use_system_libuv = False
self.use_system_libuv = True
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this line to be flipped to True since there should be a compiler argument that does that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I only did this because I have absolutely no idea how to toggle it any other way.
./setup.py --with-use-system-libyuv, or any reasonable argument I tried. How does it work?

@Vizonex
Copy link
Owner

Vizonex commented Jul 25, 2025

@totaam You'll want to merge your branch with some of the upcoming changes I made to winloop I left a few changes you could make to make mysys support happen

@totaam
Copy link
Contributor Author

totaam commented Jul 28, 2025

For future reference, this was one of the compilation errors:

winloop/loop.c:113295:104: error: passing argument 2 of 'uv_pipe_open' makes integer from pointer without a cast [-Wint-conversion]
113295 |   __pyx_v_err = uv_pipe_open(((uv_pipe_t *)__pyx_v_handle->__pyx_base.__pyx_base.__pyx_base._handle), ((uv_os_fd_t)__pyx_v_fd));
       |                                                                                                       ~^~~~~~~~~~~~~~~~~~~~~~~
       |                                                                                                        |
       |                                                                                                        void *

I will open a clean new PR.

@totaam totaam mentioned this pull request Jul 28, 2025
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

Successfully merging this pull request may close these issues.

2 participants