forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 2
Add pkg config support #5
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
Open
zebreus
wants to merge
8
commits into
3.13.0-wasix
Choose a base branch
from
add-pkg-config-support
base: 3.13.0-wasix
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d18da49
Add pkg-config and wasix-clang support
zebreus 4835ff4
Remove wasix-clang usage
zebreus 077d615
Add cpp symbols for wasixcc build
zebreus d22838f
Add wasixcc compiler flags
zebreus 0bc74b0
Adjust configure wrapper
zebreus 03af7bb
Disable parallel building for better debugging
zebreus ed7bfb1
Adjust configure wrapper
zebreus 7bb7874
Move wasixcc env vars to the main build script
zebreus 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
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
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 |
|---|---|---|
| @@ -1,125 +1,25 @@ | ||
| #!/usr/bin/env bash | ||
| set -ex | ||
|
|
||
| WORKDIR=$(pwd) | ||
| ARTIFACT_ROOT="${WORKDIR}/artifacts" | ||
|
|
||
| if test -z "$WASIX_SYSROOT" ; then | ||
| echo "WASIX_SYSROOT is not set. Please set it to the sysroot path (Something like /home/lennart/Documents/wasix-libc/sysroot)." | ||
| if test -z "$WASIXCC_SYSROOT" ; then | ||
| echo "WASIXCC_SYSROOT is not set. Please set it to the sysroot path (Something like /home/lennart/Documents/wasix-libc/sysroot)." | ||
| exit 1 | ||
|
zebreus marked this conversation as resolved.
|
||
| fi | ||
|
|
||
| export WASI_SDK_VERSION=25 | ||
|
|
||
| export WASI_SDK_PATH="${ARTIFACT_ROOT}/wasix-libs/wasi-sdk" | ||
| if ! test -e "$WASI_SDK_PATH/.ready" ; then | ||
| rm -rf $WASI_SDK_PATH || true | ||
| mkdir -p $WASI_SDK_PATH | ||
| chmod -R a+rwx $(dirname $WASI_SDK_PATH) | ||
| curl -s -S --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WASI_SDK_VERSION/wasi-sdk-$WASI_SDK_VERSION.0-x86_64-linux.tar.gz | \ | ||
| tar --strip-components 1 --directory $WASI_SDK_PATH --extract --gunzip | ||
| touch $WASI_SDK_PATH/.ready | ||
| fi | ||
|
|
||
| WASMER_DIR="${ARTIFACT_ROOT}/wasmer" | ||
| WASIX_LIBC_TAG="v2024-07-08.1" | ||
|
|
||
| export OPENSSL_DIR="${ARTIFACT_ROOT}/wasix-libs/openssl" | ||
| if ! test -e "$OPENSSL_DIR/.ready" ; then | ||
| rm -rf $OPENSSL_DIR || true | ||
| mkdir -p $(dirname $OPENSSL_DIR) | ||
| chmod -R a+rwx $(dirname $OPENSSL_DIR) | ||
| git clone https://github.com/wasix-org/openssl $OPENSSL_DIR | ||
| cd $OPENSSL_DIR | ||
| ./wasix.sh | ||
| mkdir -p lib | ||
| cp libcrypto.a lib/libcrypto.a | ||
| cp libssl.a lib/libssl.a | ||
| touch "$OPENSSL_DIR/.ready" | ||
| fi | ||
|
|
||
| export CROSS_BUILD_PYTHON=cross-build/build | ||
| export CROSS_BUILD_WASIX=cross-build/wasix | ||
|
|
||
| export WASIX_INSTALL=${ARTIFACT_ROOT}/wasix-install | ||
| mkdir -p $WASIX_INSTALL | ||
|
|
||
| # zlib | ||
| export ZLIB_DIR="${ARTIFACT_ROOT}/wasix-libs/zlib" | ||
| if ! test -e "$ZLIB_DIR/.ready" ; then | ||
| rm -rf $ZLIB_DIR || true | ||
| mkdir -p $(dirname $ZLIB_DIR) | ||
| chmod -R a+rwx $(dirname $ZLIB_DIR) | ||
| git clone https://github.com/wasix-org/zlib $ZLIB_DIR | ||
| cd $ZLIB_DIR | ||
| ./wasix.sh | ||
| touch "$ZLIB_DIR/.ready" | ||
| fi | ||
|
|
||
| # liblzma | ||
| export LIBLZMA_DIR="${ARTIFACT_ROOT}/wasix-libs/liblzma" | ||
| if ! test -e "$LIBLZMA_DIR/.ready" ; then | ||
| rm -rf $LIBLZMA_DIR || true | ||
| mkdir -p $(dirname $LIBLZMA_DIR) | ||
| chmod -R a+rwx $(dirname $LIBLZMA_DIR) | ||
| git clone https://github.com/wasix-org/liblzma $LIBLZMA_DIR | ||
| cd $LIBLZMA_DIR | ||
| ./wasix.sh | ||
| cp src/liblzma/.libs/liblzma.a liblzma.a | ||
| touch "$LIBLZMA_DIR/.ready" | ||
| fi | ||
|
|
||
|
|
||
| export UTIL_LINUX_DIR="${ARTIFACT_ROOT}/wasix-libs/util-linux" | ||
| if ! test -e "$UTIL_LINUX_DIR/.ready" ; then | ||
| rm -rf $UTIL_LINUX_DIR || true | ||
| mkdir -p $(dirname $UTIL_LINUX_DIR) | ||
| chmod -R a+rwx $(dirname $UTIL_LINUX_DIR) | ||
| git clone https://github.com/wasix-org/util-linux $UTIL_LINUX_DIR | ||
| cd $UTIL_LINUX_DIR | ||
| ./wasix.sh | ||
| cp -v .libs/libuuid.a . | ||
| touch "$UTIL_LINUX_DIR/.ready" | ||
| fi | ||
|
|
||
| export NCURSES_DIR="${ARTIFACT_ROOT}/wasix-libs/ncurses" | ||
| if ! test -e "$NCURSES_DIR/.ready" ; then | ||
| rm -rf $NCURSES_DIR || true | ||
| mkdir -p $(dirname $NCURSES_DIR) | ||
| chmod -R a+rwx $(dirname $NCURSES_DIR) | ||
| git clone https://github.com/wasix-org/ncurses -b wasix-support $NCURSES_DIR | ||
| cd $NCURSES_DIR | ||
| ./wasix.sh | ||
| touch "$NCURSES_DIR/.ready" | ||
| fi | ||
|
|
||
| export READLINE_DIR="${ARTIFACT_ROOT}/wasix-libs/readline/readline" | ||
| if ! test -e "$READLINE_DIR/.ready" ; then | ||
| rm -rf $READLINE_DIR || true | ||
| mkdir -p $(dirname $READLINE_DIR) | ||
| chmod -R a+rwx $(dirname $READLINE_DIR) | ||
| git clone https://github.com/wasix-org/readline $READLINE_DIR | ||
| cd $READLINE_DIR | ||
| WASIX_NCURSES=$NCURSES_DIR ./wasix.sh | ||
| touch "$READLINE_DIR/.ready" | ||
| fi | ||
|
|
||
| cd $WORKDIR | ||
|
|
||
| rm Lib/multiprocessing/__pycache__/* || true | ||
| export WASI_SDK_PATH="${WASIX_LLVM:-$(dirname $(dirname $(which clang)))}" | ||
| export WASIX_PKG_CONFIG_SYSROOT_DIR="$WASIXCC_SYSROOT" | ||
| export WASIX_PKG_CONFIG_LIBDIR="$WASIXCC_SYSROOT/usr/local/lib/wasm32-wasi/pkgconfig" | ||
|
zebreus marked this conversation as resolved.
|
||
| export WASM_RUNTIME=wasmer | ||
|
|
||
| export WASIXCC_RUN_WASM_OPT="no" | ||
| export WASIXCC_WASM_EXCEPTIONS="yes" | ||
| export WASIXCC_PIC="yes" | ||
| export WASIXCC_INCLUDE_CPP_SYMBOLS="yes" | ||
| # Add the other locations to the search path | ||
| export WASIXCC_COMPILER_FLAGS="-Wl,-L${WASIXCC_SYSROOT}/usr/local/lib/wasm32-wasi:-I${WASIXCC_SYSROOT}/usr/local/include:-Wl,-mllvm,--wasm-enable-eh:-Wl,-mllvm,--wasm-enable-sjlj:-Wl,-mllvm,--wasm-use-legacy-eh=false:-Wl,-mllvm,--exception-model=wasm:-iwithsysroot:/usr/local/include/c++/v1" | ||
| # Make clang emit the non-legacy exception handling directly | ||
| export WASIXCC_LINKER_FLAGS="-mllvm:--wasm-enable-eh:-mllvm:--wasm-enable-sjlj:-mllvm:--wasm-use-legacy-eh=false:-mllvm:--exception-model=wasm" | ||
|
zebreus marked this conversation as resolved.
zebreus marked this conversation as resolved.
|
||
|
|
||
| WASM_RUNTIME=wasmer \ | ||
| WASIX_ZLIB_CFLAGS="-I$ZLIB_DIR" \ | ||
| WASIX_ZLIB_LIBS="-L$ZLIB_DIR -lz " \ | ||
| WASIX_LIBLZMA_CFLAGS="-I$LIBLZMA_DIR/src/liblzma/api" \ | ||
| WASIX_LIBLZMA_LIBS="-L$LIBLZMA_DIR -llzma" \ | ||
| WASIX_LIBUUID_CFLAGS="-I $UTIL_LINUX_DIR/libuuid/src" \ | ||
| WASIX_LIBUUID_LIBS="-L $UTIL_LINUX_DIR -l uuid" \ | ||
| WASIX_LIBREADLINE_CFLAGS="-I $READLINE_DIR/.." \ | ||
| WASIX_LIBREADLINE_LIBS="-L $READLINE_DIR -L $NCURSES_DIR/lib -lreadline -lncurses" \ | ||
| python3 Tools/wasm/wasm_build.py wasix build -c | ||
|
|
||
| cd builddir/wasix | ||
| rm -r "$WASIX_INSTALL/cpython" || true | ||
| make install | ||
| chmod -R a+rw "$WASIX_INSTALL/cpython" | ||
| rm -rf "artifacts/wasix-install" && mkdir -p "artifacts/wasix-install" | ||
| make -C builddir/wasix install DESTDIR="$(pwd)/artifacts/wasix-install" | ||
Oops, something went wrong.
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.