firefox-translations-training
firefox-translations-training copied to clipboard
Rework wasm build scripts for gecko
@gregtatum
The goal of this patch is to move much of the functionality from the build-bergamot.py script in Mozilla Central upstream into this repository to better streamline how WASM artifacts are built and exported for use in Gecko.
There are three major changes that occur:
-
The current version of build-bergamot.py applies a patch to the upstream Bergamot source code after cloning the repository. This is no longer necessary because we can make the change permanently upstream here.
-
build-bergamot.py is moved in its entirety into this repository as
build-wasm.py
. It is then modified to work within this ecosystem. I moved the whole file first so that you can look commit by commit to clearly see what changed from the original source. -
The
docker-run
task now utilizes Python instead of bash, and it now has the ability for the user to specify additional volumes to be shared between the host file system and the docker container.
task docker-run -- task inference-build-wasm --volume "HOST_PATH/build-wasm:inference/build-wasm"
This allows us to build the WASM artifacts within docker and export them directly into tree when making updates in Mozilla Central.
I will also be submitting a sister patch on the Mozilla Central side that updates the fetch/build scripts to utilize this new functionality.