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

Publish libpython for WASI #71

Closed
Tracked by #46
assambar opened this issue Mar 1, 2023 · 3 comments
Closed
Tracked by #46

Publish libpython for WASI #71

assambar opened this issue Mar 1, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@assambar
Copy link
Contributor

assambar commented Mar 1, 2023

Is your feature request related to a problem? Please describe.

Allow people to extend python in WASI apps.

Describe the solution you'd like

Should be a fat libpythonXXX.a, which also includes all static libs it depends on.

Describe alternatives you've considered

No response

Additional context

No response

@assambar assambar added the enhancement New feature or request label Mar 1, 2023
@assambar assambar added this to the python-next milestone Mar 1, 2023
@assambar assambar mentioned this issue Mar 1, 2023
8 tasks
@assambar assambar self-assigned this Mar 15, 2023
assambar added a commit to assambar/webassembly-language-runtimes that referenced this issue Mar 15, 2023
assambar added a commit to assambar/webassembly-language-runtimes that referenced this issue Mar 24, 2023
@brettcannon
Copy link

FYI I'm working on https://github.com/brettcannon/cpython-wasi-build to handle pure builds from the CPython code base which will include a zip file with all the build artifacts like libpython*.a.

@assambar
Copy link
Contributor Author

@brettcannon this is great!

Your approach makes it easy to follow as it's self contained! I would love it if we're eventually able to reuse your work.
Will have to check on how easy it is to do that with GH actions locally.

Our approach is to use make with bash scripts for the sake of portability, but due to code reuse, the whole build process is harder to read through.

Out of curiosity, do you have any thoughts about the proper approach for linking to all the extra static libs needed by libpython?

We decided to combine them all into a fat libpython3.11.a, but we're still not convinced this is the right thing to do.
This is what I have in mind -

logStatus "Create libpython3.11-aio.a"

Also, decided to add -Wl,-z,stack-size=524288 -Wl,--stack-first -Wl,--initial-memory=10485760 to ldflags in the pkg-config file to help end users avoid stack overflow errors.

@brettcannon
Copy link

I would love it if we're eventually able to reuse your work.

I would love it if we're eventually able to reuse your work.

Already thinking about that. 😁 python/cpython#103065

Out of curiosity, do you have any thoughts about the proper approach for linking to all the extra static libs needed by libpython?

Nope as I have been worrying about getting that repo up and going (I'm still primarily focused on getting WASI to a tier-2 language for CPython so no one has to worry about it being broken). 😅 I think most people are manually listing the various .a and .o files at link-time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants