timonwong / cyksuid

Fast Python implementation of KSUID (K-Sortable Globally Unique IDs) using Cython
BSD 3-Clause "New" or "Revised" License
52 stars 2 forks source link

Cannot install with python 3.12.3 on Mac OS #36

Closed ihorh closed 1 month ago

ihorh commented 5 months ago
 % uname -oprv
Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:19:22 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8112 arm
 % python --version   
Python 3.12.3
 % /usr/bin/clang --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

when I run

pip install cyksuid

it ends up with the error:

Building wheels for collected packages: cyksuid
  Building wheel for cyksuid (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for cyksuid (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [130 lines of output]
      <string>:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-14.0-arm64-cpython-312
      creating build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/ksuid.py -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/__init__.py -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/__version__.py -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/hints.py -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/v2.py -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/fast_base62.pyi -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/_ksuid.pyi -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/py.typed -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/fast_base62.pyx -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/_ksuid.pyx -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/_ksuid.pxd -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/fast_base62.pxd -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/cbase62.h -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/ksuidlite.h -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/cbase62.cc -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/_ksuid.cpp -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      copying cyksuid/fast_base62.cpp -> build/lib.macosx-14.0-arm64-cpython-312/cyksuid
      running build_ext
      --- Checking compiler support for option '-Wno-deprecated-register' ... yes
      --- Checking compiler support for option '-Wno-write-strings' ... yes
      --- Checking compiler support for option '-Wno-invalid-offsetof' ... yes
      --- Checking compiler support for option '-Wno-sign-compare' ... yes
      --- Checking compiler support for option '-Wno-unused-variable' ... yes
      --- Checking compiler support for option '-Wno-shorten-64-to-32' ... yes
      --- Checking compiler support for option '-std=c++17' ... yes
      --- Checking compiler support for option '-O3' ... yes
      --- Checking compiler support for option '-fno-math-errno' ... yes
      --- Checking compiler support for option '-fno-trapping-math' ... yes
      --- Checking compiler support for option '-flto' ... yes
      building 'cyksuid.fast_base62' extension
      creating build/temp.macosx-14.0-arm64-cpython-312
      creating build/temp.macosx-14.0-arm64-cpython-312/cyksuid
      clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -I/Users/jaspery/prj/a5c-server-workspace/user_management/.venv/include -I/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c cyksuid/cbase62.cc -o build/temp.macosx-14.0-arm64-cpython-312/cyksuid/cbase62.o -Wno-deprecated-register -Wno-write-strings -Wno-invalid-offsetof -Wno-sign-compare -Wno-unused-variable -Wno-shorten-64-to-32 -std=c++17 -O3 -fno-math-errno -fno-trapping-math -flto
      clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -I/Users/jaspery/prj/a5c-server-workspace/user_management/.venv/include -I/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c cyksuid/fast_base62.cpp -o build/temp.macosx-14.0-arm64-cpython-312/cyksuid/fast_base62.o -Wno-deprecated-register -Wno-write-strings -Wno-invalid-offsetof -Wno-sign-compare -Wno-unused-variable -Wno-shorten-64-to-32 -std=c++17 -O3 -fno-math-errno -fno-trapping-math -flto
      cyksuid/fast_base62.cpp:2694:36: error: no member named 'curexc_traceback' in '_ts'
              PyObject* tmp_tb = tstate->curexc_traceback;
                                 ~~~~~~  ^
      cyksuid/fast_base62.cpp:2697:21: error: no member named 'curexc_traceback' in '_ts'
                  tstate->curexc_traceback = tb;
                  ~~~~~~  ^
      cyksuid/fast_base62.cpp:3659:27: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
          return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
                                ^
      cyksuid/fast_base62.cpp:1283:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      cyksuid/fast_base62.cpp:3671:36: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
          return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
                                         ^
      cyksuid/fast_base62.cpp:1283:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      cyksuid/fast_base62.cpp:3675:56: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
          if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
                                                             ^
      cyksuid/fast_base62.cpp:1283:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      cyksuid/fast_base62.cpp:3696:9: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
              __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
              ^
      cyksuid/fast_base62.cpp:1290:16: note: expanded from macro '__PYX_PY_DICT_LOOKUP_IF_MODIFIED'
          if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
                     ^
      cyksuid/fast_base62.cpp:1283:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      cyksuid/fast_base62.cpp:3696:9: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
              __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
              ^
      cyksuid/fast_base62.cpp:1294:30: note: expanded from macro '__PYX_PY_DICT_LOOKUP_IF_MODIFIED'
              __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
                                   ^
      cyksuid/fast_base62.cpp:1283:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      cyksuid/fast_base62.cpp:4035:55: error: no member named 'ob_digit' in '_longobject'
                  const digit* digits = ((PyLongObject*)x)->ob_digit;
                                        ~~~~~~~~~~~~~~~~~~  ^
      cyksuid/fast_base62.cpp:4090:55: error: no member named 'ob_digit' in '_longobject'
                  const digit* digits = ((PyLongObject*)x)->ob_digit;
                                        ~~~~~~~~~~~~~~~~~~  ^
      cyksuid/fast_base62.cpp:4231:55: error: no member named 'ob_digit' in '_longobject'
                  const digit* digits = ((PyLongObject*)x)->ob_digit;
                                        ~~~~~~~~~~~~~~~~~~  ^
      cyksuid/fast_base62.cpp:4286:55: error: no member named 'ob_digit' in '_longobject'
                  const digit* digits = ((PyLongObject*)x)->ob_digit;
                                        ~~~~~~~~~~~~~~~~~~  ^
      cyksuid/fast_base62.cpp:4774:47: error: no member named 'ob_digit' in '_longobject'
          const digit* digits = ((PyLongObject*)b)->ob_digit;
                                ~~~~~~~~~~~~~~~~~~  ^
      5 warnings and 7 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cyksuid
Failed to build cyksuid
ERROR: Could not build wheels for cyksuid, which is required to install pyproject.toml-based projects
caldempsey commented 2 months ago

Running into this issue.

timonwong commented 1 month ago

37

v2.1.0 released with binary wheels

Sorry for long delay, the main problem here is the cython dependency is out of date so even building from source will not work.

And since the limtation of time_t(32bit) in i686 linux, now linux/i686 binary wheels are disabled by default

caldempsey commented 1 month ago

Amazing thank you so much!