Skip to content

Commit

Permalink
cleanup, 3.13.0 + 3.14pre
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Oct 9, 2024
1 parent ec1a32d commit 292ca5d
Show file tree
Hide file tree
Showing 114 changed files with 25,244 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
build:
runs-on: ubuntu-22.04
env:
BUILDS: 3.12 3.13
BUILDS: 3.12 3.13 3.14
EMFLAVOUR: tot

steps:
Expand Down
40 changes: 26 additions & 14 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export CPOPTS="-Os -g0 -fPIC"

if [ -f ${ROOT}/dev ]
then
export COPTS="-O1 -g3 -fPIC"
export COPTS="-fPIC"
export QUIET=""
else
export COPTS="-Os -g0 -fPIC"
export COPTS="-fPIC"
if ${VERBOSE:-false}
then
export QUIET=""
Expand All @@ -68,7 +68,7 @@ else
export WASM_PURE=false
fi


EXTRABINS="/usr/local/bin /opt/bin"

# ============ emscripten ==============

Expand Down Expand Up @@ -99,6 +99,7 @@ export WASISDK="${SDKROOT}/wasisdk"

export WASMTIME_HOME=$WASISDK

# EXTRABINS="$EXTRABINS $WASISDK/bin"

# =============== Nimrod ====================

Expand All @@ -113,9 +114,29 @@ NIM_URL=https://github.com/nim-lang/Nim
export NIM_VERSION NIM_URL
export NIMSDK=${NIMSDK:-"${SDKROOT}/nimsdk"}

# EXTRABINS="$EXTRABINS $NIMSDK/bin"

# ================ go =====================

export GOMODCACHE=$XDG_CACHE_HOME
export GOPATH=$SDKROOT/go
export GOROOT=$SDKROOT/go

EXTRABINS="$EXTRABINS $GOROOT/bin"


# ================ bun ====================
export BUN_INSTALL=${SDKROOT}/bun

EXTRABINS="$EXTRABINS $BUN_INSTALL/bin"

# ================ aosp ===================

AOSP_NDK=25.2.9519653


PATH=/usr/bin:/bin
for extrabin in /usr/local/bin /opt/bin
for extrabin in $EXTRABINS
do
if echo $PATH|grep -q ":$extrabin"
then
Expand All @@ -128,18 +149,9 @@ do
fi
done

# ================ bun ====================
export BUN_INSTALL="$HOME/.bun"
export PATH=$BUN_INSTALL/bin:$PATH

# ================ aosp ===================

AOSP_NDK=25.2.9519653



# this is python used for emsdk : ${SYS_PYTHON} -> ${EMSDK_PYTHON}
for py in 10 9 8 7
for py in 10 9 8
do
if command -v python${PYMAJOR}.${py} >/dev/null
then
Expand Down
115 changes: 92 additions & 23 deletions python-wasi-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ else
sudo chmod 777 ${SDKROOT}
fi

chmod +x ${SDKROOT}/scripts/*

ORIGIN=$(pwd)

Expand All @@ -62,10 +61,15 @@ do
echo "${SDKROOT}/dev found : using build cache"
else
echo "doing a clean build"
if [ -d ${SDKROOT}/go ]
then
chown -R u+wxr ${SDKROOT}/build ${SDKROOT}/go
fi
rm -rf ${SDKROOT}/* ${SDKROOT}/.??*
fi

cp -Rf * ${SDKROOT}/
chmod +x ${SDKROOT}/scripts/*

if cd ${SDKROOT}/
then
Expand All @@ -82,11 +86,32 @@ do

cd ${SDKROOT}


if [ ${PYMINOR} -ge 13 ]
then
GILOPT=true
if ${Py_GIL_DISABLED:-false}
then
GIL="--disable-gil --with-mimalloc --disable-experimental-jit"
else
Py_GIL_DISABLED=false
GIL="--without-mimalloc --disable-experimental-jit"
fi
else
GILOPT=false
GIL=""
fi

export GILOPT
export Py_GIL_DISABLED


if [ -f $HPY ]
then
echo " re-using host python HPY=$HPY"

else

cd ${SDKROOT}
. scripts/cpython-fetch.sh

Expand Down Expand Up @@ -135,40 +160,84 @@ END

mkdir -p src build ${SDKROOT}/devices/emsdk ${SDKROOT}/prebuilt/emsdk

# use ./ or emsdk will pollute env
./scripts/emsdk-fetch.sh
if [ -f /tmp/sdk/emsdk.tar ]
then
echo "
echo " ------------ building cpython wasm ${PYBUILD} ${CIVER} ----------------" 1>&2
if ./scripts/cpython-build-emsdk.sh > /dev/null
then
echo " ---------- building cpython wasm plus ${PYBUILD} ${CIVER} -----------" 1>&2
if ./scripts/cpython-build-emsdk-deps.sh > /dev/null
then
===========================================================================
Using emsdk cache from :
$(cat /tmp/sdk/emsdk.version)
echo " --------- adding some usefull pkg ${PYBUILD} ${CIVER} ---------" 1>&2
./scripts/cpython-build-emsdk-prebuilt.sh
===========================================================================
echo "
==========================================================
stripping emsdk ${PYBUILD} ${CIVER}
==========================================================
" 1>&2
rm -rf ${SDKROOT}/emsdk/upstream/emscripten/cache/ports*
rm -rf ${SDKROOT}/emsdk/upstream/emscripten/cache/ports/sdl2/SDL-*
rm -rf ${SDKROOT}/emsdk/upstream/emscripten/cache/ports
rm -rf ${SDKROOT}/emsdk/upstream/emscripten/cache/ports-builds
rm -rf ${SDKROOT}/emsdk/upstream/emscripten/tests
"
pushd /
tar xfp /tmp/sdk/emsdk.tar
mkdir -p ${SDKROOT}/src ${SDKROOT}/build
popd
fi

# use ./ or emsdk will pollute env
./scripts/emsdk-fetch.sh > /dev/null

echo " ---------- building cpython wasm support ${PYBUILD} ${CIVER} -----------" 1>&2

if [ -f /tmp/sdk/emsdk.tar ]
then
echo " using cache "
else
if ./scripts/cpython-build-emsdk-deps.sh
then
if [ -f /pp ]
then
pushd /
tar -cpR $SDKROOT \
--exclude=${SDKROOT}/config \
--exclude=${SDKROOT}/*sh \
--exclude=${SDKROOT}/scripts/* \
--exclude=${SDKROOT}/build \
--exclude=${SDKROOT}/src \
> /tmp/sdk/emsdk.tar

date "+%d-%m-%4Y" > /tmp/sdk/emsdk.version
popd
fi
else
echo " cpython-build-emsdk-deps failed" 1>&2
exit 124
exit 182
fi
fi



echo " ------------ building cpython wasm ${PYBUILD} ${CIVER} ----------------" 1>&2
if ./scripts/cpython-build-emsdk.sh > /dev/null
then

echo " --------- adding some usefull pkg ${PYBUILD} ${CIVER} ---------" 1>&2
./scripts/cpython-build-emsdk-prebuilt.sh || exit 213

echo "
==========================================================
stripping emsdk ${PYBUILD} ${CIVER}
========================================================== " 1>&2

rm -rf ${SDKROOT}/emsdk/upstream/emscripten/cache/ports*
rm -rf ${SDKROOT}/emsdk/upstream/emscripten/cache/ports/sdl2/SDL-*
rm -rf ${SDKROOT}/emsdk/upstream/emscripten/cache/ports
rm -rf ${SDKROOT}/emsdk/upstream/emscripten/cache/ports-builds
rm -rf ${SDKROOT}/emsdk/upstream/emscripten/tests

else
echo " cpython-build-emsdk failed" 1>&2
exit 119
exit 207
fi

fi
Expand Down
Loading

0 comments on commit 292ca5d

Please sign in to comment.