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

Add Rust support to build-wheel #1030

Open
mhsmith opened this issue Nov 28, 2023 · 4 comments
Open

Add Rust support to build-wheel #1030

mhsmith opened this issue Nov 28, 2023 · 4 comments

Comments

@mhsmith
Copy link
Member

mhsmith commented Nov 28, 2023

Several packages are blocked until we do this – see the cross-references below.

@mhsmith
Copy link
Member Author

mhsmith commented Nov 28, 2023

We have two examples so far of Python/Rust packages being successfully built for Android:

  • The existing tokenizers recipe, which does it by inserting a large block into the setup.py script using a patch. This doesn't easily generalize to other packages, and it hasn't been updated since early 2022, so it will require updates to work with the current version of build-wheel.

  • The new cryptography recipe by @emanuele-f (#827, #657), which requires a large number of manual actions, including rebuilding Python because the Python/Rust bridge PyO3 requires a separate sysconfigdata file for each ABI (see comment in unpackage-target.sh).

A proper solution would work as follows:

  • Alter the build and packging scripts of Python itself (in the target directory) to preserve all the sysconfigdata files.

  • Make build-wheel recognize a meta.yaml build requirement of rust, just as it currently recognizes fortran, and respond by setting up the Rust compiler and environment variables as necessary.

@divyanshluthra
Copy link

sounds like a pretty big task

@IsakTheHacker
Copy link
Contributor

@mhsmith In som other issue, I think you mentioned that the whole package repository is being deprecated. Is Rust support for the build wheel tool (this issue) still a feature that you are willing to receive PRs for or is all work being put here redundant since Python is going to get official Android support anyway?

@mhsmith
Copy link
Member Author

mhsmith commented Aug 13, 2024

I would still accept a PR that fixed this in build-wheel, because the content of that solution would be useful for future work with the upstream Python/Rust ecosystem anyway.

However, it's probably better if you don't work on the "preserve all the sysconfigdata files" step above, because I'll be revisiting the Python build process soon as part of adding Python 3.13 support (#1210).

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

No branches or pull requests

3 participants