-
Notifications
You must be signed in to change notification settings - Fork 14
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
Embed flameshow into the chdig binary #6
Labels
Comments
azat
added a commit
to azat-archive/chdig
that referenced
this issue
Dec 2, 2023
flameshow is a written in python library, that right now is compiled into a single binary using PyOxidize. However it will be "cool" to embed it into chdig binary, so that we can ship one single binary -- chdig. But PyOxidize does not provide support for compiling libraries, so some trickery is required: - we need python distribution with resources that is defined in Starlack (pyoxidize resources) - we need python distribution (pyoxidize generate-python-embedding-artifacts) - pyo3 configure incorrect config that has libm, this should be replaced - PyOxidize configure config that uses incorrect packed-resources (not the one that has our resources from Starlack, but a simple one with python only) - and the cherry on the top is that you need to have pyo3 config *before* running main cargo build -- that's why there is a separate `cargo build -p flameshow` See also comments in flameshow/src/lib.rs and flameshow/build.rs (but in a nutshell Python in Rust is not that stable, maybe I will have to revert this patch eventually, but this was fun anyway!)
azat
added a commit
to azat-archive/chdig
that referenced
this issue
Dec 2, 2023
flameshow is a written in python library, that right now is compiled into a single binary using PyOxidize. However it will be "cool" to embed it into chdig binary, so that we can ship one single binary -- chdig. But PyOxidize does not provide support for compiling libraries, so some trickery is required: - we need python distribution with resources that is defined in Starlack (pyoxidize resources) - we need python distribution (pyoxidize generate-python-embedding-artifacts) - pyo3 configure incorrect config that has libm, this should be replaced - PyOxidize configure config that uses incorrect packed-resources (not the one that has our resources from Starlack, but a simple one with python only) - and the cherry on the top is that you need to have pyo3 config *before* running main cargo build -- that's why there is a separate `cargo build -p flameshow` See also comments in flameshow/src/lib.rs and flameshow/build.rs (but in a nutshell Python in Rust is not that stable, maybe I will have to revert this patch eventually, but this was fun anyway!)
Another downside is that I cannot strip flameshow only easily |
azat
added a commit
that referenced
this issue
Dec 2, 2023
* embed-flameshow: Bump ubuntu version in attempt to overcome linking problems Embedded flameshow (fixes #6)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using PyOxidizer this can be mostly done, but there is some trickery since Starlack in PyOxidizer language does not support building libraries.
Prerequisites
But also there are some things that should be checked first:
Stability
The text was updated successfully, but these errors were encountered: