Skip to content

Commit

Permalink
add support for liblzma
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej committed Jul 2, 2024
1 parent b929f1e commit 6207fd8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/reusable-wasix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
WASIX_LIBC_TAG: "v2024-06-20.1"
OPENSSL_DIR: "/opt/openssl"
ZLIB_DIR: "/opt/zlib"
LIBLZMA_DIR: "/opt/liblzma"
CROSS_BUILD_PYTHON: cross-build/build
CROSS_BUILD_WASIX: cross-build/wasix
WASIX_INSTALL: /opt/wasix_install
Expand Down Expand Up @@ -57,6 +58,12 @@ jobs:
git clone https://github.com/wasix-org/zlib ${{ env.ZLIB_DIR }}
cd ${{ env.ZLIB_DIR }}
./wasix.sh
- name: "Compile liblzma"
run: |
git clone https://github.com/wasix-org/liblzma ${{ env.LIBLZMA_DIR }}
cd ${{ env.LIBLZMA_DIR }}
./wasix.sh
cp src/liblzma/.libs/liblzma.a liblzma.a
- name: "Install Wasmer"
run: |
mkdir ${{ env.WASMER_DIR }}
Expand All @@ -67,6 +74,8 @@ jobs:
WASM_RUNTIME=wasmer \
WASIX_ZLIB_CFLAGS="-I${{ env.ZLIB_DIR }}" \
WASIX_ZLIB_LIBS="-L${{ env.ZLIB_DIR }} -lz" \
WASIX_LIBLZMA_CFLAGS="-I${{ env.LIBLZMA_DIR }}/src/liblzma/api" \
WASIX_LIBLZMA_LIBS="-L${{ env.LIBLZMA_DIR }} -llzma" \
python3 Tools/wasm/wasm_build.py wasix build
- name: "List dirs"
run: |
Expand Down
3 changes: 3 additions & 0 deletions Tools/wasm/wasix-configure-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ if ! test -x "${WASI_SDK_PATH}/bin/clang"; then
exit 2
fi

export LIBLZMA_CFLAGS=$WASIX_LIBLZMA_CFLAGS
export LIBLZMA_LIBS=$WASIX_LIBLZMA_LIBS

export ZLIB_CFLAGS=$WASIX_ZLIB_CFLAGS
export ZLIB_LIBS=$WASIX_ZLIB_LIBS

Expand Down
1 change: 0 additions & 1 deletion configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7532,7 +7532,6 @@ AS_CASE([$ac_sys_system],
[_testclinic],
[fcntl],
[mmap],
[_lzma],
[readline],
[xxlimited],
[xxlimited_35],
Expand Down
3 changes: 3 additions & 0 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,9 @@
/* Define to 1 if you want to emulate getpid() on WASI */
#undef _WASI_EMULATED_GETPID

/* Define to 1 if you want to emulate process clocks on WASI */
#undef _WASI_EMULATED_MMAN

/* Define to 1 if you want to emulate process clocks on WASI */
#undef _WASI_EMULATED_PROCESS_CLOCKS

Expand Down

0 comments on commit 6207fd8

Please sign in to comment.