Skip to content

Commit

Permalink
Add debug builds (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiran authored Aug 8, 2022
1 parent 827425b commit 57a5782
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 6 deletions.
36 changes: 36 additions & 0 deletions .github/actions/build_emscripten/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ inputs:
type: choice
options:
- browser
- browser-debug
- node-dl
- node-dl-debug
- node-pthreads
configure_args:
required: false
Expand Down Expand Up @@ -45,6 +47,23 @@ runs:
--disable-wasm-pthreads \
${{ inputs.configure_args }}
if: "${{ inputs.flavor == 'browser' }}"
- name: configure "host" Python for browser-debug
shell: bash
working-directory: "${{ env.HOST_PYTHON_DIR }}"
run: |
set -ex
. $EMSDK_DIR/emsdk_env.sh
export EM_COMPILER_WRAPPER=ccache
CONFIG_SITE=${CPYTHON_DIR}/Tools/wasm/config.site-wasm32-emscripten \
emconfigure ${CPYTHON_DIR}/configure -C \
--build=$(${CPYTHON_DIR}/config.guess) \
--host=wasm32-unknown-emscripten \
--with-build-python=${BUILD_PYTHON_DIR}/python \
--with-emscripten-target=browser-debug \
--enable-wasm-dynamic-linking \
--disable-wasm-pthreads \
${{ inputs.configure_args }}
if: "${{ inputs.flavor == 'browser-debug' }}"
- name: configure "host" Python for node-dl
shell: bash
working-directory: "${{ env.HOST_PYTHON_DIR }}"
Expand All @@ -62,6 +81,23 @@ runs:
--disable-wasm-pthreads \
${{ inputs.configure_args }}
if: "${{ inputs.flavor == 'node-dl' }}"
- name: configure "host" Python for node-dl-debug
shell: bash
working-directory: "${{ env.HOST_PYTHON_DIR }}"
run: |
set -ex
. $EMSDK_DIR/emsdk_env.sh
export EM_COMPILER_WRAPPER=ccache
CONFIG_SITE=${CPYTHON_DIR}/Tools/wasm/config.site-wasm32-emscripten \
emconfigure ${CPYTHON_DIR}/configure -C \
--build=$(${CPYTHON_DIR}/config.guess) \
--host=wasm32-unknown-emscripten \
--with-build-python=${BUILD_PYTHON_DIR}/python \
--with-emscripten-target=node-debug \
--enable-wasm-dynamic-linking \
--disable-wasm-pthreads \
${{ inputs.configure_args }}
if: "${{ inputs.flavor == 'node-dl-debug' }}"
- name: configure "host" Python for node-pthreads
shell: bash
working-directory: "${{ env.HOST_PYTHON_DIR }}"
Expand Down
2 changes: 2 additions & 0 deletions .github/actions/package_emscripten/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ inputs:
type: choice
options:
- browser
- browser-debug
- node-dl
- node-dl-debug
- node-pthreads
runs:
using: "composite"
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/emsdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ jobs:
- "3.11"
- "main"
flavor:
- browser
- browser-debug
- node-dl
- node-dl-debug
- node-pthreads
- browser
steps:
- uses: actions/checkout@v2
- name: "Clone and build 'build' Python ${{ matrix.python_version }}"
Expand All @@ -58,15 +60,15 @@ jobs:
set -e
. $EMSDK_DIR/emsdk_env.sh
make pythoninfo
if: "${{ matrix.flavor != 'browser' }}"
if: ${{ matrix.flavor == 'node-dl' || matrix.flavor == 'node-dl-debug' || matrix.flavor == 'node-pthreads' }}
- name: Run tests
shell: bash
working-directory: "${{ env.HOST_PYTHON_DIR }}"
run: |
set -e
. $EMSDK_DIR/emsdk_env.sh
make buildbottest TESTOPTS="-j2"
if: ${{ matrix.flavor != 'browser' }}
if: ${{ matrix.flavor == 'node-dl' || matrix.flavor == 'node-pthreads' }}
- name: "Package ${{ matrix.python_version }} ${{ matrix.flavor }}"
uses: ./.github/actions/package_emscripten
id: package
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
The files must be served from a web server. You can use the `./wasm_webserver.py` script to run a local web server and access the browser REPL from http://localhost:8000/python.html
The `*browser-debug.zip` is a debug build with additional debug symbols and fewer optimizations.
## `Python-${{ env.PYTHON_TAG }}-wasm32-emscripten-${{ inputs.emsdk_version }}-node-dl.zip`
Python on NodeJS (dynamic linking enabled).
Expand All @@ -82,6 +84,8 @@ jobs:
node --experimental-wasm-bigint python.js
```
The `*node-dl-debug.zip` is a debug build with additional debug symbols and fewer optimizations.
## `Python-${{ env.PYTHON_TAG }}-wasm32-emscripten-${{ inputs.emsdk_version }}-node-pthreads.zip`
Python on NodeJS (pthread emulation enabled).
Expand Down Expand Up @@ -179,9 +183,11 @@ jobs:
fail-fast: false
matrix:
flavor:
- browser
- browser-debug
- node-dl
- node-dl-debug
- node-pthreads
- browser
steps:
- uses: actions/checkout@v2
- name: "Clone and build 'build' Python ${{ inputs.python_tag }}"
Expand All @@ -208,15 +214,15 @@ jobs:
set -e
. $EMSDK_DIR/emsdk_env.sh
make pythoninfo
if: "${{ matrix.flavor != 'browser' }}"
if: ${{ matrix.flavor == 'node-dl' || matrix.flavor == 'node-dl-debug' || matrix.flavor == 'node-pthreads' }}
- name: Run tests
shell: bash
working-directory: "${{ env.HOST_PYTHON_DIR }}"
run: |
set -e
. $EMSDK_DIR/emsdk_env.sh
make buildbottest TESTOPTS="-j2"
if: ${{ matrix.flavor != 'browser' }}
if: ${{ matrix.flavor == 'node-dl' || matrix.flavor == 'node-pthreads' }}
- name: "Package ${{ inputs.python_tag }} ${{ matrix.flavor }}"
uses: ./.github/actions/package_emscripten
id: package
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ The `emsdk-tot-upstream` builds are using Emscripte tip-of-tree (nightlies).
### Emscripten browser target

- `Python-3.11dev-wasm32-emscripten-3.1.18-browser`: Python 3.11 branch, Emscripten SDK 3.1.18
- `Python-3.11dev-wasm32-emscripten-3.1.18-browser-debug`: Python 3.11 branch,
Emscripten SDK 3.1.18, debug build with additional symbols and fewer
optimizations
- `Python-3.11dev-wasm32-emscripten-3.1.18-browser`: Python main branch (3.12), Emscripten SDK 3.1.18

The files must be served from a web server. You can use the
Expand All @@ -30,6 +33,9 @@ access the browser REPL from http://localhost:8000/python.html

- `Python-3.11dev-wasm32-emscripten-3.1.18-node-dl`: WASM dynamic linking, Python
3.11 branch, Emscripten SDK 3.1.18
- `Python-3.11dev-wasm32-emscripten-3.1.18-node-dl-debug`: WASM dynamic linking, Python
3.11 branch, Emscripten SDK 3.1.18, debug build with additional debug symbols and fewer
optimizations
- `Python-3.12dev-wasm32-emscripten-3.1.18-node-dl`: WASM dynamic linking, Python
main branch (3.12), Emscripten SDK 3.1.18
- `Python-3.11dev-wasm32-emscripten-3.1.18-node-pthreads`: WASM pthreads emulation,
Expand Down

0 comments on commit 57a5782

Please sign in to comment.