Skip to content

Commit ed75440

Browse files
committed
3.1.72pre
1 parent 445963c commit ed75440

File tree

13 files changed

+324
-154
lines changed

13 files changed

+324
-154
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ jobs:
1919
runs-on: ubuntu-22.04
2020
env:
2121
BUILDS: 3.12 3.13
22-
EMFLAVOUR: tot
22+
EMFLAVOUR: latest
23+
Py_GIL_DISABLED: false
24+
wasisdk: true
25+
gosdk: false
26+
rustsdk: false
27+
nimsdk: false
28+
2329

2430
steps:
2531
- uses: actions/[email protected]

config

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ export WASMTIME_HOME=$WASISDK
8585

8686
# stable
8787
NIM_VERSION=nim-2.0.8
88-
NIM_URL=https://nim-lang.org/download/${NIM_VERSION}-linux_x64.tar.xz
8988

89+
# testing
90+
NIM_VERSION=nim-2.2.0
91+
NIM_URL=https://nim-lang.org/download/${NIM_VERSION}-linux_x64.tar.xz
9092

9193
NIM_VERSION=nim-git
9294
NIM_URL=https://github.com/nim-lang/Nim
@@ -96,6 +98,12 @@ export NIMSDK=${NIMSDK:-"${SDKROOT}/nimsdk"}
9698

9799
# EXTRABINS="$EXTRABINS $NIMSDK/bin"
98100

101+
# =============== rust ====================
102+
export CARGO_HOME=${CARGO_HOME:-${SDKROOT}}/rust
103+
export RUSTUP_HOME=${RUSTUP_HOME:-${SDKROOT}}/rust
104+
mkdir -p ${CARGO_HOME}/bin
105+
EXTRABINS="$EXTRABINS $CARGO_HOME/bin"
106+
99107
# ================ go =====================
100108
export GOPRIVATE=*
101109
export GONOPROXY=*
@@ -122,6 +130,11 @@ EXTRABINS="$EXTRABINS $BUN_INSTALL/bin"
122130
AOSP_NDK=25.2.9519653
123131

124132

133+
# =========== panda3d =================
134+
135+
export PANDA_PRC_DIR=${SDKROOT}/support
136+
137+
125138
PATH=/usr/bin:/bin
126139
for extrabin in $EXTRABINS
127140
do
@@ -138,19 +151,18 @@ done
138151

139152

140153
# this is python used for emsdk : ${SYS_PYTHON} -> ${EMSDK_PYTHON}
154+
# sane default
155+
export SYS_PYTHON=$(command -v python${PYMAJOR})
141156
for py in 10 9 8
142157
do
143158
if command -v python${PYMAJOR}.${py} >/dev/null
144159
then
145160
export SYS_PYTHON=$(command -v python${PYMAJOR}.${py})
146161
break
147-
else
148-
# sane default
149-
export SYS_PYTHON=$(command -v python${PYMAJOR})
150162
fi
151163
done
152164

153-
export GITGET="git clone --recursive --no-tags --depth 1 --single-branch --branch"
165+
export CLONE="git clone --recursive --no-tags --depth 1 --single-branch --branch"
154166
export LD_LIBRARY_PATH="${HOST_PREFIX}/lib:$LD_LIBRARY_PATH"
155167
export PATH="${HOST_PREFIX}/bin:$PATH"
156168
fi

emsdk-cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ COMPILE = False
139139
USE_RAWFS = True
140140
CMAKE = False
141141
RUSTC = False
142-
142+
NINJA = env("NINJA", false)
143143

144144
out = []
145145

@@ -259,13 +259,16 @@ for argc, arg in enumerate(sys.argv):
259259
continue
260260

261261
# duplicates can happen on cmake/rustc but they are expected to be here for a reason so skip them
262-
if not (CMAKE or RUSTC):
262+
if not (CMAKE or NINJA or RUSTC):
263263
# prevent duplicates objects/archives files on cmdline when linking
264264
if LINKING or MODE == "-o":
265265
if arg.endswith(".a") or arg.endswith(".o"):
266266
if arg in out:
267267
continue
268268

269+
# fix sysroot is not default to PIC
270+
arg = arg.replace("/lib/wasm32-emscripten/lib","/lib/wasm32-emscripten/pic/lib")
271+
269272
out.append(arg)
270273

271274
os.environ.pop("_EMCC_CCACHE", "")

python-wasi-sdk.sh

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,38 @@ 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
8+
then
9+
SYS_PYTHON=$(command -v python3)
10+
else
11+
SYS_PYTHON=$(command -v python)
12+
fi
13+
14+
DISTRIB_RELEASE="any"
15+
16+
# is it linux enough ?
17+
if [ -f /etc/lsb-release ]
18+
then
19+
. /etc/lsb-release
20+
export PLATFORM=linux
21+
else
22+
# 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
27+
fi
28+
29+
export DISTRIB="${DISTRIB_ID}-${DISTRIB_RELEASE}"
730

8-
. /etc/lsb-release
9-
DISTRIB="${DISTRIB_ID}-${DISTRIB_RELEASE}"
31+
export SDKROOT=${SDKROOT:-/tmp/sdk}
1032

11-
SDKROOT=${SDKROOT:-/opt/python-wasm-sdk}
33+
# default is behave like a CI
34+
export CI={CI:-true}
1235

13-
export SDKROOT
36+
# maybe have ci flavours later
1437
export CIVER=${CIVER:-$DISTRIB}
15-
export CI=true
38+
1639

1740
if echo $0|grep -q python-wasm-sdk\.sh
1841
then
@@ -24,19 +47,18 @@ else
2447
emsdk=false
2548
BUILDS=3.13
2649
wasisdk=true
27-
nimsdk=true
28-
fi
29-
30-
if $wasisdk
31-
then
32-
echo " * adding wasi-sdk to wasm-sdk"
33-
fi
34-
35-
if $nimsdk
36-
then
37-
echo " * adding nim-sdk to wasm-sdk"
50+
gosdk=${gosdk:-false}
51+
rustsdk=${rustdsk:-false}
52+
nimsdk=${nimsdk:-false}
3853
fi
3954

55+
for lang in wasisdk gosdk rustsdk nimsdk
56+
do
57+
if ${!lang:-false}
58+
then
59+
echo " * adding ${lang} to wasm-sdk"
60+
fi
61+
done
4062

4163
if [ -d ${SDKROOT} ]
4264
then
@@ -148,8 +170,11 @@ END
148170
then
149171
echo "keeping installed wasmtime and wasi binaries"
150172
else
151-
#wget https://github.com/bytecodealliance/wasmtime/releases/download/v22.0.0/wasmtime-v22.0.0-x86_64-linux.tar.xz \
152-
wget https://github.com/bytecodealliance/wasmtime/releases/download/v23.0.2/wasmtime-v23.0.2-$(arch)-linux.tar.xz \
173+
#wget https://github.com/bytecodealliance/wasmtime/releases/download/v22.0.0/wasmtime-v22.0.0-x86_64-linux.tar.xz
174+
175+
# TODO: window only has a zip archive, better use wasmtime-py instead.
176+
177+
wget https://github.com/bytecodealliance/wasmtime/releases/download/v26.0.1/wasmtime-v26.0.1-$(arch)-$(PLATFORM).tar.xz \
153178
-O-|xzcat|tar xfv -
154179
mv -vf $(find wasmtime*|grep /wasmtime$) ${SDKROOT}/devices/$(arch)/usr/bin
155180
fi
@@ -290,7 +315,7 @@ END
290315

291316
if $nimsdk
292317
then
293-
${SDKROOT}/python-nim-sdk.sh
318+
${SDKROOT}/lang/nimsdk.sh
294319
fi
295320

296321
mkdir -p /tmp/sdk

python-wasm-sdk.sh

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,38 @@ 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
8+
then
9+
SYS_PYTHON=$(command -v python3)
10+
else
11+
SYS_PYTHON=$(command -v python)
12+
fi
13+
14+
DISTRIB_RELEASE="any"
15+
16+
# is it linux enough ?
17+
if [ -f /etc/lsb-release ]
18+
then
19+
. /etc/lsb-release
20+
export PLATFORM=linux
21+
else
22+
# 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
27+
fi
28+
29+
export DISTRIB="${DISTRIB_ID}-${DISTRIB_RELEASE}"
730

8-
. /etc/lsb-release
9-
DISTRIB="${DISTRIB_ID}-${DISTRIB_RELEASE}"
31+
export SDKROOT=${SDKROOT:-/tmp/sdk}
1032

11-
SDKROOT=${SDKROOT:-/opt/python-wasm-sdk}
33+
# default is behave like a CI
34+
export CI={CI:-true}
1235

13-
export SDKROOT
36+
# maybe have ci flavours later
1437
export CIVER=${CIVER:-$DISTRIB}
15-
export CI=true
38+
1639

1740
if echo $0|grep -q python-wasm-sdk\.sh
1841
then
@@ -24,19 +47,18 @@ else
2447
emsdk=false
2548
BUILDS=3.13
2649
wasisdk=true
27-
nimsdk=true
28-
fi
29-
30-
if $wasisdk
31-
then
32-
echo " * adding wasi-sdk to wasm-sdk"
33-
fi
34-
35-
if $nimsdk
36-
then
37-
echo " * adding nim-sdk to wasm-sdk"
50+
gosdk=${gosdk:-false}
51+
rustsdk=${rustdsk:-false}
52+
nimsdk=${nimsdk:-false}
3853
fi
3954

55+
for lang in wasisdk gosdk rustsdk nimsdk
56+
do
57+
if ${!lang:-false}
58+
then
59+
echo " * adding ${lang} to wasm-sdk"
60+
fi
61+
done
4062

4163
if [ -d ${SDKROOT} ]
4264
then
@@ -148,8 +170,11 @@ END
148170
then
149171
echo "keeping installed wasmtime and wasi binaries"
150172
else
151-
#wget https://github.com/bytecodealliance/wasmtime/releases/download/v22.0.0/wasmtime-v22.0.0-x86_64-linux.tar.xz \
152-
wget https://github.com/bytecodealliance/wasmtime/releases/download/v23.0.2/wasmtime-v23.0.2-$(arch)-linux.tar.xz \
173+
#wget https://github.com/bytecodealliance/wasmtime/releases/download/v22.0.0/wasmtime-v22.0.0-x86_64-linux.tar.xz
174+
175+
# TODO: window only has a zip archive, better use wasmtime-py instead.
176+
177+
wget https://github.com/bytecodealliance/wasmtime/releases/download/v26.0.1/wasmtime-v26.0.1-$(arch)-$(PLATFORM).tar.xz \
153178
-O-|xzcat|tar xfv -
154179
mv -vf $(find wasmtime*|grep /wasmtime$) ${SDKROOT}/devices/$(arch)/usr/bin
155180
fi
@@ -290,7 +315,7 @@ END
290315

291316
if $nimsdk
292317
then
293-
${SDKROOT}/python-nim-sdk.sh
318+
${SDKROOT}/lang/nimsdk.sh
294319
fi
295320

296321
mkdir -p /tmp/sdk

scripts/cpython-build-emsdk-prebuilt.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,24 @@ fi
8080
# cannot use wasi ninja yet
8181
$HPIP install --force ninja
8282

83+
# patch ninja for jobs limit and wrapper detection
84+
# https://github.com/ninja-build/ninja/issues/1482
85+
86+
cat > ${HOST_PREFIX}/bin/ninja <<END
87+
#!${HOST_PREFIX}/bin/python${PYBUILD}
88+
# -*- coding: utf-8 -*-
89+
import re
90+
import sys
91+
sys.argv.insert(1,'1')
92+
sys.argv.insert(1,'-j')
93+
import os
94+
os.environ['NINJA']="1"
95+
from ninja import ninja
96+
if __name__ == '__main__':
97+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?\$', '', sys.argv[0])
98+
sys.exit(ninja())
99+
END
100+
83101
echo "
84102
* cpython-build-emsdk-prebuilt pip==$PIP *
85103
" 1>&2
@@ -131,3 +149,30 @@ rm ${SDKROOT}/prebuilt/emsdk/common/site-packages/installer/_scripts/*exe
131149

132150

133151

152+
153+
154+
# SDL2 is prebuilt in emsdk but lacks SDL2.pc
155+
156+
cat > ${PREFIX}/lib/pkgconfig/sdl2.pc <<END
157+
# sdl pkg-config source file
158+
159+
prefix=${PREFIX}
160+
exec_prefix=\${prefix}
161+
libdir=\${exec_prefix}/lib
162+
includedir=\${prefix}/include
163+
164+
Name: sdl2
165+
Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D v>
166+
Version: 2.31.0
167+
Requires.private:
168+
Conflicts:
169+
Libs: -L\${libdir} -lSDL2 -lm
170+
Cflags: -I\${includedir} -I\${includedir}/SDL2
171+
END
172+
173+
174+
175+
176+
177+
178+

scripts/cpython-build-emsdk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ else
373373
. emsdk/emsdk_env.sh
374374
popd
375375
export PATH=$SDKROOT/emsdk/upstream/emscripten:$SDKROOT/emsdk/upstream/emscripten/system/bin:\$PATH
376-
export PKG_CONFIG_SYSROOT_DIR="${SDKROOT}/devices/emsdk"
376+
# export PKG_CONFIG_SYSROOT_DIR="${SDKROOT}/devices/emsdk"
377377
export PKG_CONFIG_LIBDIR="${SDKROOT}/emsdk/upstream/emscripten/system/lib/pkgconfig"
378378
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:${HOST_PREFIX}/lib/pkgconfig"
379379
export NODE=\$(find \$EMSDK|grep /bin/node\$)

scripts/cpython-build-wasisdk.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ END
6363
# 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 \
66-
$PYSRC/configure -C \
67-
--with-c-locale-coercion --without-pymalloc --disable-ipv6 --disable-gil --with-ensurepip=no \
66+
$PYSRC/configure -C $GIL \
67+
--with-c-locale-coercion --without-pymalloc --disable-ipv6 --with-ensurepip=no \
6868
--prefix=${PREFIX} \
6969
--host=wasm32-unknown-wasi --with-suffix=.wasm \
7070
--build=$($PYSRC/config.guess) \

scripts/emsdk-fetch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ END
513513
# EM_PKG_CONFIG_PATH ?
514514
# https://emscripten.org/docs/compiling/Building-Projects.html#pkg-config
515515

516-
export PKG_CONFIG_SYSROOT_DIR="${SDKROOT}/devices/emsdk"
516+
# export PKG_CONFIG_SYSROOT_DIR="${SDKROOT}/devices/emsdk"
517517
export PKG_CONFIG_LIBDIR="${SDKROOT}/emsdk/upstream/emscripten/system/lib/pkgconfig"
518518
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:${HOST_PREFIX}/lib/pkgconfig"
519519
export EM_PKG_CONFIG_PATH=$PKG_CONFIG_PATH

0 commit comments

Comments
 (0)