-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
GH-102404, GH-100956: Document how to do a WASI build #105251
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5f0cb3c
Touch up Markdown sections
brettcannon 80361bd
Document getting a build Python
brettcannon 60cd12e
checkpoint
brettcannon 019dcb5
Document building the host/WASI Python
brettcannon f399888
Fix a typo
brettcannon df1cf20
Merge branch 'document-wasi-build' of https://github.com/brettcannon/…
brettcannon 70da5a2
Drop a TODO marker
brettcannon 851e3e9
Simplify instructions
brettcannon 827d1ec
Add a `build_wasi.sh` script
brettcannon 0c4e4c7
Add a news entry
brettcannon dd7d405
Merge branch 'main' into document-wasi-build
brettcannon 2f8d525
Make all the paths in `build_wasi.sh` absolute
brettcannon f13b10a
Merge branch 'document-wasi-build' of https://github.com/brettcannon/…
brettcannon cf680c3
Address review comments
brettcannon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add a
build_wasi.sh script
- Loading branch information
commit 827d1ecbbd64bd31932ba89628aceca32176c07e
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #!/usr/bin/bash | ||
|
|
||
| set -e -x | ||
|
|
||
| if [ ! -f Modules/Setup.local ]; then | ||
| touch Modules/Setup.local | ||
| fi | ||
|
|
||
| # TODO: check if `make` and `pkgconfig` are installed | ||
brettcannon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
brettcannon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Create the build Python. | ||
| mkdir -p builddir/build | ||
| pushd builddir/build | ||
| ../../configure -C | ||
| make -s -j 4 all | ||
| export PYTHON_VERSION=`./python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")'` | ||
| popd | ||
|
|
||
| # Create the host/WASI Python. | ||
| export CONFIG_SITE="../../Tools/wasm/config.site-wasm32-wasi" | ||
| export HOSTRUNNER="wasmtime run --mapdir /::../.. --env PYTHONPATH=/builddir/wasi/build/lib.wasi-wasm32-$PYTHON_VERSION python.wasm --" | ||
|
|
||
| mkdir -p builddir/wasi | ||
| pushd builddir/wasi | ||
| ../../Tools/wasm/wasi-env \ | ||
| ../../configure \ | ||
| -C \ | ||
| --host=wasm32-unknown-wasi \ | ||
| --build=$(../../config.guess) \ | ||
| --with-build-python=../build/python | ||
| make -s -j 4 all | ||
| # Create a helper script for executing the host/WASI Python. | ||
| printf "#!/bin/sh\nexec $HOSTRUNNER \"\$@\"\n" > run_wasi.sh | ||
| chmod 755 run_wasi.sh | ||
| ./run_wasi.sh --version | ||
| popd | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.