Skip to content
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

Arch and python 3.12 linking troubles #895

Closed
nairb774 opened this issue May 14, 2024 · 3 comments
Closed

Arch and python 3.12 linking troubles #895

nairb774 opened this issue May 14, 2024 · 3 comments

Comments

@nairb774
Copy link

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:

  • Install python3.11 from at the system level via AUR.
  • Run: RUSTFLAGS="-C link-args=-lpython3.11" make oss

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
Copy link
Contributor

markbt commented May 14, 2024

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

facebook-github-bot pushed a commit that referenced this issue Jun 24, 2024
Summary: Pull Request resolved: facebookincubator/zstrong#895

Differential Revision: D58944664

fbshipit-source-id: 47c15cc6b6531c9d37520a3714f2e46e5c4411a8
@nairb774
Copy link
Author

nairb774 commented Aug 1, 2024

I just rebuilt Sapling at 375f1ca and it seems to build without additional config. In other words, this looks fixed but I'll leave it open for someone who knows better to say that things are working as intended.

@sggutier
Copy link
Contributor

Closing this issue since this got fixed when dgrunwald/rust-cpython#295 got merged

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

No branches or pull requests

3 participants