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/checkout@v3.3.0

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 \

0 commit comments

Comments
 (0)