Skip to content

Commit 60485a6

Browse files
committed
3.1.61.9pre
1 parent 137f6b7 commit 60485a6

File tree

12 files changed

+140
-108
lines changed

12 files changed

+140
-108
lines changed

config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ EXTRABINS="$EXTRABINS $GOROOT/bin"
122122
# ============== wasmer =================
123123
# curl https://get.wasmer.io -sSfL | sh
124124

125-
export WASMER_DIR==/opt/python-wasm-sdk/wasmer
125+
export WASMER_DIR=${SDKROOT}/wasmer
126126

127127

128128
# ================ bun ====================

emsdk-cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ COMMON = arglist(
6262
os.environ.get("PYDK_CFLAGS", ""),
6363
)
6464

65+
# -Wno-unnecessary-virtual-specifier
66+
6567
false = False
6668
true = True
6769

@@ -223,6 +225,7 @@ else:
223225
if not HTML and arg.find("EXIT_RUNTIME") > 0:
224226
continue
225227

228+
226229
if arg.lower() in ("-fpic", "-latomic"):
227230
continue
228231

python-wasi-sdk.sh

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22
reset
33

44
if [ $UID -ne 0 ]; then
5-
echo "not UID 0, assuming not docker"
5+
echo "not UID 0, assuming no docker/proot"
66
else
7-
echo "UID 0, assuming docker debian:stable"
8-
apt-get update && apt-get --yes install build-essential clang autoconf wget curl lz4 lsb-release zlib1g-dev libssl-dev git
7+
if [ -f /alpine ]
8+
then
9+
echo "UID 0, with alpine proot"
10+
11+
else
12+
echo "UID 0, assuming docker debian:stable"
13+
apt-get update && apt-get --yes install build-essential clang autoconf wget curl lz4 lsb-release zlib1g-dev libssl-dev git
14+
fi
915
fi
1016

17+
1118
[ -f ../config ] && . ../config
1219

1320
# TODO: check how dbg tools work with default settings
@@ -20,6 +27,19 @@ else
2027
SYS_PYTHON=$(which python)
2128
fi
2229

30+
which strip || cp /bin/true /usr/bin/strip
31+
32+
pause () {
33+
if ${CI}
34+
then
35+
echo -n
36+
else
37+
echo "<paused> press enter ..."
38+
read
39+
fi
40+
}
41+
42+
2343
DISTRIB_RELEASE=${DISTRIB_RELEASE:-any}
2444

2545
# is it linux enough ?
@@ -39,7 +59,7 @@ else
3959
export DISTRIB_ID=$($SYS_PYTHON -E -c "print(__import__('sysconfig').get_config_var('HOST_GNU_TYPE'))")
4060
export PLATFORM=$($SYS_PYTHON -E -c "print(__import__('sys').platform)")
4161
echo no /etc/lsb-release found, please identify platform $PLATFORM : \"${DISTRIB_ID}-${DISTRIB_RELEASE}\" or hit enter to continue
42-
read
62+
pause
4363
fi
4464
fi
4565

@@ -48,7 +68,7 @@ export DISTRIB="${DISTRIB_ID}-${DISTRIB_RELEASE}"
4868
export SDKROOT=${SDKROOT:-/tmp/sdk}
4969

5070
# default is behave like a CI
51-
export CI={CI:-true}
71+
export CI=${CI:-true}
5272

5373
# maybe have ci flavours later
5474
export CIVER=${CIVER:-$DISTRIB}
@@ -156,23 +176,36 @@ do
156176
cd ${SDKROOT}
157177
. scripts/cpython-fetch.sh
158178

179+
pause
180+
159181
cd ${SDKROOT}
160182

161183
# generic wasm patchwork
162184
. support/__EMSCRIPTEN__.sh
163185

186+
pause
187+
164188
. scripts/cpython-build-host.sh 2>&1 >/tmp/python-wasm-sdk.log
165189

166-
[ -f $HPY ] || exit 100
190+
pause
191+
192+
if [ -f $HPY ]
193+
then
194+
pause
195+
else
196+
cat /tmp/python-wasm-sdk.log
197+
exit 192
198+
fi
167199

168200
. scripts/cpython-build-host-deps.sh > /dev/null
169201

202+
pause
203+
170204
fi
171205

172-
[ -f $HPY ] || exit 106
173206

174207

175-
cat > /opt/python-wasm-sdk/devices/$(arch)/usr/bin/py <<END
208+
cat > ${SDKROOT}/devices/$(arch)/usr/bin/py <<END
176209
#!/bin/bash
177210
export XDG_SESSION_TYPE=x11
178211
export SDKROOT=${SDKROOT}
@@ -183,20 +216,20 @@ export PATH=${SDKROOT}/devices/$(arch)/usr/bin:\$PATH
183216
export LD_LIBRARY_PATH=${SDKROOT}/devices/$(arch)/usr/lib:${SDKROOT}/devices/$(arch)/usr/lib64:$LD_LIBRARY_PATH
184217
${SDKROOT}/devices/$(arch)/usr/bin/python\${PYBUILD:-$PYBUILD} \$@
185218
END
186-
chmod +x /opt/python-wasm-sdk/devices/$(arch)/usr/bin/py
219+
chmod +x ${SDKROOT}/devices/$(arch)/usr/bin/py
187220

188221
# always install wasmtime because wasm-objdump needs it.
189-
if [ -f ${SDKROOT}/devices/$(arch)/usr/bin/wastime ]
222+
if [ -f ${SDKROOT}/devices/$(arch)/usr/bin/wasmtime ]
190223
then
191224
echo "keeping installed wasmtime and wasi binaries"
192225
else
193226
# wget https://github.com/bytecodealliance/wasmtime/releases/download/v22.0.0/wasmtime-v22.0.0-x86_64-linux.tar.xz
194227
# wget https://github.com/bytecodealliance/wasmtime/releases/download/v26.0.1/wasmtime-v26.0.1-$(arch)-$(PLATFORM).tar.xz
195228
# wget https://github.com/bytecodealliance/wasmtime/releases/download/v27.0.0/wasmtime-v27.0.0-$(arch)-${PLATFORM}.tar.xz
196-
#
229+
# wget https://github.com/bytecodealliance/wasmtime/releases/download/v29.0.1/wasmtime-v29.0.1-$(arch)-${PLATFORM}.tar.xz
197230
# TODO: window only has a zip archive, better use wasmtime-py instead.
198231

199-
wget https://github.com/bytecodealliance/wasmtime/releases/download/v29.0.1/wasmtime-v29.0.1-$(arch)-${PLATFORM}.tar.xz \
232+
wget https://github.com/bytecodealliance/wasmtime/releases/download/v33.0.0/wasmtime-v33.0.0-$(arch)-${PLATFORM}.tar.xz \
200233
-O-|xzcat|tar xfv -
201234
mv -vf $(find wasmtime*|grep /wasmtime$) ${SDKROOT}/devices/$(arch)/usr/bin
202235
fi
@@ -209,29 +242,6 @@ END
209242

210243
mkdir -p src build ${SDKROOT}/devices/${TARGET} ${SDKROOT}/prebuilt/${TARGET}
211244

212-
if [ -f /tmp/emsdk.tar ]
213-
then
214-
echo "
215-
216-
217-
===========================================================================
218-
219-
Using emsdk cache from :
220-
221-
$(cat /tmp/sdk/emsdk.version)
222-
223-
224-
===========================================================================
225-
226-
227-
228-
"
229-
pushd /
230-
tar xfp /tmp/emsdk.tar
231-
mkdir -p ${SDKROOT}/src ${SDKROOT}/build
232-
popd
233-
fi
234-
235245
# use ./ or emsdk will pollute env
236246
if echo $EMFLAVOUR|grep -q ^3\\.
237247
then
@@ -321,14 +331,12 @@ END
321331

322332
> ${SDKROOT}/python3-${TARGET}
323333

324-
# ROOT=/opt/python-wasm-sdk SDKROOT=/opt/python-wasm-sdk
325-
# HOST_PREFIX=/opt/python-wasm-sdk/devices/$(arch)/usr
326334
> ${SDKROOT}/wasm32-${TARGET}-shell.sh
327335

328336
CPU=wasm32
329337
CPU=$CPU TARGET=$TARGET PYDK_PYTHON_HOST_PLATFORM=${CPU}-${TARGET} \
330338
PYDK_SYSCONFIG_PLATFORM=${CPU}-${TARGET} \
331-
PREFIX=/opt/python-wasm-sdk/devices/${TARGET}sdk/usr \
339+
PREFIX=${SDKROOT}/devices/${TARGET}sdk/usr \
332340
./scripts/make-shells.sh
333341

334342
cat >> $ROOT/${CPU}-${TARGET}-shell.sh <<END

python-wasm-sdk.sh

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22
reset
33

44
if [ $UID -ne 0 ]; then
5-
echo "not UID 0, assuming not docker"
5+
echo "not UID 0, assuming no docker/proot"
66
else
7-
echo "UID 0, assuming docker debian:stable"
8-
apt-get update && apt-get --yes install build-essential clang autoconf wget curl lz4 lsb-release zlib1g-dev libssl-dev git
7+
if [ -f /alpine ]
8+
then
9+
echo "UID 0, with alpine proot"
10+
11+
else
12+
echo "UID 0, assuming docker debian:stable"
13+
apt-get update && apt-get --yes install build-essential clang autoconf wget curl lz4 lsb-release zlib1g-dev libssl-dev git
14+
fi
915
fi
1016

17+
1118
[ -f ../config ] && . ../config
1219

1320
# TODO: check how dbg tools work with default settings
@@ -20,6 +27,19 @@ else
2027
SYS_PYTHON=$(which python)
2128
fi
2229

30+
which strip || cp /bin/true /usr/bin/strip
31+
32+
pause () {
33+
if ${CI}
34+
then
35+
echo -n
36+
else
37+
echo "<paused> press enter ..."
38+
read
39+
fi
40+
}
41+
42+
2343
DISTRIB_RELEASE=${DISTRIB_RELEASE:-any}
2444

2545
# is it linux enough ?
@@ -39,7 +59,7 @@ else
3959
export DISTRIB_ID=$($SYS_PYTHON -E -c "print(__import__('sysconfig').get_config_var('HOST_GNU_TYPE'))")
4060
export PLATFORM=$($SYS_PYTHON -E -c "print(__import__('sys').platform)")
4161
echo no /etc/lsb-release found, please identify platform $PLATFORM : \"${DISTRIB_ID}-${DISTRIB_RELEASE}\" or hit enter to continue
42-
read
62+
pause
4363
fi
4464
fi
4565

@@ -48,7 +68,7 @@ export DISTRIB="${DISTRIB_ID}-${DISTRIB_RELEASE}"
4868
export SDKROOT=${SDKROOT:-/tmp/sdk}
4969

5070
# default is behave like a CI
51-
export CI={CI:-true}
71+
export CI=${CI:-true}
5272

5373
# maybe have ci flavours later
5474
export CIVER=${CIVER:-$DISTRIB}
@@ -156,23 +176,36 @@ do
156176
cd ${SDKROOT}
157177
. scripts/cpython-fetch.sh
158178

179+
pause
180+
159181
cd ${SDKROOT}
160182

161183
# generic wasm patchwork
162184
. support/__EMSCRIPTEN__.sh
163185

186+
pause
187+
164188
. scripts/cpython-build-host.sh 2>&1 >/tmp/python-wasm-sdk.log
165189

166-
[ -f $HPY ] || exit 100
190+
pause
191+
192+
if [ -f $HPY ]
193+
then
194+
pause
195+
else
196+
cat /tmp/python-wasm-sdk.log
197+
exit 192
198+
fi
167199

168200
. scripts/cpython-build-host-deps.sh > /dev/null
169201

202+
pause
203+
170204
fi
171205

172-
[ -f $HPY ] || exit 106
173206

174207

175-
cat > /opt/python-wasm-sdk/devices/$(arch)/usr/bin/py <<END
208+
cat > ${SDKROOT}/devices/$(arch)/usr/bin/py <<END
176209
#!/bin/bash
177210
export XDG_SESSION_TYPE=x11
178211
export SDKROOT=${SDKROOT}
@@ -183,20 +216,20 @@ export PATH=${SDKROOT}/devices/$(arch)/usr/bin:\$PATH
183216
export LD_LIBRARY_PATH=${SDKROOT}/devices/$(arch)/usr/lib:${SDKROOT}/devices/$(arch)/usr/lib64:$LD_LIBRARY_PATH
184217
${SDKROOT}/devices/$(arch)/usr/bin/python\${PYBUILD:-$PYBUILD} \$@
185218
END
186-
chmod +x /opt/python-wasm-sdk/devices/$(arch)/usr/bin/py
219+
chmod +x ${SDKROOT}/devices/$(arch)/usr/bin/py
187220

188221
# always install wasmtime because wasm-objdump needs it.
189-
if [ -f ${SDKROOT}/devices/$(arch)/usr/bin/wastime ]
222+
if [ -f ${SDKROOT}/devices/$(arch)/usr/bin/wasmtime ]
190223
then
191224
echo "keeping installed wasmtime and wasi binaries"
192225
else
193226
# wget https://github.com/bytecodealliance/wasmtime/releases/download/v22.0.0/wasmtime-v22.0.0-x86_64-linux.tar.xz
194227
# wget https://github.com/bytecodealliance/wasmtime/releases/download/v26.0.1/wasmtime-v26.0.1-$(arch)-$(PLATFORM).tar.xz
195228
# wget https://github.com/bytecodealliance/wasmtime/releases/download/v27.0.0/wasmtime-v27.0.0-$(arch)-${PLATFORM}.tar.xz
196-
#
229+
# wget https://github.com/bytecodealliance/wasmtime/releases/download/v29.0.1/wasmtime-v29.0.1-$(arch)-${PLATFORM}.tar.xz
197230
# TODO: window only has a zip archive, better use wasmtime-py instead.
198231

199-
wget https://github.com/bytecodealliance/wasmtime/releases/download/v29.0.1/wasmtime-v29.0.1-$(arch)-${PLATFORM}.tar.xz \
232+
wget https://github.com/bytecodealliance/wasmtime/releases/download/v33.0.0/wasmtime-v33.0.0-$(arch)-${PLATFORM}.tar.xz \
200233
-O-|xzcat|tar xfv -
201234
mv -vf $(find wasmtime*|grep /wasmtime$) ${SDKROOT}/devices/$(arch)/usr/bin
202235
fi
@@ -209,29 +242,6 @@ END
209242

210243
mkdir -p src build ${SDKROOT}/devices/${TARGET} ${SDKROOT}/prebuilt/${TARGET}
211244

212-
if [ -f /tmp/emsdk.tar ]
213-
then
214-
echo "
215-
216-
217-
===========================================================================
218-
219-
Using emsdk cache from :
220-
221-
$(cat /tmp/sdk/emsdk.version)
222-
223-
224-
===========================================================================
225-
226-
227-
228-
"
229-
pushd /
230-
tar xfp /tmp/emsdk.tar
231-
mkdir -p ${SDKROOT}/src ${SDKROOT}/build
232-
popd
233-
fi
234-
235245
# use ./ or emsdk will pollute env
236246
if echo $EMFLAVOUR|grep -q ^3\\.
237247
then
@@ -321,14 +331,12 @@ END
321331

322332
> ${SDKROOT}/python3-${TARGET}
323333

324-
# ROOT=/opt/python-wasm-sdk SDKROOT=/opt/python-wasm-sdk
325-
# HOST_PREFIX=/opt/python-wasm-sdk/devices/$(arch)/usr
326334
> ${SDKROOT}/wasm32-${TARGET}-shell.sh
327335

328336
CPU=wasm32
329337
CPU=$CPU TARGET=$TARGET PYDK_PYTHON_HOST_PLATFORM=${CPU}-${TARGET} \
330338
PYDK_SYSCONFIG_PLATFORM=${CPU}-${TARGET} \
331-
PREFIX=/opt/python-wasm-sdk/devices/${TARGET}sdk/usr \
339+
PREFIX=${SDKROOT}/devices/${TARGET}sdk/usr \
332340
./scripts/make-shells.sh
333341

334342
cat >> $ROOT/${CPU}-${TARGET}-shell.sh <<END

scripts/cpython-build-emsdk.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
# for allowing to avoid pyc creation
88

99
echo "
10-
* building cpython-wasm EMSDK_PYTHON=$SYS_PYTHON
10+
11+
* building cpython-wasm EMSDK_PYTHON=$SYS_PYTHON and install to $PREFIX
12+
1113
" 1>&2
1214

1315

0 commit comments

Comments
 (0)