Skip to content

Commit ee8e924

Browse files
authored
Missing libs for Python 3.13 with WASM (#655)
* Emscripten Python 3.13 missing libs * Missing gitignore entry * Update wasm build on CI * Env changse * Missing prefix arg * Try * Try * Fix channel * Remove non needed outdated requests polyfill
1 parent 36c1b4d commit ee8e924

File tree

5 files changed

+26
-28
lines changed

5 files changed

+26
-28
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -150,31 +150,19 @@ jobs:
150150

151151
strategy:
152152
fail-fast: false
153-
matrix:
154-
emsdk_ver: ["3.1.45"]
155153

156154
steps:
157155
- uses: actions/checkout@v4
158156

159-
- name: Install micromamba
160-
uses: mamba-org/setup-micromamba@v1
157+
- name: install mamba
158+
uses: mamba-org/setup-micromamba@main
161159
with:
162160
environment-file: environment-wasm-build.yml
163-
164-
- name: Setup emsdk
165-
shell: bash -l {0}
166-
run: |
167-
cd $HOME
168-
git clone https://github.com/emscripten-core/emsdk.git
169-
cd emsdk
170-
./emsdk install ${{ matrix.emsdk_ver }}
171-
./emsdk activate ${{ matrix.emsdk_ver }}
161+
init-shell: bash
172162

173163
- name: Build and pack xeus-python
164+
shell: bash -l {0}
174165
run: |
175-
$HOME/emsdk/emsdk activate ${{matrix.emsdk_ver}}
176-
source $HOME/emsdk/emsdk_env.sh
177-
178166
micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32
179167
180168
mkdir build
@@ -188,6 +176,8 @@ jobs:
188176
rm -f $PREFIX/bin/python*
189177
190178
emcmake cmake \
179+
-DCMAKE_PREFIX_PATH=$PREFIX \
180+
-DCMAKE_INSTALL_PREFIX=$PREFIX \
191181
-DCMAKE_BUILD_TYPE=Release \
192182
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
193183
-DXPYT_EMSCRIPTEN_WASM_BUILD=ON \

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,5 @@ build/
5454

5555
# JS artifacts
5656
node_modules/
57+
58+
post.js.in

CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,14 @@ endif()
378378
if (EMSCRIPTEN)
379379
# TODO MAKE BETTER
380380
SET(PYTHON_UTIL_LIBS
381-
$ENV{PREFIX}/lib/libbz2.a
382-
$ENV{PREFIX}/lib/libz.a
383-
$ENV{PREFIX}/lib/libsqlite3.a
384-
$ENV{PREFIX}/lib/libffi.a
385-
$ENV{PREFIX}/lib/libzstd.a
381+
${CMAKE_INSTALL_PREFIX}/lib/libbz2.a
382+
${CMAKE_INSTALL_PREFIX}/lib/libz.a
383+
${CMAKE_INSTALL_PREFIX}/lib/libsqlite3.a
384+
${CMAKE_INSTALL_PREFIX}/lib/libffi.a
385+
${CMAKE_INSTALL_PREFIX}/lib/libzstd.a
386+
${CMAKE_INSTALL_PREFIX}/lib/libssl.a
387+
${CMAKE_INSTALL_PREFIX}/lib/libcrypto.a
388+
${CMAKE_INSTALL_PREFIX}/lib/liblzma.a
386389
)
387390

388391
add_executable(xpython ${XPYTHON_WASM_SRC})

environment-wasm-build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: xeus-python-wasm-build
22
channels:
3+
- https://repo.prefix.dev/emscripten-forge-dev
34
- conda-forge
45
dependencies:
56
- cmake
7+
- emscripten_emscripten-wasm32==3.1.73
68
- pip
7-
- python=3.11
9+
- python=3.13
810
- yarn
9-
- click
11+
- click

environment-wasm-host.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: xeus-python-wasm-host
22
channels:
3-
- https://repo.mamba.pm/emscripten-forge
4-
- https://repo.mamba.pm/conda-forge
3+
- https://repo.prefix.dev/emscripten-forge-dev
4+
- https://repo.prefix.dev/conda-forge
55
dependencies:
66
- ipython
77
- pybind11
@@ -10,9 +10,10 @@ dependencies:
1010
- pybind11_json
1111
- numpy
1212
- xeus-lite
13-
- xeus
13+
- xeus
1414
- xeus-python-shell>=0.6.3
15-
- pyjs>=2.0.0
16-
- requests-wasm-polyfill>=0.3.0
15+
- pyjs >=2,<3
1716
- libpython
1817
- zstd
18+
- openssl
19+
- xz

0 commit comments

Comments
 (0)