cher-nov / cryptg

Official Telethon extension to provide much faster cryptography for Telegram API requests.
https://pypi.org/project/cryptg/
Creative Commons Zero v1.0 Universal
75 stars 24 forks source link

cant build package #14

Closed H3n-beep closed 2 years ago

H3n-beep commented 2 years ago

during the installation thtrough pip 21.3.1 it fails to build both within and out of a venv OS: Fedora release 35 (Thirty Five) x8 Kernel: 5.14.20-300.fc35.x86_64 python=3.10.0 wheel in ./.venv/lib/python3.10/site-packages (0.36.2) Shell: zsh 5.8 tried the isolate flag and testing in a new venv to no avail the error during building is as follows:

Collecting cryptg
  Using cached cryptg-0.2.post4.tar.gz (17 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: cffi>=1.0.0 in ./.venv/lib64/python3.10/site-packages (from cryptg) (1.15.0)
Requirement already satisfied: pycparser in ./.venv/lib/python3.10/site-packages (from cryptg) (2.21)
Building wheels for collected packages: cryptg
  Building wheel for cryptg (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/akah2/Apps/git-repos/stickerpicker/.venv/bin/python3 /home/akah2/Apps/git-repos/stickerpicker/.venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpypxee_wo
       cwd: /tmp/pip-install-aeglu93w/cryptg_999d51cf9c094de2bbada40343eef68e
  Complete output (23 lines):
  Couldn't find 'stdint.h'
  Couldn't find 'stddef.h'
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.10
  creating build/lib.linux-x86_64-3.10/cryptg
  copying cryptg/__init__.py -> build/lib.linux-x86_64-3.10/cryptg
  running build_ext
  generating cffi module 'build/temp.linux-x86_64-3.10/_tinyaes_with_ige.c'
  creating build/temp.linux-x86_64-3.10
  building '_tinyaes_with_ige' extension
  creating build/temp.linux-x86_64-3.10/build
  creating build/temp.linux-x86_64-3.10/build/temp.linux-x86_64-3.10
  creating build/temp.linux-x86_64-3.10/share
  creating build/temp.linux-x86_64-3.10/share/tiny-AES-c
  gcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/akah2/Apps/git-repos/stickerpicker/.venv/include -I/usr/include/python3.10 -c build/temp.linux-x86_64-3.10/_tinyaes_with_ige.c -o build/temp.linux-x86_64-3.10/build/temp.linux-x86_64-3.10/_tinyaes_with_ige.o
  build/temp.linux-x86_64-3.10/_tinyaes_with_ige.c:50:14: fatal error: pyconfig.h: No such file or directory
     50 | #    include <pyconfig.h>
        |              ^~~~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for cryptg
Failed to build cryptg
ERROR: Could not build wheels for cryptg, which is required to install pyproject.toml-based projects

steps to reproduce: try to install via pip in linux?

Lonami commented 2 years ago

Are you trying to install the version from PyPi or from this repository?

H3n-beep commented 2 years ago

Are you trying to install the version from PyPi or from this repository?

I tried pip but failed and tried to build from repo but due to some dependency rabbithole i gave up

Lonami commented 2 years ago

Does the wheel built by this repository's runner work? If I remember correctly, I left it all setup, I just never got to the point to releasing to PyPi.

H3n-beep commented 2 years ago

well im not technical so how should i build manually?

Lonami commented 2 years ago

To build the current repository version, I believe all you need is to install the Rust toolchain and then the package requirements (with e.g. pip install -r requirements.txt). Once that's done, installing the package (pip install ., if you downloaded the repository and are in the root folder) should do the trick.

You raise a good point, in that this should probably be documented, at least in the README.

H3n-beep commented 2 years ago

after installing rust and manually building it was installed succesfully thanks for the help