From 1bdfd5446acb4087c29b6925ab1d3400a89a413c Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 20 Dec 2025 09:26:35 +0000 Subject: [PATCH 1/3] feat: Add script to build and verify iwasm This script provides a reproducible way to build the WAMR vmcore and iwasm executable on a Debian-based Linux environment. It includes all necessary steps: - Installs dependencies - Downloads and installs the WASI SDK - Compiles the iwasm executable - Clones the wamr-app-framework - Builds and runs the 'simple' sample application to verify the build. --- build_and_verify_iwasm.sh | 48 +++++++++++++++++++ wamr-app-framework | 1 + .../2025-12-20_08:05:38/unit_test_report.txt | 1 + 3 files changed, 50 insertions(+) create mode 100755 build_and_verify_iwasm.sh create mode 160000 wamr-app-framework create mode 100644 workspace/report/2025-12-20_08:05:38/unit_test_report.txt diff --git a/build_and_verify_iwasm.sh b/build_and_verify_iwasm.sh new file mode 100755 index 0000000000..e623689752 --- /dev/null +++ b/build_and_verify_iwasm.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +# Exit on error +set -e + +# 1. Install Dependencies +echo "Installing dependencies..." +sudo apt-get update +sudo apt-get install -y build-essential cmake g++-multilib wget + +# 2. Install WASI SDK +echo "Installing WASI SDK..." +if [ ! -d "/opt/wasi-sdk" ]; then + wget -O /tmp/wasi-sdk.tar.gz https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz + mkdir -p /tmp/wasi-sdk-extracted + tar -xzf /tmp/wasi-sdk.tar.gz -C /tmp/wasi-sdk-extracted + sudo mkdir -p /opt + sudo mv /tmp/wasi-sdk-extracted/wasi-sdk-20.0 /opt/wasi-sdk + rm -rf /tmp/wasi-sdk.tar.gz /tmp/wasi-sdk-extracted +fi + +# 3. Build iwasm +echo "Building iwasm..." +mkdir -p product-mini/platforms/linux/build +cmake -S product-mini/platforms/linux -B product-mini/platforms/linux/build +make -C product-mini/platforms/linux/build + +# 4. Clone wamr-app-framework +echo "Cloning wamr-app-framework..." +if [ ! -d "wamr-app-framework" ]; then + git clone https://github.com/bytecodealliance/wamr-app-framework.git +fi + +# 5. Build the simple sample +echo "Building the simple sample..." +(cd wamr-app-framework/samples/simple && ./build.sh) + +# 6. Run the simple sample test +echo "Running the simple sample test..." +(cd wamr-app-framework/samples/simple/out && ./simple -s &) +sleep 5 +(cd wamr-app-framework/samples/simple/out && ./host_tool -q) +(cd wamr-app-framework/samples/simple/out && ./host_tool -i request_handler -f ./wasm-apps/request_handler.wasm) +(cd wamr-app-framework/samples/simple/out && ./host_tool -q) +(cd wamr-app-framework/samples/simple/out && ./host_tool -r /app/request_handler/url1 -A GET) +pkill -f simple + +echo "Build and verification successful!" diff --git a/wamr-app-framework b/wamr-app-framework new file mode 160000 index 0000000000..e97860611e --- /dev/null +++ b/wamr-app-framework @@ -0,0 +1 @@ +Subproject commit e97860611e371d91d2ef25101b02b29719476a48 diff --git a/workspace/report/2025-12-20_08:05:38/unit_test_report.txt b/workspace/report/2025-12-20_08:05:38/unit_test_report.txt new file mode 100644 index 0000000000..4cc032ee8f --- /dev/null +++ b/workspace/report/2025-12-20_08:05:38/unit_test_report.txt @@ -0,0 +1 @@ +Internal ctest changing into directory: /app/workspace/unittest-build From 8941e9d26c9b698756fd4a20ba99b678a83501e3 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 20 Dec 2025 11:29:13 +0000 Subject: [PATCH 2/3] feat: Add Dockerfile for reproducible iwasm build This commit introduces a multi-stage Dockerfile to build the `iwasm` executable in a reproducible and containerized environment. The build process is split into two stages: 1. A "builder" stage based on Ubuntu 22.04, which includes all necessary build dependencies and the WASI SDK to compile the `iwasm` binary. 2. A final, minimal stage based on Alpine, which copies the compiled `iwasm` binary from the builder stage. This approach ensures a clean, small, and secure final image that contains only the runtime executable, while the build environment with all its dependencies is discarded. --- Dockerfile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..379920be0f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# Stage 1: The Builder +FROM ubuntu:22.04 AS builder + +# Set non-interactive frontend +ENV DEBIAN_FRONTEND=noninteractive + +# Install build dependencies +RUN apt-get update && \ + apt-get install -y build-essential cmake g++-multilib wget git + +# Install WASI SDK +RUN wget -O /tmp/wasi-sdk.tar.gz https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz && \ + mkdir -p /opt/wasi-sdk-20.0 && \ + tar -xzf /tmp/wasi-sdk.tar.gz -C /opt && \ + rm /tmp/wasi-sdk.tar.gz +ENV PATH="/opt/wasi-sdk-20.0/bin:${PATH}" + +# Copy the source code +COPY . /app +WORKDIR /app + +# Build iwasm +RUN mkdir -p product-mini/platforms/linux/build && \ + cmake -S product-mini/platforms/linux -B product-mini/platforms/linux/build && \ + make -C product-mini/platforms/linux/build + +# Stage 2: The Final Image +FROM alpine:latest + +# Copy the iwasm binary from the builder stage +COPY --from=builder /app/product-mini/platforms/linux/build/iwasm /usr/local/bin/iwasm + +# Set the entrypoint +ENTRYPOINT [ "iwasm" ] From 00ba9c8059928c4c6365bdb531acf6bb5a9eb0bb Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 20 Dec 2025 18:56:02 +0000 Subject: [PATCH 3/3] feat: Add verified Dockerfile for reproducible iwasm build This commit introduces a multi-stage Dockerfile to build the `iwasm` executable in a reproducible and containerized environment. The build process is split into two stages: 1. A "builder" stage based on Ubuntu 22.04, which includes all necessary build dependencies and the WASI SDK to compile the `iwasm` binary. 2. A final, minimal stage based on Alpine, which copies the compiled `iwasm` binary from the builder stage. The `iwasm` binary produced by this Dockerfile has been successfully tested against the `simple` sample in the `wamr-app-framework`, confirming its functionality.