indygreg / indygreg/PyOxidizer
Ability to create a customized Python library for embedding into non-Rust apps.
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 256
- PR merge metrics
- No merged PRs in 30d
Description
Here's my scenario: I need to build a C++ application that expects to be linked to libpython (which it will use via the standard Py_... API). I want the app to be "xcopy-deployable" on Windows, Linux and Mac. Therefore, it must be entirely self-contained and have no dependencies on optional packages. One must also be careful to not depend on any host OS APIs that are "too new" and may not be present in older versions of the OS (looking at you, glibc >:-)
PyOxidizer solves a very similar problem, which is what drew my attention in this direction. However, as of now PyOxidizer cannot produce artifacts suitable for linking into non-Rust apps (at least not easily - I could probably scavenge what I need from intermediate build outputs).
It would be nice if there were a method for building the following from a configured PythonDistribution:
- A directory tree containing /include and /lib directories (the latter containing libpython and any static libraries it depends upon). Bonus points for making it similar enough to a standard Python distro as to be compatible with CMake's FindPython module.
- A directory tree containing resources to be deployed alongside the compiled app, including .pyc files, any shared libraries that Python runtime depends upon, etc. For my use-case, the ability to load Python modules/resources from memory is not required.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how a configured PythonDistribution is represented and how PyOxidizer's existing build outputs are produced. Define the requested include/lib tree and the separate deployment-resource tree, including libpython, dependent static libraries, .pyc files, and runtime shared libraries. Done means both artifacts can support linking from a non-Rust application and deployment without optional-package dependencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python, rust
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100