diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b81561a56f..88f2c96574 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,12 +9,14 @@ FROM mcr.microsoft.com/devcontainers/cpp:${VARIANT} ARG DEBIAN_FRONTEND=noninteractive ENV TZ=Asia/Shanghai +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + RUN apt-get update \ && apt-get upgrade -y RUN apt-get update \ && apt-get install -y apt-transport-https apt-utils build-essential \ - ca-certificates ccache clang-format-14 curl file g++-multilib git gnupg \ + ca-certificates ccache curl file g++-multilib git gnupg \ libgcc-12-dev lib32gcc-12-dev libzstd-dev lsb-release \ ninja-build ocaml ocamlbuild opam \ python3-venv python3-pip \ @@ -23,7 +25,7 @@ RUN apt-get update \ WORKDIR /opt -ARG WASI_SDK_VER=25 +ARG WASI_SDK_VER=29 RUN wget -c --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VER}/wasi-sdk-${WASI_SDK_VER}.0-x86_64-linux.tar.gz -P /tmp \ && tar xf /tmp/wasi-sdk-${WASI_SDK_VER}.0-x86_64-linux.tar.gz -C /opt \ && ln -sf /opt/wasi-sdk-${WASI_SDK_VER}.0-x86_64-linux /opt/wasi-sdk @@ -35,6 +37,32 @@ RUN wget -c --progress=dot:giga https://github.com/WebAssembly/wabt/releases/dow # set path +# Install wasm-tools +ARG WASM_TOOLS_VER=1.243.0 +RUN wget -c --progress=dot:giga https://github.com/bytecodealliance/wasm-tools/releases/download/v${WASM_TOOLS_VER}/wasm-tools-${WASM_TOOLS_VER}-x86_64-linux.tar.gz -P /tmp +RUN tar xzf /tmp/wasm-tools-${WASM_TOOLS_VER}-x86_64-linux.tar.gz -C /opt\ + && ln -sf /opt/wasm-tools-${WASM_TOOLS_VER}-x86_64-linux/wasm-tools /usr/local/bin/wasm-tools + +# set proxy variables for sudoer +RUN echo 'Defaults env_keep += "http_proxy https_proxy no_proxy HTTP_PROXY HTTPS_PROXY NO_PROXY"' | tee /etc/sudoers.d/proxy + +# Install uv for virtual environment management +RUN wget -qO- https://astral.sh/uv/install.sh | sh + +# Install utilities for C/C++ development +RUN apt-get update \ + && apt-get install -y --no-install-recommends bear ccache clang-tidy shellcheck + +# Install clang-format-21 from the official LLVM apt repository +# (Debian 12 default repositories do not provide clang-format-21) +RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc \ + && echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-21 main" > /etc/apt/sources.list.d/llvm.list \ + && apt-get update \ + && apt-get install -y --no-install-recommends clang-format-21 + +# set path +RUN ln -sf /usr/bin/clang-format-21 /usr/bin/clang-format + # clean up RUN apt-get autoremove -y \ && apt-get clean -y \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b36c063091..9521e87cef 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -18,9 +18,13 @@ "settings": {}, "extensions": [ "dtsvet.vscode-wasm", + "esbenp.prettier-vscode", "ms-python.python", "ms-python.vscode-pylance", - "ms-vscode.cmake-tools" + "ms-vscode.cmake-tools", + "ms-vscode.cpptools-extension-pack", + "streetsidesoftware.code-spell-checker", + "vadimcn.vscode-lldb" ] } }, diff --git a/.devcontainer/finalize.sh b/.devcontainer/finalize.sh index a7d877b82e..725bf993f4 100644 --- a/.devcontainer/finalize.sh +++ b/.devcontainer/finalize.sh @@ -1,3 +1,7 @@ +set -o errexit +set -o pipefail +set -o nounset + echo "Running finalize script..." # diff --git a/.gitignore b/.gitignore index 92909c9f84..b497eb33a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .* !.gitignore +!.devcontainer +!.github .cache .clangd