This directory contains everything needed to build the local git2cpp source code as an
WebAssembly Emscripten-forge package, create local
cockle and
JupyterLite terminal deployments that run in a browser,
and test the WebAssembly build.
It works on Linux and macOS but not Windows.
There are 5 sub-directories:
recipe: build localgit2cppsource code into an Emscripten-forge package.cockle-deploy: create acockledeployment in theservedirectory.lite-deploy: create a JupyterLiteterminaldeployment in theservedirectory.serve: where the two deployments are served from.test: test the WebAssembly build.
The build, deploy and test process uses a separate micromamba environment defined in
wasm-environment.yml. To set this up use from within this directory:
micromamba create -f wasm-environment.yml
micromamba activate git2cpp-wasmThen to build the WebAssembly package, both deployments and the testing resources use:
cmake .
makeThe built emscripten-forge package will be file named something like git2cpp-0.0.5-h7223423_1.tar.bz2
in the directory recipe/em-force-recipes/output/emscripten-wasm32.
The local deployments in the serve directory can be manually checked using:
make serveand open a web browser at http://localhost:8080/. Confirm that the local build of git2cpp is being
used in the two deployments by running cockle-config package at the command line, the output
should be something like:
Note that the source for the git2cpp package is the local filesystem rather than from
prefix.dev. The version number of git2cpp in this table is not necessarily correct as it is the
version number of the current Emscripten-forge recipe rather than the version of the local git2cpp
source code which can be checked using git2cpp -v at the cockle/terminal command line.
To test the WebAssembly build use:
make testThis runs (some of) the tests in the top-level test directory with various monkey patching so that
git2cpp commands are executed in the browser. If there are problems running the tests then ensure
you have the latest playwright browser installed:
playwright install chromiumAfter making changes to the local git2cpp source code you can rebuild the WebAssembly package,
both deployments and test code using:
make rebuild