carderne / signal-export

Export your Signal chats to markdown files with attachments
Other
504 stars 54 forks source link

Build fails due to sqlcipher3-wheels on MacOS Sonoma / Python 3.13 #144

Open SokolskyNikita opened 1 month ago

SokolskyNikita commented 1 month ago

Desktop (please complete the following information):

Describe the bug Installation of signal-export fails during the wheel build process for the sqlcipher3-wheels dependency. The error occurs during the compilation of C code, raising multiple deprecated function warnings and several undeclared function errors. This results in a failed attempt to build an installable wheel for sqlcipher3-wheels.

To reproduce Steps to reproduce the behavior:

  1. Run python3 -m pip install signal-export on macOS 14 (arm64) with Python 3.13.
  2. Observe that the installation fails during the wheel build for sqlcipher3-wheels, throwing errors.

Relevant log lines:

src/connection.c:1157:18: error: call to undeclared function '_PyLong_AsInt'; 
ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

src/connection.c:1491:27: error: call to undeclared function '_PyObject_CallMethodIdObjArgs'; 

src/connection.c:1491:25: error: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]

src/connection.c:1498:17: error: call to undeclared function '_PyUnicode_EqualToASCIIString';

src/connection.c:1526:10: error: call to undeclared function '_PyArg_NoKeywords'; 

src/connection.c:1760:9: error: unknown type name '_PyTime_t'; did you mean 'PyTime_t'?

src/connection.c:1761:13: error: call to undeclared function '_PyTime_FromSecondsObject'; 

src/connection.c:1762:39: error: use of undeclared identifier '_PyTime_ROUND_CEILING'

src/connection.c:1765:24: error: call to undeclared function '_PyTime_AsMilliseconds'; 
SokolskyNikita commented 1 month ago

Ended up bypassing the problem by installing a prebuilt binary from https://pypi.org/project/sqlcipher3-wheels/#files

carderne commented 1 month ago

Haven't tested yet with Python 3.13, presumably sqlcipher3-wheels maintainer needs to make some small changes.

Be great if you can open an issue over at that repo!

pro-sumer commented 1 month ago

I'm also running into this :cry:

Ended up bypassing the problem by installing a prebuilt binary from https://pypi.org/project/sqlcipher3-wheels/#files

Can you please post how you worked around the issue? (Which binary to download? Where to put it?)

SokolskyNikita commented 1 month ago
  1. Go to https://pypi.org/project/sqlcipher3-wheels/#files
  2. Download the latest binary for either arm64 or x86, depending on which Mac you have. In my case I downloaded sqlcipher3_wheels-0.5.2.post1-cp312-cp312-macosx_11_0_arm64.whl
  3. Run pip install sqlcipher3_wheels-0.5.2.post1-cp312-cp312-macosx_11_0_arm64.whl to install it
  4. Run pip install signal-export, which should now succeed

In my case pip is aliased to python3 -m pip to ensure I'm using python3 to install my packages.

SokolskyNikita commented 1 month ago

(Reopening for visibility, until sqlcipher is fixed in pip install)

pro-sumer commented 1 month ago

3. Run pip install sqlcipher3_wheels-0.5.2.post1-cp312-cp312-macosx_11_0_arm64.whl to install it

I have a MacBook Air M1, so I think I should use the same file, but I get this:

➜ pip3 install sqlcipher3_wheels-0.5.2.post1-cp312-cp312-macosx_11_0_arm64.whl
ERROR: sqlcipher3_wheels-0.5.2.post1-cp312-cp312-macosx_11_0_arm64.whl is not a supported wheel on this platform.

I tried the other two macOS related files, but all three give the same error.

pro-sumer commented 1 month ago

I can install it if I rename sqlcipher3_wheels-0.5.2.post1-cp312-cp312-macosx_11_0_arm64.wh into sqlcipher3_wheels-0.5.2.post1-cp313-cp313-macosx_12_0_arm64.wh (my Python version is 3.13.0 and I use macOS Sequoia 15.0.1), but then it fails at runtime with this error:

ModuleNotFoundError: No module named 'sqlcipher3._sqlite3'

What am I doing wrong?

SokolskyNikita commented 1 month ago

I can install it if I rename sqlcipher3_wheels-0.5.2.post1-cp312-cp312-macosx_11_0_arm64.wh into sqlcipher3_wheels-0.5.2.post1-cp313-cp313-macosx_12_0_arm64.wh

You can't just rename it, you have to actually downgrade to Python 3.12.

  1. brew install python@3.12
  2. brew unlink python@3.13 && brew link python@3.12
  3. alias python3='/opt/homebrew/bin/python3.12
  4. Run pip install for the downloaded binary, then install signal-export (see my previous comment)
pro-sumer commented 1 month ago

I was afraid of that... Thank you for this additional information!