Skip to content

Commit 28f8cd1

Browse files
committed
relocate to /opt/python-wasm-sdk
1 parent df5fc1d commit 28f8cd1

File tree

1 file changed

+35
-26
lines changed

1 file changed

+35
-26
lines changed

python-wasm-sdk.sh

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,51 @@
11
#!/bin/bash
22
reset
3+
sudo mkdir -p /opt/python-wasm-sdk
4+
sudo chmod 777 /opt/python-wasm-sdk
35

4-
mkdir -p build/pycache
5-
export PYTHONDONTWRITEBYTECODE=1
6+
mv * /opt/python-wasm-sdk/
67

7-
# make install cpython will force bytecode generation
8-
export PYTHONPYCACHEPREFIX="$(realpath build/pycache)"
8+
if cd /opt/python-wasm-sdk/
9+
then
10+
mkdir -p build/pycache
11+
export PYTHONDONTWRITEBYTECODE=1
912

10-
. ${CONFIG:-config}
13+
# make install cpython will force bytecode generation
14+
export PYTHONPYCACHEPREFIX="$(realpath build/pycache)"
1115

12-
. scripts/cpython-fetch.sh
13-
. support/__EMSCRIPTEN__.sh
14-
. scripts/cpython-build-host.sh >/dev/null
15-
. scripts/cpython-build-host-deps.sh >/dev/null
16+
. ${CONFIG:-config}
1617

17-
# use ./ or emsdk will pollute env
18-
./scripts/emsdk-fetch.sh
18+
. scripts/cpython-fetch.sh
19+
. support/__EMSCRIPTEN__.sh
20+
. scripts/cpython-build-host.sh >/dev/null
21+
. scripts/cpython-build-host-deps.sh >/dev/null
1922

20-
echo " ------------------- building cpython wasm -----------------------"
21-
if ./scripts/cpython-build-emsdk.sh > /dev/null
22-
then
23-
echo " ------------------- building cpython wasm plus -------------------"
24-
if ./scripts/cpython-build-emsdk-deps.sh > /dev/null
25-
then
26-
cd $GITHUB_WORKSPACE
27-
echo "making tarball"
23+
# use ./ or emsdk will pollute env
24+
./scripts/emsdk-fetch.sh
2825

26+
echo " ------------------- building cpython wasm -----------------------"
27+
if ./scripts/cpython-build-emsdk.sh > /dev/null
28+
then
29+
echo " ------------------- building cpython wasm plus -------------------"
30+
if ./scripts/cpython-build-emsdk-deps.sh > /dev/null
31+
then
32+
cd $GITHUB_WORKSPACE
33+
echo "making tarball"
34+
35+
mkdir -p sdk
36+
tar -cpRj config emsdk devices/* prebuilt/* > sdk/python-wasm-sdk-stable.tar.bz2
37+
else
38+
echo " cpython-build-emsdk-deps failed"
39+
exit 2
40+
fi
2941
mkdir -p sdk
3042
tar -cpRj config emsdk devices/* prebuilt/* > sdk/python-wasm-sdk-stable.tar.bz2
3143
else
32-
echo " cpython-build-emsdk-deps failed"
33-
exit 2
44+
echo " cpython-build-emsdk failed"
45+
exit 1
3446
fi
3547

48+
echo done
3649
else
37-
echo " cpython-build-emsdk failed"
38-
exit 1
50+
echo failed
3951
fi
40-
41-
echo done
42-

0 commit comments

Comments
 (0)