python-driver icon indicating copy to clipboard operation
python-driver copied to clipboard

FIx windows wheel build

Open dkropachev opened this issue 1 year ago • 0 comments

Currently windows wheels are failing by following reasons:

1. Libev is not linked properly

  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_io_stop
  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_prepare_start
  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_io_start
  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_loop_destroy
  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_loop_new
  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_timer_again
  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_run
  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_async_start
  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_prepare_stop
  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_async_send
  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_unref
  libevwrapper.obj : error LNK2001: unresolved external symbol _ev_timer_stop
  build\lib.win32-cpython-39\cassandra\io\libevwrapper.cp39-win32.pyd : fatal error LNK1120: 12 unresolved externals

Solution

Find a way to link or install it properly.

2. MSVC does not know what '__uint128_t is:

  cassandra\c_shard_info.c(3083): error C2065: '__uint128_t': undeclared identifier
  cassandra\c_shard_info.c(3083): error C2146: syntax error: missing ')' before identifier '__pyx_v_biased_token'
  cassandra\c_shard_info.c(3083): error C2059: syntax error: ')'
  cassandra\c_shard_info.c(3083): error C2059: syntax error: ')'
  cassandra\c_shard_info.c(3083): error C2059: syntax error: ')'

Solution 1

Probably we could code to work wihtout '__uint128_t: https://github.com/scylladb/python-driver/blob/ea8afecf032c8bf4292bf7b35831493e270f74a8/cassandra/c_shard_info.pyx#L39-L43

Solution 2

Switch to clang, which does support this type. Nor setuptool neither distool support clang out of box and making it work will require lot's of magic hacks.

dkropachev avatar Feb 22 '25 14:02 dkropachev