* wasm: update wabt and binaryen in builder image
* wasm: bump ubuntu and llvm
* wasm: bump LLVM 13 -> 21, adjust headers
* wasm: make docker optional
We depend on it in our builds, but if you happen to bring
clang (LLVM 21)
clang++ (LLVM 21)
wasm-ld (LLVM 21)
wasm2wat (wabt)
wasm-opt (binaryen)
node
you should be able to build the opa.wasm blob without the docker image.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Without the added _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION, the
build would fail looking for posix_memalign. Having added that,
the build failed because it's missing the symbol std::align_val_t.
It looks like everything is fine without those methods, so they
have been removed.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Some smaller changes to the wasm-builder docker image:
- wabt: bump to latest release
- binaryen: add
Uses update-alternatives to select LLVM 11: Set up like this, we can
build binaryen without the trouble I had run into otherwise.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
As part of this update we needed to change the memory grow builtins.
The version we used were removed in https://reviews.llvm.org/D56645
after (apparently) having been deprecated for some time. The newer
versions match up with more recent versions of the WASM spec (see
https://github.com/WebAssembly/spec/issues/627 for more context).
The WebAssembly/wabt version is also updated to the latest release to
correct build issues with the older one and llvm 10.
Upgrading should prevent a deadlock we saw periodically in the CI
while building the OPA wasm binaries.
Signed-off-by: Patrick East <east.patrick@gmail.com>
These changes add a C library that implements low-level data operations
and JSON parsing for WASM policies. The output of the WASM build process
are checked into the repository so that OPA can easily access the
bytecode for test and other purposes.
Signed-off-by: Torin Sandall <torinsandall@gmail.com>