emkor / napi-py

CLI tool for downloading subtitles from napiprojekt.pl
GNU General Public License v3.0
7 stars 2 forks source link

Failed to build pylzma #4

Open wrazik opened 1 week ago

wrazik commented 1 week ago

It fails to build pylzma with following output:

  • Installing pylzma (0.5.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  /tmp/tmpab8jy03d/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
    warnings.warn(msg)
  /tmp/tmpab8jy03d/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-312
  copying py7zlib.py -> build/lib.linux-x86_64-cpython-312
  running build_ext
  <string>:105: UnsupportedPlatformWarning: Multithreading is not supported on the platform "linux",
  please contact mail@joachim-bauch.de for more informations.
  building 'pylzma' extension
  creating build/temp.linux-x86_64-cpython-312
  creating build/temp.linux-x86_64-cpython-312/src
  creating build/temp.linux-x86_64-cpython-312/src/compat
  creating build/temp.linux-x86_64-cpython-312/src/pylzma
  creating build/temp.linux-x86_64-cpython-312/src/sdk
  creating build/temp.linux-x86_64-cpython-312/src/sdk/C
  gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fPIC -DPY_SSIZE_T_CLEAN=1 -DWITH_COMPAT=1 -DPYLZMA_VERSION=0.5.0 -D_7ZIP_ST=1 -Isrc/sdk/C -I/tmp/tmpab8jy03d/.venv/include -I/usr/include/python3.12 -c src/compat/LzmaCompatDecode.c -o build/temp.linux-x86_64-cpython-312/src/compat/LzmaCompatDecode.o
  gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fPIC -DPY_SSIZE_T_CLEAN=1 -DWITH_COMPAT=1 -DPYLZMA_VERSION=0.5.0 -D_7ZIP_ST=1 -Isrc/sdk/C -I/tmp/tmpab8jy03d/.venv/include -I/usr/include/python3.12 -c src/pylzma/pylzma.c -o build/temp.linux-x86_64-cpython-312/src/pylzma/pylzma.o
  src/pylzma/pylzma.c: In function ‘PyInit_pylzma’:
  src/pylzma/pylzma.c:296:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
    296 |     PyEval_InitThreads();
        |     ^~~~~~~~~~~~~~~~~~
  In file included from /usr/include/python3.12/Python.h:95,
                   from src/pylzma/pylzma.c:26:
  /usr/include/python3.12/ceval.h:132:37: note: declared here
    132 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
        |                                     ^~~~~~~~~~~~~~~~~~
  gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fPIC -DPY_SSIZE_T_CLEAN=1 -DWITH_COMPAT=1 -DPYLZMA_VERSION=0.5.0 -D_7ZIP_ST=1 -Isrc/sdk/C -I/tmp/tmpab8jy03d/.venv/include -I/usr/include/python3.12 -c src/pylzma/pylzma_aes.c -o build/temp.linux-x86_64-cpython-312/src/pylzma/pylzma_aes.o
  src/pylzma/pylzma_aes.c:158:5: error: initialization of ‘long int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
    158 |     NULL,                                /* printfunc  tp_print;   */
        |     ^~~~
  src/pylzma/pylzma_aes.c:158:5: note: (near initialization for ‘CAESDecrypt_Type.tp_vectorcall_offset’)
  error: command '/usr/bin/gcc' failed with exit code 1

  at /usr/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
      160│ 
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│ 
      163│             if error is not None:
    → 164│                 raise error from None
      165│ 
      166│             return path
      167│ 
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with pylzma (0.5.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pylzma (==0.5.0)"'.
emkor commented 1 week ago

Just did a new patch release, added testing with Python 3.11 and 3.12, bumped dependencies. Seems that napi-py is building correctly both on CI (ubuntu 22.04) and for me locally (debian and Poetry 1.8.3) across all supported Python versions.

The log line indicates there's a problem with building pylzma 0.5.0 (latest), not napi-py itself. Maybe raise a ticket to pylzma @wrazik ?