facebook / sapling

A Scalable, User-Friendly Source Control System.
https://sapling-scm.com
GNU General Public License v2.0
5.91k stars 269 forks source link

Arch and python 3.12 linking troubles #895

Open nairb774 opened 1 month ago

nairb774 commented 1 month ago

It looks like Arch recently moved to python 3.12 which seems to be incompatible with Sapling. I've been building sapling from source, and after the upgrade, the command failed to run due to the shared libraries being swapped out. Rebuilding Sapling to use 3.11 wasn't very straight forward, and while it might be user error on my part, I figured it would be worth documenting the things I needed to do to get it working, and possibly open up a discussion around a better approach.

What eventually worked:

The use of RUSTFLAGS in this way feels fragile. There looks to be code which attempts to do version detection, maybe there is something missing somewhere?

Before playing with RUSTFLAGS at all, I tried to use pyenv to make a python 3.11 install available, but that didn't seem to work. Additionally, I tried setting up a virtualenv with the correct version of python. That also didn't work.

Log file of a failed build showing the linking errors. This log was generated with both python 3.12 and 3.11 installed at the system level. log.txt

markbt commented 1 month ago

Sapling uses the rust-cpython crate to interface with Python. That crate hasn't had support for Python 3.12 implemented yet (see https://github.com/dgrunwald/rust-cpython/issues/294), so Python 3.12 isn't supported in Sapling either.