File tree Expand file tree Collapse file tree 11 files changed +138
-56
lines changed Expand file tree Collapse file tree 11 files changed +138
-56
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -27,16 +27,13 @@ export XDG_DATA_HOME=${HOME}/build/share
2727export XDG_CACHE_HOME=${HOME} /build/cache
2828export XDG_CONFIG_HOME=${HOME} /build/config
2929export XDG_DATA_DIRS=${HOME} /build/share
30-
3130mkdir -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
3334export HPY=${HOST_PREFIX} /bin/python${PYBUILD}
3435export 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
4239if [ -f /mvp ]
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}
158155for py in 10 9 8
159156do
160157 if command -v python${PYMAJOR} .${py} > /dev/null
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change 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
819then
9- SYS_PYTHON=$( command -v python3)
20+ SYS_PYTHON=$( which python3)
1021else
11- SYS_PYTHON=$( command -v python)
22+ SYS_PYTHON=$( which python)
1223fi
1324
14- DISTRIB_RELEASE=" any"
25+ DISTRIB_RELEASE=${DISTRIB_RELEASE :- any}
1526
1627# is it linux enough ?
1728if [ -f /etc/lsb-release ]
2031 export PLATFORM=linux
2132else
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
2738fi
2839
2940export DISTRIB=" ${DISTRIB_ID} -${DISTRIB_RELEASE} "
6071 fi
6172done
6273
63- if [ -d ${SDKROOT} ]
74+ if mkdir -p ${SDKROOT}
6475then
6576 echo " Assuming destination $SDKROOT is ready"
6677else
Original file line number Diff line number Diff line change 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
819then
9- SYS_PYTHON=$( command -v python3)
20+ SYS_PYTHON=$( which python3)
1021else
11- SYS_PYTHON=$( command -v python)
22+ SYS_PYTHON=$( which python)
1223fi
1324
14- DISTRIB_RELEASE=" any"
25+ DISTRIB_RELEASE=${DISTRIB_RELEASE :- any}
1526
1627# is it linux enough ?
1728if [ -f /etc/lsb-release ]
2031 export PLATFORM=linux
2132else
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
2738fi
2839
2940export DISTRIB=" ${DISTRIB_ID} -${DISTRIB_RELEASE} "
6071 fi
6172done
6273
63- if [ -d ${SDKROOT} ]
74+ if mkdir -p ${SDKROOT}
6475then
6576 echo " Assuming destination $SDKROOT is ready"
6677else
Original file line number Diff line number Diff line change 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
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"
Original file line number Diff line number Diff line change 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)
Original file line number Diff line number Diff line change 7979
8080if echo $PYBUILD | grep -q 13$
8181then
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
Original file line number Diff line number Diff line change 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
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
Original file line number Diff line number Diff line change @@ -118,8 +118,9 @@ c = 'emcc'
118118cpp = 'em++'
119119ar = 'emar'
120120ranlib = '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]
124125growing_stack = true
125126have_c99_vsnprintf = true
@@ -136,6 +137,10 @@ system = 'emscripten'
136137cpu_family = 'wasm32'
137138cpu = 'wasm32'
138139endian = 'little'
140+
141+ [ninja]
142+ backend_max_links = 1
143+
139144END
140145
141146 meson setup _build --prefix=$PREFIX --cross-file=emscripten-crossfile.meson --default-library=static --buildtype=release \
You can’t perform that action at this time.
0 commit comments