From 58667b6fa5b2a985893a5c6e2340deef5441041f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 10:33:54 +0000 Subject: [PATCH 1/3] Initial plan From addb2ac2bf885f9d5acd6d1ef967a8d8cb3e7da2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 10:37:53 +0000 Subject: [PATCH 2/3] Add dev container configuration with CMake, Python, Node.js, and emscripten support Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com> --- .devcontainer/devcontainer.json | 29 +++++++++++++++++++++++++++ .devcontainer/post-create.sh | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/post-create.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..4f4b923 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,29 @@ +{ + "name": "DS Development Container", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/devcontainers/features/cmake:1": { + "version": "latest" + }, + "ghcr.io/devcontainers/features/python:1": { + "version": "3.14" + }, + "ghcr.io/devcontainers/features/node:1": { + "version": "24" + } + }, + "postCreateCommand": ".devcontainer/post-create.sh", + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "ms-vscode.cmake-tools", + "ms-python.python", + "ms-python.vscode-pylance", + "charliermarsh.ruff", + "biomejs.biome", + "esbenp.prettier-vscode" + ] + } + } +} diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100755 index 0000000..4e5fa76 --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,35 @@ +#!/bin/bash +set -euo pipefail + +# Install apt packages +sudo apt-get update +sudo apt-get install -y libgtest-dev clang-format + +# Install uv (Python package manager) +curl -LsSf https://astral.sh/uv/install.sh | sh + +# Add uv to PATH for this script +export PATH="$HOME/.local/bin:$PATH" + +# Install Python dependencies +uv sync --locked --extra dev + +# Install Node.js dependencies +npm ci + +# Install emscripten to a persistent location +EMSDK_DIR="$HOME/emsdk" +if [ ! -d "$EMSDK_DIR" ]; then + git clone https://github.com/emscripten-core/emsdk.git "$EMSDK_DIR" +fi +( + cd "$EMSDK_DIR" + ./emsdk install latest + ./emsdk activate latest +) + +# Add emsdk to shell config for future sessions +echo "source $EMSDK_DIR/emsdk_env.sh" >> "$HOME/.bashrc" + +# Install pre-commit hooks +uv run pre-commit install From af51fdc0e55429d003e13a18454b2664b047a3cf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 10:59:43 +0000 Subject: [PATCH 3/3] Address PR feedback: use latest versions, update extensions, fix PATH and emsdk pull Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com> --- .devcontainer/devcontainer.json | 11 ++++++----- .devcontainer/post-create.sh | 5 ++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4f4b923..c24c0fe 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,23 +6,24 @@ "version": "latest" }, "ghcr.io/devcontainers/features/python:1": { - "version": "3.14" + "version": "latest" }, "ghcr.io/devcontainers/features/node:1": { - "version": "24" + "version": "latest" } }, "postCreateCommand": ".devcontainer/post-create.sh", "customizations": { "vscode": { "extensions": [ - "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", "ms-vscode.cmake-tools", + "clang-format.vscode-clang-format", "ms-python.python", "ms-python.vscode-pylance", + "ms-pyright.pyright", "charliermarsh.ruff", - "biomejs.biome", - "esbenp.prettier-vscode" + "biomejs.biome" ] } } diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 4e5fa76..2ca803c 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -8,8 +8,9 @@ sudo apt-get install -y libgtest-dev clang-format # Install uv (Python package manager) curl -LsSf https://astral.sh/uv/install.sh | sh -# Add uv to PATH for this script +# Add uv to PATH for this script and future sessions export PATH="$HOME/.local/bin:$PATH" +echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc" # Install Python dependencies uv sync --locked --extra dev @@ -21,6 +22,8 @@ npm ci EMSDK_DIR="$HOME/emsdk" if [ ! -d "$EMSDK_DIR" ]; then git clone https://github.com/emscripten-core/emsdk.git "$EMSDK_DIR" +else + git -C "$EMSDK_DIR" pull fi ( cd "$EMSDK_DIR"