Skip to content

Commit cf3c8c3

Browse files
authored
Update to use the latest wasi sdk (#101)
Signed-off-by: James Sturtevant <[email protected]>
1 parent e3775e1 commit cf3c8c3

File tree

8 files changed

+18
-11
lines changed

8 files changed

+18
-11
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN apt-get install -y g++-multilib \
1818
&& apt-get install -y libgcc-${GCC_VERSION}-dev \
1919
&& apt-get install -y lib32gcc-${GCC_VERSION}-dev
2020

21-
ARG WASI_SDK_VERSION_FULL=20.0
21+
ARG WASI_SDK_VERSION_FULL=25.0
2222
ARG WASI_SDK_VERSION_MAJOR=${WASI_SDK_VERSION_FULL%%.*}
2323

2424
# Install wasi-sdk

.github/workflows/CreateDevcontainerImage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818
LLVM_VERSION: 17
1919
RUST_TOOLCHAIN_DEFAULT: 1.85.0
2020
RUST_TOOLCHAIN_FILE: rust-toolchain.toml
21-
WASI_SDK_VERSION_FULL: "20.0"
21+
WASI_SDK_VERSION_FULL: "25.0"
2222
GCC_VERSION: "12"
2323

2424
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.

.github/workflows/dep_build_wasm_examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
load: true
7272
push: ${{ env.DO_PUSH }}
7373
build-args: |
74-
WASI_SDK_VERSION_FULL=20.0
74+
WASI_SDK_VERSION_FULL=25.0
7575
GCC_VERSION=12
7676
tags: ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest
7777
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:buildcache

src/hyperlight_wasm/scripts/build-wasm-examples.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ else
3131

3232
docker pull ghcr.io/hyperlight-dev/wasm-clang-builder:latest
3333

34-
docker build --build-arg GCC_VERSION=12 --build-arg WASI_SDK_VERSION_FULL=20.0 --cache-from ghcr.io/hyperlight-dev/wasm-clang-builder:latest -t wasm-clang-builder:latest . 2> ${OUTPUT_DIR}/dockerbuild.log
34+
docker build --build-arg GCC_VERSION=12 --build-arg WASI_SDK_VERSION_FULL=25.0 --cache-from ghcr.io/hyperlight-dev/wasm-clang-builder:latest -t wasm-clang-builder:latest . 2> ${OUTPUT_DIR}/dockerbuild.log
3535

3636
for FILENAME in $(find . -name '*.c')
3737
do

src/hyperlight_wasm_macro/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/wasm_runtime/src/wasip1.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ pub(crate) fn register_handlers<T: 'static>(linker: &mut Linker<T>) -> Result<()
8181
linker.func_wrap("wasi_snapshot_preview1", "fd_close", |fd: i32| -> i32 {
8282
panic!("fd_close called {}", fd);
8383
})?;
84+
linker.func_wrap(
85+
"wasi_snapshot_preview1",
86+
"random_get",
87+
|buff: i32, len: i32| -> i32 {
88+
panic!("random_get called for {} with len {}", buff, len);
89+
},
90+
)?;
8491
linker.func_wrap(
8592
"wasi_snapshot_preview1",
8693
"fd_fdstat_get",

src/wasmsamples/compile-wasm.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ where docker || (
1818

1919
echo Building docker image that has Wasm sdk. Should be quick if no changes to docker image.
2020
echo Log in %2\dockerbuild.log
21-
%dockercmd% build --build-arg GCC_VERSION=12 --build-arg WASI_SDK_VERSION_FULL=20.0 --cache-from ghcr.io/hyperlight-dev/wasm-clang-builder:latest -t wasm-clang-builder:latest !dockerinput! 2> %2dockerbuild.log
21+
%dockercmd% build --build-arg GCC_VERSION=12 --build-arg WASI_SDK_VERSION_FULL=25.0 --cache-from ghcr.io/hyperlight-dev/wasm-clang-builder:latest -t wasm-clang-builder:latest !dockerinput! 2> %2dockerbuild.log
2222

2323
echo Building Wasm files in %1 and output to %2
2424
for /R "%1" %%i in (*.c) do (

src/wasmsamples/dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ RUN apt-get install -y wget \
1313
&& apt-get install -y libgcc-${GCC_VERSION}-dev \
1414
&& apt-get install -y lib32gcc-${GCC_VERSION}-dev
1515

16-
ARG WASI_SDK_VERSION_FULL=20.0
16+
ARG WASI_SDK_VERSION_FULL=25.0
1717
ARG WASI_SDK_VERSION_MAJOR=${WASI_SDK_VERSION_FULL%%.*}
1818

19-
RUN wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION_MAJOR}/wasi-sdk-${WASI_SDK_VERSION_FULL}-linux.tar.gz \
20-
&& tar xvf wasi-sdk-${WASI_SDK_VERSION_FULL}-linux.tar.gz \
21-
&& rm wasi-sdk-${WASI_SDK_VERSION_FULL}-linux.tar.gz \
22-
&& mv /wasi-sdk-${WASI_SDK_VERSION_FULL} /opt/wasi-sdk
19+
RUN wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION_MAJOR}/wasi-sdk-${WASI_SDK_VERSION_FULL}-x86_64-linux.tar.gz \
20+
&& tar xvf wasi-sdk-${WASI_SDK_VERSION_FULL}-x86_64-linux.tar.gz \
21+
&& rm wasi-sdk-${WASI_SDK_VERSION_FULL}-x86_64-linux.tar.gz \
22+
&& mv /wasi-sdk-${WASI_SDK_VERSION_FULL}-x86_64-linux /opt/wasi-sdk
2323
CMD ["/bin/sh"]

0 commit comments

Comments
 (0)