Skip to content

Commit

Permalink
[dep](thirdparty) import wasmtime library
Browse files Browse the repository at this point in the history
  • Loading branch information
taptao committed Dec 13, 2023
1 parent a14745f commit 8b78264
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions thirdparty/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This file contains version of the third-party dependency libraries in the build-env image. The docker build-env image is apache/doris, and the tag is `build-env-${version}`

## v20231211
- Added: wasmtime -> 15.0.1
- Added: wasmtime-cpp -> 9.0.0

## v20231020
- Added: avx2neon -> 1.0.0

Expand Down
20 changes: 20 additions & 0 deletions thirdparty/build-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,24 @@ build_libdeflate() {
"${BUILD_SYSTEM}" install
}

# wasmtime
build_wasmtime() {
check_if_source_exist "${WASMTIME_SOURCE}"
cd "${TP_SOURCE_DIR}/${WASMTIME_SOURCE}"

cargo build --release -p wasmtime-c-api
mkdir -p "${TP_INCLUDE_DIR}/include/"

cp -rf ./crates/c-api/wasm-c-api/include/wasm.* "${TP_INCLUDE_DIR}/"
cp -rf ./crates/c-api/include/* "${TP_INCLUDE_DIR}/"
cp -rf ./target/release/libwasmtime.a "${TP_LIB_DIR}/libwasmtime.a"
cp -rf ./target/release/libwasmtime.so "${TP_LIB_DIR}/libwasmtime.so"
}

build_wasmtime_cpp() {
cp -rf ./include/wasmtime.hh "${TP_INCLUDE_DIR}/"
}

if [[ "${#packages[@]}" -eq 0 ]]; then
packages=(
libunixodbc
Expand Down Expand Up @@ -1769,6 +1787,8 @@ if [[ "${#packages[@]}" -eq 0 ]]; then
dragonbox
avx2neon
libdeflate
wasmtime
wasmtime_cpp
)
if [[ "$(uname -s)" == 'Darwin' ]]; then
read -r -a packages <<<"binutils gettext ${packages[*]}"
Expand Down
14 changes: 14 additions & 0 deletions thirdparty/vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,18 @@ LIBDEFLATE_NAME=libdeflate-1.19.tar.gz
LIBDEFLATE_SOURCE=libdeflate-1.19
LIBDEFLATE_MD5SUM="c69e9193d2975a729068ffa862c81fb6"

# wasmtime
WASMTIME_DOWNLOAD="https://github.com/bytecodealliance/wasmtime/releases/download/v14.0.4/wasmtime-v14.0.4-src.tar.gz"
WASMTIME_NAME=wasmtime-v14.0.4-src.tar.gz
WASMTIME_SOURCE=wasmtime-v14.0.4-src
WASMTIME_MD5SUM="163383809e80a38c15c3f22cefc94414"

# wasmtime-cpp
WASMTIME_C++_DOWNLOAD="https://github.com/bytecodealliance/wasmtime-cpp/archive/refs/tags/v9.0.0.tar.gz"
WASMTIME_C++_NAME=v9.0.0.tar.gz
WASMTIME_C++_SOURCE=wasmtime-cpp-9.0.0
WASMTIME_C++_MD5SUM="b440d7efd615f1b018cd326876d8ead7"

# all thirdparties which need to be downloaded is set in array TP_ARCHIVES
export TP_ARCHIVES=(
'LIBEVENT'
Expand Down Expand Up @@ -555,6 +567,8 @@ export TP_ARCHIVES=(
'DRAGONBOX'
'AVX2NEON'
'LIBDEFLATE'
'WASMTIME'
'WASMTIME_CPP'
)

if [[ "$(uname -s)" == 'Darwin' ]]; then
Expand Down

0 comments on commit 8b78264

Please sign in to comment.