Skip to content

compliation fails on OpenBSD 7.3 / Python 3.10 #79

Open
@neonknight

Description

@neonknight

Environment: fresh installation of OpenBSD 7.3 with Python 3.10 and py3-pip (23.0.1). Created a blank venv with python3 -m venv pylzmaenv; cd pylzmaenv; . bin/activate
Compilation requires malloc.h to which the C compiler needs to be pointed using C_INCLUDE_PATH. Without this variable definition compilation would abort due to missing malloc.h:

export C_INCLUDE_PATH=/usr/include/sys
pip install pylzma                     
Collecting pylzma
  Using cached pylzma-0.5.0.tar.gz (4.2 MB)
  Preparing metadata (setup.py) ... done
Installing collected packages: pylzma
  DEPRECATION: pylzma is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for pylzma ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for pylzma did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      running install
      /root/pyzsdtenv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.openbsd-7.3-amd64-cpython-310
      copying py7zlib.py -> build/lib.openbsd-7.3-amd64-cpython-310
      running build_ext
      /tmp/pip-install-4ntag9pg/pylzma_657d4583be2344baa09c051d493ca817/setup.py:105: UnsupportedPlatformWarning: Multithreading is not supported on the platform "openbsd7",
      please contact [email protected] for more informations.
        warn("""\
      building 'pylzma' extension
      creating build/temp.openbsd-7.3-amd64-cpython-310
      creating build/temp.openbsd-7.3-amd64-cpython-310/src
      creating build/temp.openbsd-7.3-amd64-cpython-310/src/compat
      creating build/temp.openbsd-7.3-amd64-cpython-310/src/pylzma
      creating build/temp.openbsd-7.3-amd64-cpython-310/src/sdk
      creating build/temp.openbsd-7.3-amd64-cpython-310/src/sdk/C
      cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -g -fPIC -O2 -pipe -g -O2 -pipe -g -fPIC -DPY_SSIZE_T_CLEAN=1 -DWITH_COMPAT=1 -DPYLZMA_VERSION=0.5.0 -D_7ZIP_ST=1 -Isrc/sdk/C -I/root/pyzsdtenv/include -I/usr/local/include/python3.10 -c src/compat/LzmaCompatDecode.c -o build/temp.openbsd-7.3-amd64-cpython-310/src/compat/LzmaCompatDecode.o
      cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -g -fPIC -O2 -pipe -g -O2 -pipe -g -fPIC -DPY_SSIZE_T_CLEAN=1 -DWITH_COMPAT=1 -DPYLZMA_VERSION=0.5.0 -D_7ZIP_ST=1 -Isrc/sdk/C -I/root/pyzsdtenv/include -I/usr/local/include/python3.10 -c src/pylzma/pylzma.c -o build/temp.openbsd-7.3-amd64-cpython-310/src/pylzma/pylzma.o
      In file included from src/pylzma/pylzma.c:26:
      In file included from /usr/local/include/python3.10/Python.h:122:
      /usr/local/include/python3.10/pythread.h:136:5: error: "Require native threads. See https://bugs.python.org/issue31370"
      #   error "Require native threads. See https://bugs.python.org/issue31370"
          ^
      /usr/local/include/python3.10/pythread.h:145:5: error: unknown type name 'NATIVE_TSS_KEY_T'
          NATIVE_TSS_KEY_T _key;
          ^
      src/pylzma/pylzma.c:296:5: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations]
          PyEval_InitThreads();
          ^
      /usr/local/include/python3.10/ceval.h:122:1: note: 'PyEval_InitThreads' has been explicitly marked deprecated here
      Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
      ^
      /usr/local/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      1 warning and 2 errors generated.
      error: command '/usr/bin/cc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pylzma

note: This is an issue with the package mentioned above, not pip.

As I understand pylzma tries to use a thread model no longer supported by newer Python releases on platforms such as OpenBSD.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions