Skip to content

initenv.sh fails while building wheels for chatmaild and crypt-r #561

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

Open
trollkotze opened this issue Apr 22, 2025 · 2 comments · May be fixed by #565
Open

initenv.sh fails while building wheels for chatmaild and crypt-r #561

trollkotze opened this issue Apr 22, 2025 · 2 comments · May be fixed by #565

Comments

@trollkotze
Copy link

  • Server OS (Operating System) - preferably Debian 12: Debian 12
  • On which OS you run cmdeploy: not running cmdeploy yet, just scripts/initenv.sh, but of course I'd still be on Debian 12 if I got that far

Expected behavior

What did you try to achieve?
I followed the instructions in the README under "Getting Started" to set up a chatmail server.
Under step 2, setting up the Python virtuelenv, I tried to run scripts/initenv.sh

Actual behavior

What happened instead?
There was some error building a wheel for crypt-r.

Steps to reproduce the problem:

 git clone https://github.com/chatmail/relay
 cd relay
 scripts/initenv.sh

Screenshots

Logs

# scripts/initenv.sh
Obtaining file:///root/relay/chatmaild
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Collecting aiosmtpd (from chatmaild==0.2)
  Downloading aiosmtpd-1.4.6-py3-none-any.whl.metadata (6.6 kB)
Collecting iniconfig (from chatmaild==0.2)
  Downloading iniconfig-2.1.0-py3-none-any.whl.metadata (2.7 kB)
Collecting deltachat-rpc-server (from chatmaild==0.2)
  Downloading deltachat_rpc_server-1.159.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl.metadata (1.4 kB)
Collecting deltachat-rpc-client (from chatmaild==0.2)
  Downloading deltachat_rpc_client-1.159.1-py3-none-any.whl.metadata (2.2 kB)
Collecting filelock (from chatmaild==0.2)
  Downloading filelock-3.18.0-py3-none-any.whl.metadata (2.9 kB)
Collecting requests (from chatmaild==0.2)
  Downloading requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting crypt-r>=3.13.1 (from chatmaild==0.2)
  Downloading crypt_r-3.13.1.tar.gz (20 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting atpublic (from aiosmtpd->chatmaild==0.2)
  Downloading atpublic-5.1-py3-none-any.whl.metadata (1.8 kB)
Collecting attrs (from aiosmtpd->chatmaild==0.2)
  Downloading attrs-25.3.0-py3-none-any.whl.metadata (10 kB)
Collecting charset-normalizer<4,>=2 (from requests->chatmaild==0.2)
  Downloading charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (35 kB)
Collecting idna<4,>=2.5 (from requests->chatmaild==0.2)
  Downloading idna-3.10-py3-none-any.whl.metadata (10 kB)
Collecting urllib3<3,>=1.21.1 (from requests->chatmaild==0.2)
  Downloading urllib3-2.4.0-py3-none-any.whl.metadata (6.5 kB)
Collecting certifi>=2017.4.17 (from requests->chatmaild==0.2)
  Downloading certifi-2025.1.31-py3-none-any.whl.metadata (2.5 kB)
Downloading aiosmtpd-1.4.6-py3-none-any.whl (154 kB)
Downloading deltachat_rpc_client-1.159.1-py3-none-any.whl (31 kB)
Downloading deltachat_rpc_server-1.159.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl (10.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.8/10.8 MB 76.1 MB/s eta 0:00:00
Downloading filelock-3.18.0-py3-none-any.whl (16 kB)
Downloading iniconfig-2.1.0-py3-none-any.whl (6.0 kB)
Downloading requests-2.32.3-py3-none-any.whl (64 kB)
Downloading certifi-2025.1.31-py3-none-any.whl (166 kB)
Downloading charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (143 kB)
Downloading idna-3.10-py3-none-any.whl (70 kB)
Downloading urllib3-2.4.0-py3-none-any.whl (128 kB)
Downloading atpublic-5.1-py3-none-any.whl (5.2 kB)
Downloading attrs-25.3.0-py3-none-any.whl (63 kB)
Building wheels for collected packages: chatmaild, crypt-r
  Building editable for chatmaild (pyproject.toml) ... done
  Created wheel for chatmaild: filename=chatmaild-0.2-0.editable-py3-none-any.whl size=1610 sha256=9986a13a9dbda87e92b160a851a63f7bef097756fc354354b0498274aba509a7
  Stored in directory: /tmp/pip-ephem-wheel-cache-wjb0x1rr/wheels/2c/84/39/09b6f54b9bc4c0203a14f196944787670df2f7548a401e8665
  Building wheel for crypt-r (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for crypt-r (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [64 lines of output]
      /tmp/pip-build-env-vqto2d2c/overlay/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated
      !!
      
              ********************************************************************************
              Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).
      
              By 2026-Feb-18, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        corresp(dist, value, root_dir)
      /tmp/pip-build-env-vqto2d2c/overlay/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: Python Software Foundation License
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        dist._finalize_license_expression()
      /tmp/pip-build-env-vqto2d2c/overlay/lib/python3.11/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: Python Software Foundation License
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        self._finalize_license_expression()
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-311
      copying src/crypt_r.py -> build/lib.linux-x86_64-cpython-311
      copying src/crypt.py -> build/lib.linux-x86_64-cpython-311
      running egg_info
      writing src/crypt_r.egg-info/PKG-INFO
      writing dependency_links to src/crypt_r.egg-info/dependency_links.txt
      writing top-level names to src/crypt_r.egg-info/top_level.txt
      reading manifest file 'src/crypt_r.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching '*.h' under directory 'src'
      adding license file 'LICENSE'
      writing manifest file 'src/crypt_r.egg-info/SOURCES.txt'
      running build_ext
      building '_crypt_r' extension
      creating build/temp.linux-x86_64-cpython-311/src
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/root/relay/venv/include -I/usr/include/python3.11 -c src/_crypt_r.c -o build/temp.linux-x86_64-cpython-311/src/_crypt_r.o
      src/_crypt_r.c:6:10: fatal error: Python.h: No such file or directory
          6 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' 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 crypt-r
Successfully built chatmaild
Failed to build crypt-r
ERROR: Failed to build installable wheels for some pyproject.toml based projects (crypt-r)
@trollkotze
Copy link
Author

Okay, I just needed to install python3.11-dev.
Maybe this should be added to the REDAME:

apt install python3.11-dev python3.11-venv

@adonm
Copy link
Contributor

adonm commented Apr 26, 2025

Interestingly, I've been using uv (installed via homebrew) instead of debian packaged python and that seems to pull in crypt-r without building

Example here https://codeberg.org/adonm/adonm-dev-iac/src/branch/main/pyproject.toml is sufficient to have uv sync and uv run scripts/cmdeploy ... work - I could do a pull request with config for uv to work directly (as an alternate to having to initenv first) if anyone interested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants