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

unable to compile #4

Closed
poedator opened this issue Jul 25, 2023 · 9 comments
Closed

unable to compile #4

poedator opened this issue Jul 25, 2023 · 9 comments
Labels
good first issue Good for newcomers

Comments

@poedator
Copy link

I am trying to install winloop and fail:
winloop from sources 0.0.7.2
python 3.10
pip 23.2
conda
cython 3.0.0
Win 10.

When calling python setup.py build_ext --inplace I get error (trace below).
same error when installing by pip install winloop. just it gets einloop 0.0.6/

(py10) C:\petals\winloop>python setup.py build_ext --inplace
Compiling winloop\loop.pyx because it changed.
[1/1] Cythonizing winloop\loop.pyx
warning: winloop\includes/consts.pxi:1:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:3:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:4:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:5:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:7:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:8:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:10:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:13:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:16:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:21:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:24:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:25:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:1:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:3:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:4:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:5:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:7:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:8:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:10:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:13:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:16:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:21:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:24:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\includes/consts.pxi:25:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\handles/stream.pyx:3:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\handles/process.pyx:364:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\handles/process.pyx:365:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\handles/process.pyx:366:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\handles/process.pyx:367:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: winloop\handles/udp.pyx:351:8: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See cython/cython#4310

Error compiling Cython file:

...

cdef _call_later(self, uint64_t delay, object callback, object args,
                 object context):
    return TimerHandle(self, callback, args, delay, context)

cdef void _handle_exception(self, object ex):
     ^

winloop\loop.pyx:719:9: Signature not compatible with previous declaration

Error compiling Cython file:

...
cdef _call_soon_handle(self, Handle handle)

cdef _call_later(self, uint64_t delay, object callback, object args,
                 object context)

cdef void _handle_exception(self, object ex) noexcept
                           ^

winloop\loop.pxd:149:31: Previous declaration is here
warning: winloop\handles/basetransport.pyx:214:9: Compatible but non-identical C method '_is_reading' not redeclared in definition part of extension type 'UVBaseTransport'. This may cause incorrect vtables to be generated.
warning: winloop\handles/basetransport.pxd:54:25: Previous declaration is here
warning: winloop\handles/stream.pyx:284:9: Compatible but non-identical C method '_is_reading' not redeclared in definition part of extension type 'UVStream'. This may cause incorrect vtables to be generated.
warning: winloop\handles/basetransport.pxd:54:25: Previous declaration is here
warning: winloop\handles/udp.pyx:135:9: Compatible but non-identical C method '_is_reading' not redeclared in definition part of extension type 'UDPTransport'. This may cause incorrect vtables to be generated.
warning: winloop\handles/basetransport.pxd:54:25: Previous declaration is here

Error compiling Cython file:

...
# === overloads ===

cdef _new_socket(self)
cdef size_t _get_write_buffer_size(self) noexcept

cdef bint _is_reading(self)
                     ^

winloop\handles/basetransport.pxd:54:25: C method '_is_reading' is declared but not defined
Traceback (most recent call last):
File "C:\petals\winloop\setup.py", line 91, in
do_installation()
File "C:\petals\winloop\setup.py", line 57, in do_installation
ext_modules=cythonize(ext),
File "c:\conda\envs\py10\lib\site-packages\Cython\Build\Dependencies.py", line 1134, in cythonize
cythonize_one(*args)
File "c:\conda\envs\py10\lib\site-packages\Cython\Build\Dependencies.py", line 1301, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: winloop\loop.pyx

@Vizonex
Copy link
Owner

Vizonex commented Jul 28, 2023 via email

@Vizonex
Copy link
Owner

Vizonex commented Jul 31, 2023

@poedator I may have made a temporary fix and that's to drop the _is_reading() noexcept Keyword on it which may have been the reason for your problem. Let me update the library with these changes I'm looking for some more fixes to uploading all the Wheels to pypi first then I'll actually update this library afterwards but until then those DEF Keywords look to be like a new threat/problem in the future so I'll contact the uvloop devs about this change as well to see what both of our libraries can implement to fix the compiler warnings.

@Vizonex
Copy link
Owner

Vizonex commented Jul 31, 2023

@poedator
273dd89
See if cloning and compiling the main branch fixes your issue, I'll handle dropping the DEF Keywords soon as I can, seems to be deprecated by the main Cython Devs due to changes from Pyrex cython/cython#4310

@Vizonex
Copy link
Owner

Vizonex commented Jul 31, 2023

@poedator I found the real problem and I fixed it now let me change a few things. turns out we need to keep some of the noexcept keywords but I'll just have to upload my files to github so I don't have to make a bunch of mini pull-requests...

@Vizonex
Copy link
Owner

Vizonex commented Jul 31, 2023

@poedator see: a1394ea

@Vizonex
Copy link
Owner

Vizonex commented Jul 31, 2023

@poedator I'll mark this as Completed when you can tell me that your end compiled the library correctly.

@poedator
Copy link
Author

poedator commented Aug 1, 2023

Hi, @Vizonex !
Thank you for your quick response and fixes.
I pulled a1394ea and was able to compile and install it. Had to update to Visual Studio-2022, for 2019 was missing 'io.h'.

Check out the compilation output and test results here:
https://gist.github.com/poedator/14a1c2c0fd0e784b5a3227a7f63e7a54

  1. there were warnings from compiler - you may want to act on them.
  2. I ran the test code from this repo front page test result was Ran 2 tests in 2.173s. Not sure it this was good or not - ehere to check the Asyncio Event Loop Policy?

@Vizonex
Copy link
Owner

Vizonex commented Aug 1, 2023 via email

@Vizonex Vizonex closed this as completed Aug 2, 2023
@poedator
Copy link
Author

poedator commented Aug 3, 2023

I noticed that after installation frou sources the winloop module does not appear in pip list output. It also makes my VS Code complain. Yet it is importable in python. Not a blocker, but you may want to take a look.

@Vizonex Vizonex added the good first issue Good for newcomers label Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants