Skip to content

Commit 16ac0a6

Browse files
committed
3.1.46test
1 parent 002166e commit 16ac0a6

File tree

4 files changed

+45
-28
lines changed

4 files changed

+45
-28
lines changed

config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fi
4343

4444
#stable
4545
# embind broke after 3.1.34
46-
# export EMFLAVOUR=${EMFLAVOUR:-3.1.34}
46+
# export EMFLAVOUR=3.1.34
4747
# export EMFLAVOUR=${EMFLAVOUR:latest}
4848

4949

scripts/cpython-build-emsdk-prebuilt.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
CYTHON_REL=${CYTHON_REL:-3.0.0}
66
CYTHON_WHL=${CYTHON:-Cython-${CYTHON_REL}-py2.py3-none-any.whl}
77

8-
$HPY -m pip install --upgrade pip
8+
PACKAGING="pip build wheel pyparsing packaging installer"
9+
10+
11+
$HPY -m pip install --upgrade $PACKAGING
12+
13+
# only for the simulator
14+
$HPY -m pip install --upgrade aioconsole
915

1016
pushd build
1117
wget -q -c https://github.com/cython/cython/releases/download/${CYTHON_REL}/${CYTHON_WHL}
@@ -20,28 +26,22 @@ echo "
2026
" 1>&2
2127

2228

23-
$PIP install --upgrade pip
24-
25-
$PIP install --upgrade build
29+
# support package build/install
30+
$HPY -m pip install --upgrade $PACKAGING
31+
$PIP install --upgrade $PACKAGING
2632

2733
# make wheels
2834
# /opt/python-wasm-sdk/python3-wasm setup.py bdist_wheel
2935

30-
$PIP install wheel
31-
3236

3337
# cython
3438
$HPY -m pip install build/$CYTHON_WHL
3539
$PIP install build/$CYTHON_WHL
3640

3741

38-
# install them
39-
$PIP install installer
40-
41-
42-
# some we want in all minimal rootfs
42+
# some we want to be certain to have in all minimal rootfs
4343
mkdir -p prebuilt/emsdk/common/site-packages/
44-
for pkg in installer
44+
for pkg in pyparsing packaging installer
4545
do
4646
if [ -d prebuilt/emsdk/${PYBUILD}/site-packages/$pkg ]
4747
then
@@ -51,7 +51,8 @@ do
5151
else
5252
$PIP install $pkg
5353
cp -rf $PREFIX/lib/python${PYBUILD}/site-packages/${pkg} prebuilt/emsdk/common/site-packages/
54-
cp -rf $PREFIX/lib/python${PYBUILD}/site-packages/${pkg}-* prebuilt/emsdk/common/site-packages/
54+
# skip the distinfo to save space
55+
#cp -rf $PREFIX/lib/python${PYBUILD}/site-packages/${pkg}-* prebuilt/emsdk/common/site-packages/
5556
fi
5657
done
5758

scripts/cpython-build-emsdk.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ echo "
9696
fi
9797

9898
# in this special case build testsuite
99-
# main repo https://github.com/pmp-p/python-wasm-plus
99+
# main repo https://github.com/pmp-p/python-wasm-test
100100

101101
# pygame-web won't build test modules
102102

103-
if echo $GITHUB_WORKSPACE|grep -q /python-wasm-plus/
103+
if echo $GITHUB_WORKSPACE|grep -q /python-wasm-test/
104104
then
105105
TESTSUITE="--enable-test-modules"
106106
#TESTSUITE=""
@@ -166,6 +166,13 @@ END
166166
# --with-libs='-lz -lffi' \
167167

168168

169+
# MODULE__HASHLIB_LDFLAGS=-L/usr/lib -lcrypto
170+
pushd $ROOT/src/cpython${PYBUILD}
171+
sed -i 's| -lcrypto||g' Makefile.pre.in
172+
sed -i 's|-sWASM_BIGINT||g' configure
173+
sed -i 's|-sWASM_BIGINT||g' configure.ac
174+
popd
175+
169176
PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig" CONFIG_SITE=$ROOT/src/cpython${PYBUILD}/Tools/wasm/config.site-wasm32-pydk \
170177
emconfigure $ROOT/src/cpython${PYBUILD}/configure -C --with-emscripten-target=browser \
171178
--cache-file=${PYTHONPYCACHEPREFIX}/config.cache \
@@ -206,8 +213,6 @@ _crypt
206213
END
207214
fi
208215

209-
sed -i 's| -lcrypto||g' Makefile
210-
211216
if emmake make -j$NPROC WASM_ASSETS_DIR=$(realpath ${PYTHONPYCACHEPREFIX}/empty)@/
212217
then
213218
if emmake make WASM_ASSETS_DIR=$(realpath ${PYTHONPYCACHEPREFIX}/empty)@/ install
@@ -217,18 +222,21 @@ END
217222
exit 1
218223
fi
219224
else
225+
sed -i 's| -lcrypto||g' Makefile
220226
emmake make -j1 Modules/_ctypes/_ctypes.o
221227
if emmake make WASM_ASSETS_DIR=$(realpath ${PYTHONPYCACHEPREFIX}/empty)@/ install
222228
then
223229
echo ok
224230
else
225-
echo " **** cpython wasm build failed ***
231+
echo "
226232
227-
emmake make WASM_ASSETS_DIR=$(realpath ${PYTHONPYCACHEPREFIX}/empty)@/
233+
**** cpython wasm build failed ***
234+
235+
emmake make WASM_ASSETS_DIR=$(realpath ${PYTHONPYCACHEPREFIX}/empty)@/ install
228236
229237
" 1>&2
230238

231-
exit 1
239+
exit 2
232240
fi
233241
fi
234242

@@ -375,7 +383,7 @@ chmod +x $HOST_PREFIX/bin/python3-wasm
375383
cp -f $HOST_PREFIX/bin/python3-wasm ${SDKROOT}/
376384

377385
# TODO: FIXME:
378-
echo "366: cannot use python3-wasm as python3 for setup.py in pygame build" 1>&2
386+
echo "386: cannot use python3-wasm as python3 for setup.py in pygame build" 1>&2
379387
ln -sf $HOST_PREFIX/bin/python${PYBUILD} $HOST_PREFIX/bin/python3
380388

381389
HPFX=./devices/$(arch)/usr/lib/python${PYBUILD}

scripts/emsdk-fetch.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,18 @@ then
2424
pushd upstream/emscripten
2525
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/17956"
2626
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/17956.diff
27-
patch -p1 < 17956.diff
28-
#echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/18941"
29-
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/18941.diff
30-
#patch -p1 < 18941.diff
27+
if patch -p1 < 17956.diff
28+
then
29+
echo applied https://github.com/emscripten-core/emscripten/pull/17956
30+
# 18941 has been merged
31+
else
32+
# deal with old version of emsdk for the above 3.1.45 patch
33+
sed -i 's|new Uint8Array(data.object.contents), true, true|FS.readFile(_file), true, true|g' src/library_browser.js
34+
# merged since 3.1.34 which quite the more stable atm
35+
#echo "MAYBE FIXME: Applying https://github.com/emscripten-core/emscripten/pull/18941"
36+
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/18941.diff
37+
#patch -p1 < 18941.diff
38+
fi
3139
popd
3240

3341
# wget https://raw.githubusercontent.com/paradust7/minetest-wasm/main/emsdk_emcc.patch
@@ -170,7 +178,7 @@ if \$MVP
170178
then
171179
# -mcpu=generic would activate those https://reviews.llvm.org/D125728
172180
# https://github.com/emscripten-core/emscripten/pull/17689
173-
CPU="-mno-sign-ext -mno-mutable-globals -m32"
181+
CPU="-sWASM_BIGINT=0 -sMIN_SAFARI_VERSION=120000 -mnontrapping-fptoint -mno-reference-types -mno-sign-ext -mno-mutable-globals -m32"
174182
else
175183
CPU="-mcpu=bleeding-edge -m32"
176184
fi
@@ -322,7 +330,7 @@ then
322330
rm \$SOTMP
323331
fi
324332
else
325-
$EMSDK_PYTHON -E \$0.py $CPU \$COPTS \$CPPFLAGS -DBUILD_STATIC "\$@" \$COMMON
333+
$EMSDK_PYTHON -E \$0.py $CPU -fpic \$COPTS \$CPPFLAGS -DBUILD_STATIC "\$@" \$COMMON
326334
fi
327335
#else
328336
# unset _EMCC_CCACHE

0 commit comments

Comments
 (0)