From bff969c59c4c48b4c40886762dbd82f85d430393 Mon Sep 17 00:00:00 2001 From: ainozaki Date: Fri, 29 Dec 2023 15:44:39 +0900 Subject: [PATCH] add devcontainer --- .devcontainer/Dockerfile | 14 ++++++++++++++ .devcontainer/devcontainer.json | 7 +++++++ README.md | 18 ++++++++++++++++-- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..82ad9a7 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,14 @@ +FROM mcr.microsoft.com/devcontainers/rust:1-1-bookworm + +RUN apt-get update && apt-get install -y cmake + +ARG LLVM_URL=https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.0/clang+llvm-15.0.0-x86_64-linux-gnu-rhel-8.4.tar.xz + +# install llvm +RUN mkdir -p /usr/local/llvm \ + && wget ${LLVM_URL} -O /tmp/llvm.tar.xz \ + && tar -xvf /tmp/llvm.tar.xz -C /usr/local/llvm \ + && rm /tmp/llvm.tar.xz + +ENV PATH=/usr/local/llvm/bin:$PATH +ENV LLVM_SYS_150_PREFIX=/usr/local/llvm/clang+llvm-15.0.0-x86_64-linux-gnu-rhel-8.4 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..72d982e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,7 @@ +{ + "name": "Wasker Dev Container", + "build": { + "context": "..", + "dockerfile": "./Dockerfile" + } +} diff --git a/README.md b/README.md index a997274..693c163 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ # Wasker Wasker is a WebAssembly compiler. -Wasker compiles Wasm binary into ELF format binary. +Wasker compiles Wasm binary into ELF format binary.  +Currently, Wasker supports WASI preview 1. ![Wasker_architecture](./doc/assets/wasker_architecture.png "Wasker_architecture") @@ -52,8 +53,21 @@ docker run -it --rm -v $PWD/mount:/work/mount -t ghcr.io/mewz-project/wasker:lat [2023-12-28T09:20:28Z INFO wasker::compiler] Compile success ``` +## Option2 : Use Devcontainer +You can try Wasker on browser via Devcontainer. -## Option2 : Build from source +Start Devcontainer +- Click `Code` -> `Codespaces` -> `New codespace` on this repository page. +- Wait for a while, then you can see VSCode on browser. +- Open terminal on VSCode + +Run Wasker +``` +cargo run helloworld.wat +``` + + +## Option3 : Build from source Clone repository ``` git clone git@github.com:Mewz-project/Wasker.git