Building Plugins the Hard Way
Compiling Manually
Compiling manually is not recommended, but is still documented here to help explain compatibility with compiler output. The build
subcommand should always be preferred over manual compilation.
When compiling a plugin manually, the build command should set its target to wasm32-wasi
:
cargo build --target wasm32-wasi --release
This will write the WebAssembly binary to target/wasm32-wasi/release
, however this binary is not directly usable by Bulwark. Bulwark uses the WebAssembly Component Model and the output from the Rust compiler currently cannot be directly used with it. It needs to be adapted for usage by Bulwark. To do this, first install the WebAssembly tools binary:
Note that this may require a nightly build of the Rust compiler to successfully install!
Once wasm-tools
has been installed, you will need an adapter. The adapter for Bulwark plugins, vendored in the Bulwark repository, is adapter/wasi_snapshot_preview1.reactor.wasm
. This assumes the plugin and Bulwark have been cloned into side-by-side directories. From the plugin directory, generate the adapted plugin:
This output may then be used with Bulwark.
Last updated