Skip to content

Commit 2b0e746

Browse files
committed
3.1.74.0pre
1 parent f11abac commit 2b0e746

File tree

11 files changed

+138
-56
lines changed

11 files changed

+138
-56
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
gosdk: false
2727
rustsdk: false
2828
nimsdk: false
29-
COPTS: -Os -g3
29+
COPTS: -Os -g0
3030

3131
steps:
3232
- uses: actions/[email protected]

config

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,13 @@ export XDG_DATA_HOME=${HOME}/build/share
2727
export XDG_CACHE_HOME=${HOME}/build/cache
2828
export XDG_CONFIG_HOME=${HOME}/build/config
2929
export XDG_DATA_DIRS=${HOME}/build/share
30-
3130
mkdir -p $XDG_DATA_HOME $XDG_CACHE_HOME $XDG_CONFIG_HOME
3231

32+
export PIP_ROOT_USER_ACTION=ignore
33+
export PIP_NO_CACHE_DIR=1
3334
export HPY=${HOST_PREFIX}/bin/python${PYBUILD}
3435
export HPIP="${HPY} -mpip"
3536

36-
# cpython build opts
37-
export CPOPTS="-Os -g0 -fPIC"
38-
39-
4037
# base wasm features pure is "mvp" , "bi" is bigint
4138

4239
if [ -f /mvp ]
@@ -154,7 +151,7 @@ done
154151

155152
# this is python used for emsdk : ${SYS_PYTHON} -> ${EMSDK_PYTHON}
156153
# sane default
157-
export SYS_PYTHON=$(command -v python${PYMAJOR})
154+
export SYS_PYTHON=python${PYMAJOR}
158155
for py in 10 9 8
159156
do
160157
if command -v python${PYMAJOR}.${py} >/dev/null

emsdk-cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ else:
358358
try:
359359
with open(AOUT, "w") as file:
360360
file.write("#!/usr/bin/env bash\n")
361-
file.write('node $0.cjs "$@"\n')
361+
file.write(os.environ.get('SYS_NODE', '/usr/bin/node')+' $0.cjs "$@"\n')
362362
except Exception as e:
363363
dbg("ERROR: 306", e)
364364
os.rename(AOUT + ".cjs", AOUT)

python-wasi-sdk.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@ reset
44
# TODO: check how dbg tools work with default settings
55
# https://developer.chrome.com/blog/wasm-debugging-2020/
66

7-
if command -v python3
7+
mkdir -p /tmp/sdk-bin
8+
export PATH=/tmp/sdk-bin:$PATH
9+
10+
which command || cat > /tmp/sdk-bin/command << END
11+
#!/bin/bash
12+
shift
13+
which $1
14+
END
15+
chmod +x /tmp/sdk-bin/command
16+
17+
18+
if which python3
819
then
9-
SYS_PYTHON=$(command -v python3)
20+
SYS_PYTHON=$(which python3)
1021
else
11-
SYS_PYTHON=$(command -v python)
22+
SYS_PYTHON=$(which python)
1223
fi
1324

14-
DISTRIB_RELEASE="any"
25+
DISTRIB_RELEASE=${DISTRIB_RELEASE:-any}
1526

1627
# is it linux enough ?
1728
if [ -f /etc/lsb-release ]
@@ -20,10 +31,10 @@ then
2031
export PLATFORM=linux
2132
else
2233
# or not
23-
export DISTRIB_ID=$($SYS_PYTHON -E -c "print(__import__('sys').platform)")
24-
echo no /etc/lsb-release found, please identify platform '$DISTRIB_ID'
25-
DISTRIB="${DISTRIB_ID}-${DISTRIB_RELEASE}"
26-
exit 1
34+
export DISTRIB_ID=$($SYS_PYTHON -E -c "print(__import__('sysconfig').get_config_var('HOST_GNU_TYPE'))")
35+
export PLATFORM=$($SYS_PYTHON -E -c "print(__import__('sys').platform)")
36+
echo no /etc/lsb-release found, please identify platform $PLATFORM : \"${DISTRIB_ID}-${DISTRIB_RELEASE}\" or hit enter to continue
37+
read
2738
fi
2839

2940
export DISTRIB="${DISTRIB_ID}-${DISTRIB_RELEASE}"
@@ -60,7 +71,7 @@ do
6071
fi
6172
done
6273

63-
if [ -d ${SDKROOT} ]
74+
if mkdir -p ${SDKROOT}
6475
then
6576
echo "Assuming destination $SDKROOT is ready"
6677
else

python-wasm-sdk.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@ reset
44
# TODO: check how dbg tools work with default settings
55
# https://developer.chrome.com/blog/wasm-debugging-2020/
66

7-
if command -v python3
7+
mkdir -p /tmp/sdk-bin
8+
export PATH=/tmp/sdk-bin:$PATH
9+
10+
which command || cat > /tmp/sdk-bin/command << END
11+
#!/bin/bash
12+
shift
13+
which $1
14+
END
15+
chmod +x /tmp/sdk-bin/command
16+
17+
18+
if which python3
819
then
9-
SYS_PYTHON=$(command -v python3)
20+
SYS_PYTHON=$(which python3)
1021
else
11-
SYS_PYTHON=$(command -v python)
22+
SYS_PYTHON=$(which python)
1223
fi
1324

14-
DISTRIB_RELEASE="any"
25+
DISTRIB_RELEASE=${DISTRIB_RELEASE:-any}
1526

1627
# is it linux enough ?
1728
if [ -f /etc/lsb-release ]
@@ -20,10 +31,10 @@ then
2031
export PLATFORM=linux
2132
else
2233
# or not
23-
export DISTRIB_ID=$($SYS_PYTHON -E -c "print(__import__('sys').platform)")
24-
echo no /etc/lsb-release found, please identify platform '$DISTRIB_ID'
25-
DISTRIB="${DISTRIB_ID}-${DISTRIB_RELEASE}"
26-
exit 1
34+
export DISTRIB_ID=$($SYS_PYTHON -E -c "print(__import__('sysconfig').get_config_var('HOST_GNU_TYPE'))")
35+
export PLATFORM=$($SYS_PYTHON -E -c "print(__import__('sys').platform)")
36+
echo no /etc/lsb-release found, please identify platform $PLATFORM : \"${DISTRIB_ID}-${DISTRIB_RELEASE}\" or hit enter to continue
37+
read
2738
fi
2839

2940
export DISTRIB="${DISTRIB_ID}-${DISTRIB_RELEASE}"
@@ -60,7 +71,7 @@ do
6071
fi
6172
done
6273

63-
if [ -d ${SDKROOT} ]
74+
if mkdir -p ${SDKROOT}
6475
then
6576
echo "Assuming destination $SDKROOT is ready"
6677
else

scripts/cpython-build-emsdk.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ else
6767

6868

6969

70-
EMCC_CFLAGS="-O0 -g0 -fPIC" CFLAGS="-O0 -g0 -fPIC" CC=${SDKROOT}/emsdk/upstream/emscripten/emcc \
70+
CC=${SDKROOT}/emsdk/upstream/emscripten/emcc \
7171
emconfigure $ROOT/src/libffi/configure --host=wasm32-bi-emscripten \
7272
--prefix=$PREFIX --enable-static --disable-shared --disable-dependency-tracking\
7373
--disable-builddir --disable-multi-os-directory --disable-raw-api --disable-docs
@@ -147,7 +147,7 @@ else
147147

148148
# --with-tzpath="/usr/share/zoneinfo" \
149149

150-
export EMCC_CFLAGS="$CPOPTS -D_XOPEN_SOURCE_EXTENDED=1 -I$PREFIX/include/ncursesw -sUSE_ZLIB -sUSE_BZIP2"
150+
export EMCC_CFLAGS="-D_XOPEN_SOURCE_EXTENDED=1 -I$PREFIX/include/ncursesw -sUSE_ZLIB -sUSE_BZIP2"
151151

152152
CPPFLAGS="$CPPFLAGS -I$PREFIX/include/ncursesw"
153153
CFLAGS="$CPPFLAGS -I$PREFIX/include/ncursesw"

scripts/cpython-build-host.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ END
102102

103103
CNF="${ROOT}/src/cpython${PYBUILD}/configure \
104104
--prefix=$HOST_PREFIX $PYOPTS $GIL"
105-
if CC="clang" CXX="clang++" CCSHARED="-fPIC" $CNF
105+
if CC="clang" CXX="clang++" CCSHARED="-fPIC" EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" $CNF
106106
then
107107

108108
if make -j$(nproc)

scripts/cpython-fetch.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ fi
7979

8080
if echo $PYBUILD |grep -q 13$
8181
then
82-
wget -q -c https://www.python.org/ftp/python/3.13.0/Python-3.13.0.tar.xz
83-
tar xf Python-3.13.0.tar.xz
84-
ln -s Python-3.13.0 cpython${PYBUILD}
82+
wget -q -c https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tar.xz
83+
tar xf Python-3.13.1.tar.xz
84+
ln -s Python-3.13.1 cpython${PYBUILD}
85+
86+
sed -i 's|ProcessPoolExecutor = None|return True|g' cpython3.13/Lib/compileall.py
8587

8688
mkdir $ROOT/devices/emsdk/usr/lib $ROOT/devices/$(arch)/usr/lib -p
8789

scripts/emsdk-fetch.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,14 @@ END
208208

209209
curl -fsSL https://bun.sh/install | bash
210210

211-
npm install --prefix $ROOT/emsdk/node/??.??.* -g pnpm@^9.0.0
211+
# emsdk shipped node cannot run on alpine
212+
if [ -f /alpine ]
213+
then
214+
cp -vf /usr/bin/node $ROOT/emsdk/node/??.??.*/bin/node
215+
fi
216+
217+
export PATH=$(echo -n ${SDKROOT}/emsdk/node/??.??.*/bin):$PATH
218+
$ROOT/emsdk/node/??.??.*/bin/npm install --prefix $ROOT/emsdk/node/??.??.* -g pnpm@^9.0.0
212219

213220
# maybe rewrite that in python and move it to emcc.py
214221

@@ -523,7 +530,7 @@ END
523530
# emsdk env does not set it, but it's required for eg sdl2-config
524531
echo -n
525532
else
526-
export PATH=$EMSDK/upstream/emscripten/system/bin:$EMSDK/upstream/emscripten:$PATH
533+
export PATH=$(echo -n ${EMSDK}/node/??.??.*/bin):$EMSDK/upstream/emscripten/system/bin:$EMSDK/upstream/emscripten:$PATH
527534
fi
528535

529536
#ln $EMSDK/upstream/emscripten/emstrip $EMSDK/upstream/emscripten/strip

sources.extra/1000-glib.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ c = 'emcc'
118118
cpp = 'em++'
119119
ar = 'emar'
120120
ranlib = 'emranlib'
121-
pkgconfig = ['pkg-config', '--static']
121+
pkg-config = ['pkg-config', '--static']
122122
# https://docs.gtk.org/glib/cross-compiling.html#cross-properties
123+
123124
[properties]
124125
growing_stack = true
125126
have_c99_vsnprintf = true
@@ -136,6 +137,10 @@ system = 'emscripten'
136137
cpu_family = 'wasm32'
137138
cpu = 'wasm32'
138139
endian = 'little'
140+
141+
[ninja]
142+
backend_max_links = 1
143+
139144
END
140145

141146
meson setup _build --prefix=$PREFIX --cross-file=emscripten-crossfile.meson --default-library=static --buildtype=release \

sources.wasm/9000-uuid-ossp.sh

Lines changed: 70 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,39 @@
22

33
. ${CONFIG:-config}
44

5-
. scripts/emsdk-fetch.sh
65

7-
cd ${ROOT}/src
86

9-
if [ -d uuid-1.6.2 ]
7+
pushd ${ROOT}/src
8+
9+
if [ -d libuuid ]
1010
then
11-
echo ok
11+
echo "using local source tree"
1212
else
13-
#wget -c http://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
14-
#tar xfz uuid-1.6.2.tar.gz
15-
git clone https://github.com/pygame-web/ossp-uuid uuid-1.6.2
13+
#wget -c http://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/libuuid.tar.gz
14+
#tar xfz libuuid.tar.gz
15+
16+
#wget -c http://deb.debian.org/debian/pool/main/o/ossp-uuid/ossp-uuid_1.6.4.orig.tar.gz
17+
#tar xvfz ossp-uuid_1.6.4.orig.tar.gz
18+
#mv ossp-uuid-UUID_1_6_4 libuuid
19+
20+
git clone https://github.com/pygame-web/ossp-uuid libuuid
21+
22+
#tar xfp /data/git/python-wasm-sdk/libuuid.tar
23+
24+
pushd libuuid
25+
# libtoolize && aclocal && autoheader && autoconf && autoreconf && automake --add-missing
26+
#cp -vf /data/git/python-wasm-sdk/{libtool,shtool} ./
27+
cp -vf /data/git/python-wasm-sdk/shtool ./
28+
chmod u-w+x libtool shtool
29+
popd
30+
1631
fi
1732

33+
popd
34+
35+
36+
. scripts/emsdk-fetch.sh
37+
1838
INCDIR=$EMSDK/upstream/emscripten/cache/sysroot/include
1939
LIBDIR=$EMSDK/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten
2040

@@ -27,7 +47,7 @@ else
2747

2848
mkdir -p $ROOT/build/libuuid
2949

30-
for mode in "--without-pic" "--with-pic"
50+
for mode in "--without-pic" "--with-pic"
3151
do
3252
rm -rf $ROOT/build/libuuid/*
3353
pushd $ROOT/build/libuuid
@@ -38,32 +58,61 @@ END
3858
ln -sf /bin/true bin/strip
3959
export PATH=$(pwd)/bin:$PATH
4060

41-
if CONFIG_SIZE=$(pwd)/config.site emconfigure ../../src/uuid-1.6.2/configure --with-gnu-ld $mode --disable-shared --prefix=$PREFIX
61+
cp -vf /data/git/python-wasm-sdk/{libtool,shtool} /tmp/
62+
cp -vf /data/git/python-wasm-sdk/libtool ./
63+
chmod u-w+x /tmp/libtool /tmp/shtool libtool
64+
65+
if PATH=/tmp:$PATH CONFIG_SIZE=$(pwd)/config.site emconfigure ../../src/libuuid/configure --with-gnu-ld $mode --disable-shared --prefix=$PREFIX
4266
then
43-
emmake make
44-
sed -i 's|luuid|lossp-uuid|g' uuid.pc
45-
cp uuid.pc ../../src/uuid-1.6.2/
46-
echo "------ installing uuid ---------"
47-
emmake make install
48-
mkdir -p ${INCDIR}/ossp
49-
mv $PREFIX/include/uuid.h ${INCDIR}/ossp/
67+
cp -vf /data/git/python-wasm-sdk/{libtool,shtool} /tmp/
68+
cp -vf /data/git/python-wasm-sdk/libtool ./
69+
chmod u-w+x /tmp/libtool /tmp/shtool libtool
5070

51-
cp -r ${INCDIR}/ossp $PREFIX/include/
71+
PATH=/tmp:$PATH emmake make
72+
# LIBTOOL="'bash ${ROOT}/src/libuuid/libtool'" SHTOOL="'bash ${ROOT}/src/libuuid/shtool'"
73+
sed -i 's|luuid|lossp-uuid|g' uuid.pc
74+
cp uuid.pc ../../src/libuuid/
5275

5376
if echo $mode | grep -q with-pic
5477
then
55-
mv $PREFIX/lib/libuuid.a $LIBDIR/pic/libossp-uuid.a
78+
TARGETLIB=$LIBDIR/pic/libossp-uuid.a
79+
else
80+
TARGETLIB=$LIBDIR/libossp-uuid.a
81+
fi
82+
83+
84+
echo "------ installing uuid to $TARGETLIB ---------"
85+
86+
if PATH=/tmp:$PATH emmake make install
87+
then
88+
mkdir -p ${INCDIR}/ossp
89+
cp $PREFIX/include/uuid.h ${INCDIR}/ossp/
90+
cp -r ${INCDIR}/ossp $PREFIX/include/
91+
mv $PREFIX/lib/libuuid.a $TARGETLIB
92+
rm $PREFIX/lib/libuuid.la
93+
else
94+
echo "FIXME: libtool wasm"
95+
fi
96+
97+
if [ -f $TARGETLIB ]
98+
then
99+
echo "normal build sucess"
56100
else
57-
mv $PREFIX/lib/libuuid.a $LIBDIR/libossp-uuid.a
101+
echo "TODO: fix uuid ossp for alpine"
102+
mkdir -p ${INCDIR}/ossp
103+
cp $PREFIX/include/uuid.h ${INCDIR}/ossp/
104+
cp -r ${INCDIR}/ossp $PREFIX/include/
105+
emar cr libuuid.a *.o
106+
mv libuuid.a $TARGETLIB
58107
fi
59-
rm $PREFIX/lib/libuuid.la
108+
60109
else
61110
echo "
62111
63112
failed to build uuid-ossp
64113
65114
"
66-
exit 44
115+
exit 115
67116
fi
68117
popd
69118
done

0 commit comments

Comments
 (0)