Skip to content

Commit 638e946

Browse files
committed
3.1.55pre
1 parent ca549c7 commit 638e946

File tree

8 files changed

+63
-75
lines changed

8 files changed

+63
-75
lines changed

python-wasi-sdk.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ ORIGIN=$(pwd)
5454

5555
# 3.12 3.11 3.10
5656

57-
BUILDS=${BUILDS:-3.11 3.12 3.13}
57+
BUILDS=${BUILDS:-3.12 3.13}
5858

5959
for PYBUILD in $BUILDS
6060
do
@@ -114,9 +114,9 @@ export PYTHONPYCACHEPREFIX=$PYTHONPYCACHEPREFIX
114114
export HOME=${SDKROOT}
115115
export PATH=${SDKROOT}/devices/$(arch)/usr/bin:\$PATH
116116
export LD_LIBRARY_PATH=${SDKROOT}/devices/$(arch)/usr/lib:${SDKROOT}/devices/$(arch)/usr/lib64:$LD_LIBRARY_PATH
117-
${SDKROOT}/devices/$(arch)/usr/bin/python\${PYBUILD:-$PYBUILD} $@
117+
${SDKROOT}/devices/$(arch)/usr/bin/python\${PYBUILD:-$PYBUILD} \$@
118118
END
119-
chmod + /opt/python-wasm-sdk/devices/$(arch)/usr/bin/py
119+
chmod +x /opt/python-wasm-sdk/devices/$(arch)/usr/bin/py
120120

121121

122122
if $emsdk

python-wasm-sdk.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ ORIGIN=$(pwd)
5454

5555
# 3.12 3.11 3.10
5656

57-
BUILDS=${BUILDS:-3.11 3.12 3.13}
57+
BUILDS=${BUILDS:-3.12 3.13}
5858

5959
for PYBUILD in $BUILDS
6060
do
@@ -114,9 +114,9 @@ export PYTHONPYCACHEPREFIX=$PYTHONPYCACHEPREFIX
114114
export HOME=${SDKROOT}
115115
export PATH=${SDKROOT}/devices/$(arch)/usr/bin:\$PATH
116116
export LD_LIBRARY_PATH=${SDKROOT}/devices/$(arch)/usr/lib:${SDKROOT}/devices/$(arch)/usr/lib64:$LD_LIBRARY_PATH
117-
${SDKROOT}/devices/$(arch)/usr/bin/python\${PYBUILD:-$PYBUILD} $@
117+
${SDKROOT}/devices/$(arch)/usr/bin/python\${PYBUILD:-$PYBUILD} \$@
118118
END
119-
chmod + /opt/python-wasm-sdk/devices/$(arch)/usr/bin/py
119+
chmod +x /opt/python-wasm-sdk/devices/$(arch)/usr/bin/py
120120

121121

122122
if $emsdk

scripts/cpython-build-emsdk-prebuilt.sh

Lines changed: 22 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,38 @@
55
CYTHON_REL=${CYTHON_REL:-3.0.8}
66
CYTHON_WHL=${CYTHON:-Cython-${CYTHON_REL}-py2.py3-none-any.whl}
77

8-
# all needed for PEP722/723
9-
PACKAGING="pip build wheel pyparsing packaging"
10-
# PATCHES/installer-1.0.0.dev0-py3-none-any.whl" BUG 3.13
11-
12-
$HPIP install --upgrade $PACKAGING
13-
14-
# setuptools for HPy/static
15-
$HPIP install --upgrade setuptools
16-
17-
# aioconsole only for the simulator
18-
# $HPIP install --upgrade aioconsole
19-
20-
21-
22-
# support package build/install
23-
$HPY -m pip install --upgrade $PACKAGING
24-
258
PIP="${SDKROOT}/python3-wasm -m pip"
269

10+
# all needed for PEP722/723, hpy, cffi modules and wheel building
2711

28-
$HPIP install --upgrade typing_extensions mypy_extensions
29-
$PIP install --upgrade typing_extensions mypy_extensions
30-
31-
# numpy build
32-
$HPIP install --upgrade meson-python
33-
$PIP install --upgrade meson-python
34-
35-
$HPIP install --upgrade pyproject-metadata
36-
$PIP install --upgrade pyproject-metadata
37-
38-
$HPIP install --upgrade ninja
12+
# pip pip-24.0 broken
13+
for module in typing_extensions mypy_extensions meson-python pyproject-metadata \
14+
setuptools build wheel pyparsing packaging \
15+
git+https://github.com/cffi/cffi git+https://github.com/pypa/installer
16+
do
17+
if $HPIP install --force $module
18+
then
19+
if $PIP install --upgrade --force "$module"
20+
then
21+
echo " pre-installing $module" 1>&2
22+
else
23+
echo " TARGET FAILED on required module $module" 1>&2
24+
exit 23
25+
fi
26+
else
27+
echo " HOST FAILED on required module $module" 1>&2
28+
exit 27
29+
fi
30+
done
3931

32+
# cannot use wasi ninja yet
33+
$HPIP install --force ninja
4034

4135
echo "
4236
* cpython-build-emsdk-prebuilt pip==$PIP *
4337
" 1>&2
4438

4539

46-
47-
$PIP install --upgrade $PACKAGING
48-
49-
# setuptools for HPy/static
50-
$PIP install --upgrade setuptools
51-
52-
53-
54-
# make wheels
55-
# /opt/python-wasm-sdk/python3-wasm setup.py bdist_wheel
56-
57-
5840
# cython get the latest release on gh install on both host python and build python
5941
pushd build
6042
wget -q -c https://github.com/cython/cython/releases/download/${CYTHON_REL}/${CYTHON_WHL}
@@ -90,8 +72,6 @@ do
9072
done
9173

9274

93-
94-
9575
pushd src
9676

9777
# TODO

scripts/cpython-build-host.sh

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ END
6969
PYOPTS="--disable-ipv6 \
7070
--with-c-locale-coercion --without-pymalloc --without-pydebug \
7171
--with-ensurepip $TESTSUITE \
72-
--with-decimal-contextvar --disable-shared \
73-
--with-computed-gotos"
72+
--with-decimal-contextvar --disable-shared"
7473

7574
cat >> pyconfig.h <<END
7675
#ifdef HAVE_LIBINTL_H
@@ -111,24 +110,31 @@ END
111110
${ROOT}/src/cpython${PYBUILD}/configure \
112111
--prefix=$HOST_PREFIX $PYOPTS
113112
then
114-
115113
if make -j$(nproc) install
116114
then
117-
rm -rf $(find $ROOT/devices/ -type d|grep __pycache__$)
118-
rm $HOST_PREFIX/bin/python3-config \
119-
$HOST_PREFIX/bin/idle3 \
120-
$HOST_PREFIX/bin/pydoc3 \
121-
$HOST_PREFIX/bin/python3
122-
123-
# make ubuntu binaries able to run elsewhere
124-
patchelf --remove-needed libintl.so.8 $HOST_PREFIX/bin/python${PYBUILD}
125-
# and able to compile elsewhere
126-
sed -i 's|-lintl ||g' ${SDKROOT}/devices/x86_64/usr/bin/python${PYBUILD}-config
127-
cp -Rfv $ROOT/support/__EMSCRIPTEN__.patches/${PYBUILD}/. $HOST_PREFIX/lib/python${PYBUILD}/
115+
echo "CPython $PYTHON_FOR_BUILD ready" 1>&2
128116
else
129-
echo "failed to build $PYTHON_FOR_BUILD"
130-
exit 123
117+
echo "failed to build $PYTHON_FOR_BUILD" 1>&2
118+
exit 118
131119
fi
120+
121+
# if make -j$(nproc) install
122+
# then
123+
# rm -rf $(find $ROOT/devices/ -type d|grep __pycache__$)
124+
# rm $HOST_PREFIX/bin/python3-config \
125+
# $HOST_PREFIX/bin/idle3 \
126+
# $HOST_PREFIX/bin/pydoc3 \
127+
# $HOST_PREFIX/bin/python3
128+
129+
# # make ubuntu binaries able to run elsewhere
130+
# patchelf --remove-needed libintl.so.8 $HOST_PREFIX/bin/python${PYBUILD}
131+
# # and able to compile elsewhere
132+
# sed -i 's|-lintl ||g' ${SDKROOT}/devices/x86_64/usr/bin/python${PYBUILD}-config
133+
# cp -Rfv $ROOT/support/__EMSCRIPTEN__.patches/${PYBUILD}/. $HOST_PREFIX/lib/python${PYBUILD}/
134+
# else
135+
# echo "failed to build $PYTHON_FOR_BUILD"
136+
# exit 123
137+
# fi
132138
else
133139
echo "
134140
==========================================================================

scripts/cpython-build-wasisdk.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ cross_compiling=yes
5959
END
6060

6161
pushd ${SDKROOT}/build/cpython-wasi
62-
sed -i 's| -Wl,--stack-first -Wl,--initial-memory=10485760||g' $PYSRC/configure.ac
63-
sed -i 's| -Wl,--stack-first -Wl,--initial-memory=10485760||g' $PYSRC/configure
62+
sed -i 's| -Wl,--stack-first -Wl,--initial-memory=10485760|--stack-first --initial-memory=10485760|g' $PYSRC/configure.ac
63+
sed -i 's| -Wl,--stack-first -Wl,--initial-memory=10485760|--stack-first --initial-memory=10485760|g' $PYSRC/configure
6464

6565
LDSHARED="${SDKROOT}/wasisdk/upstream/bin/wasm-ld --no-entry" CONFIG_SITE=$PYSRC/Tools/wasm/config.site-wasm32-wasisdk \
6666
$PYSRC/configure -C \

scripts/cpython-fetch.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ fi
4545

4646
if echo $PYBUILD |grep -q 12$
4747
then
48-
wget -q -c https://www.python.org/ftp/python/3.12.1/Python-3.12.1.tar.xz
49-
tar xf Python-3.12.1.tar.xz
50-
ln -s Python-3.12.1 cpython${PYBUILD}
48+
wget -q -c https://www.python.org/ftp/python/3.12.2/Python-3.12.2.tar.xz
49+
tar xf Python-3.12.2.tar.xz
50+
ln -s Python-3.12.2 cpython${PYBUILD}
5151
export REBUILD=true
5252
fi
5353

5454

5555
if echo $PYBUILD | grep -q 11$
5656
then
57-
wget -q -c https://www.python.org/ftp/python/3.11.7/Python-3.11.7.tar.xz
58-
tar xf Python-3.11.7.tar.xz
59-
ln -s Python-3.11.7 cpython${PYBUILD}
57+
wget -q -c https://www.python.org/ftp/python/3.11.8/Python-3.11.8.tar.xz
58+
tar xf Python-3.11.8.tar.xz
59+
ln -s Python-3.11.8 cpython${PYBUILD}
6060
export REBUILD=true
6161
fi
6262

scripts/emsdk-fetch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ for arg do
336336
[ "\$arg" = "-I/usr/include/SDL2" ] && continue
337337
[ "\$arg" = "-L/usr/lib64" ] && continue
338338
[ "\$arg" = "-L/usr/lib" ] && continue
339+
[ "\$arg" = "-latomic" ] && continue
339340
340341
if [ "\$arg" = "-shared" ]
341342
then

wasisdk/hotfix/patch.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,15 @@ static char *
9595
tempnam (const char *dir, const char *pfx)
9696
{
9797
char buf[FILENAME_MAX];
98-
98+
int all;
99+
char *ptr;
99100
int dirlen = strlen(dir);
100101
if (dirlen>=FILENAME_MAX)
101102
return NULL;
102103

103104
memcpy(buf,dir,FILENAME_MAX);
104105
buf[dirlen] = '/';
105-
int all;
106+
106107

107108
if (pfx) {
108109
all = dirlen + 1 + strlen(pfx);
@@ -116,7 +117,7 @@ tempnam (const char *dir, const char *pfx)
116117
memcpy(buf+all, "XXXXXX", 6 );
117118
all += 6 ;
118119
buf[all]= 0;
119-
char *ptr = (char *)malloc(all);
120+
ptr = (char *)malloc(all);
120121
memcpy(ptr, buf, all);
121122
return mktemp(ptr);
122123
}

0 commit comments

Comments
 (0)