From 3b4f674fa8b687bf5add27224dec138a796d68a8 Mon Sep 17 00:00:00 2001 From: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Date: Mon, 15 Jun 2026 15:33:51 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Add=20dev=20container?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/Dockerfile | 21 +++++++++++++++++++++ .devcontainer/devcontainer.json | 27 +++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000..e597103f3e --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,21 @@ +FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04 + +# Installs the basic underlying framework +RUN apt-get -y update && \ + apt-get install -y --no-install-recommends clang clangd clang-tools lld + +# Copy uv and uvx binaries from the official image and make them accessible to all users +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/ + +# Store tool binaries and environments in system-wide locations +ENV UV_TOOL_BIN_DIR=/usr/local/bin +ENV UV_TOOL_DIR=/opt/uv/tools + +# Install the latest versions of cmake, ninja, lit, and prek as tools +RUN uv tool install cmake && \ + uv tool install ninja && \ + uv tool install prek + +# Downloads and installs a prebuilt LLVM/MLIR toolchain for the current OS and architecture +RUN curl -LsSf https://github.com/munich-quantum-software/setup-mlir/releases/latest/download/setup-mlir.sh \ + | bash -s -- -v 22.1.7 -p /opt/llvm diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..ccc70ec09e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,27 @@ +{ + "name": "MQT Core", + "build": { + "dockerfile": "Dockerfile", + "context": "." + }, + "postCreateCommand": "prek install", + "remoteEnv": { + "UV_PYTHON": "3.14", + "MLIR_DIR": "/opt/llvm/lib/cmake/mlir" + }, + "customizations": { + "vscode": { + "extensions": [ + "llvm-vs-code-extensions.vscode-clangd", + "llvm-vs-code-extensions.vscode-mlir", + "ms-vscode.cmake-tools" + ], + "settings": { + "clangd.arguments": [ + "--compile-commands-dir=${workspaceFolder}/build/release" + ], + "clangd.path": "clangd" + } + } + } +}