Skip to content

Add Windows Emscripten build of xeus-cpp to ci #647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 57 additions & 3 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,13 @@ jobs:
.\emsdk\emsdk_env.ps1
$env:PWD_DIR= $PWD.Path
$env:SYSROOT_PATH="$env:EMSDK/upstream/emscripten/cache/sysroot"
$env:PREFIX="%CONDA_PREFIX%/envs/CppInterOp-wasm"
echo "SYSROOT_PATH=$env:SYSROOT_PATH"
echo "SYSROOT_PATH=$env:SYSROOT_PATH" >> $env:GITHUB_ENV

$env:PREFIX="$env:MAMBA_ROOT_PREFIX/envs/CppInterOp-wasm"
echo "PREFIX=$env:PREFIX"
echo "PREFIX=$env:PREFIX" >> $env:GITHUB_ENV

$env:CMAKE_PREFIX_PATH=$env:PREFIX
$env:CMAKE_SYSTEM_PREFIX_PATH=$env:PREFIX

Expand Down Expand Up @@ -835,6 +841,11 @@ jobs:
emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html
cd ..\..
emmake make -j ${{ env.ncpus }} install
echo "SYSROOT_PATH=$env:SYSROOT_PATH" >> $GITHUB_ENV
echo "CPPINTEROP_DIR=$env:CPPINTEROP_DIR" >> $GITHUB_ENV
echo "LLVM_BUILD_DIR=$env:LLVM_BUILD_DIR" >> $GITHUB_ENV
echo "CPLUS_INCLUDE_PATH=$env:CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
echo "PREFIX=$env:PREFIX" >> $GITHUB_ENV

- name: Build and Test/Install CppInterOp on Windows systems (static library)
if: ${{ runner.os == 'windows' }}
Expand Down Expand Up @@ -926,7 +937,7 @@ jobs:
echo "Running DynamicLibraryManagerTests in Chromium"
emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html

- name: Build xeus-cpp
- name: Build xeus-cpp on Unix Systems
if: ${{ runner.os != 'windows' }}
shell: bash -l {0}
run: |
Expand All @@ -950,7 +961,32 @@ jobs:
..
emmake make -j ${{ env.ncpus }} install

- name: Test xeus-cpp C++ Emscripten
- name: Build xeus-cpp on Windows systems
if: ${{ runner.os == 'windows' }}
shell: powershell
run: |
.\emsdk\emsdk activate ${{matrix.emsdk_ver}}
.\emsdk\emsdk_env.ps1
micromamba activate CppInterOp-wasm
git clone https://github.com/mcbarton/xeus-cpp.git
cd .\xeus-cpp
git checkout Enable-Windows-Emscripten-build
mkdir build
pushd build
$env:CMAKE_PREFIX_PATH="${{ env.PREFIX }}"
$env:CMAKE_SYSTEM_PREFIX_PATH="${{ env.PREFIX }}"
emcmake cmake `
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
-DCMAKE_PREFIX_PATH=${{ env.PREFIX }} `
-DCMAKE_INSTALL_PREFIX=${{ env.PREFIX }} `
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON `
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON `
-DXEUS_CPP_RESOURCE_DIR=${{ env.LLVM_BUILD_DIR }}\lib\clang\${{ matrix.clang-runtime }} `
-DSYSROOT_PATH=${{ env.SYSROOT_PATH }} `
..
emmake make -j ${{ env.ncpus }} install

- name: Test xeus-cpp C++ Emscripten on Unix Systems
if: ${{ runner.os != 'windows' }}
shell: bash -l {0}
run: |
Expand All @@ -959,6 +995,15 @@ jobs:
cd ./xeus-cpp/build/test
node test_xeus_cpp.js

- name: Test xeus-cpp C++ Emscripten on Windows Systems
if: ${{ runner.os == 'windows' }}
shell: powershell
run: |
$ErrorActionPreference = "Stop"
micromamba activate CppInterOp-wasm
cd .\xeus-cpp\build\test
node test_xeus_cpp.js

- name: Jupyter Lite integration
if: ${{ runner.os != 'windows' }}
shell: bash -l {0}
Expand All @@ -967,3 +1012,12 @@ jobs:
micromamba create -n xeus-lite-host jupyterlite-core=0.6 jupyterlite-xeus jupyter_server jupyterlab notebook python-libarchive-c -c conda-forge
micromamba activate xeus-lite-host
jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }} --contents notebooks/xeus-cpp-lite-demo.ipynb --contents notebooks/smallpt.ipynb --contents notebooks/images/marie.png --contents notebooks/audio/audio.wav --output-dir dist

- name: Jupyter Lite integration
if: ${{ runner.os == 'windows' }}
shell: powershell
run: |
cd .\xeus-cpp\
micromamba create -n xeus-lite-host jupyterlite-core=0.6 jupyterlite-xeus jupyter_server jupyterlab notebook python-libarchive-c -c conda-forge
micromamba activate xeus-lite-host
jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }} --contents notebooks/xeus-cpp-lite-demo.ipynb --contents notebooks/smallpt.ipynb --contents notebooks/images/marie.png --contents notebooks/audio/audio.wav --output-dir dist
Loading