Task #3545

Updated by Jan-Marek Glogowski about 2 years ago

The goal is to have a tinderbox, which builds the feature/wasm branch, deploys a package to the "daily builds" directory and serves the latest WASM build statically. This webserver can easily be separate from the TB. 

 Now that LODE is patched to setup the WASM build environment, a few steps are needed for an automated setup via Salt: 

 Lode changes for WASM 

 * lode/init.sls 
 ** lode-pkg eventually needs wget 
 ** No libreoffice build dependencies are needed 
 ** Default branch is feature/wasm 
 ** setup needs the additional option --wasm-local 

 Static webserver setup 

 * nginx/* 
 ** See ; search Multithreading 
 ** Two additional headers must be served for thread support: 
 *** add_header Cross-Origin-Opener-Policy same-origin 
 *** add_header Cross-Origin-Embedder-Policy require-corp 
 ** https is needed for the browser clipboard API 
 ** @mime.types@ should contain an entry for @application/wasm wasm;@ wasm;" to enable browser caching. 

 For the actual build we need to: 

 * source ${LODE_HOME}/emsdk/ 
 * export QT5DIR=${LODE_HOME}/qt5/qtbase 
 * Run --with-distro LibreOfficeWASM32 (AKA --host=wasm64-local-emscripten) 
 * Run make 

 All the required files can be bundled via: 
 tar -chf wasm.tar --xform 's/.*program/lo-wasm/' instdir/program/soffice.* instdir/program/qt* 

 FYI: this includes the file `qtlogo.svg`, which is shown while downloading the data before running the WASM app. Obviously this can be easily be replaced with whatever "branding" we want to display on load ;-) 

 For a debug build xz saves ~1/3 compared to gzip. 

 Eventually one might rename qt_soffice.html to index.html