From fce75810691a31eb78e1480574a98903250b5922 Mon Sep 17 00:00:00 2001 From: River <26424577+wusatosi@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:22:36 +0000 Subject: [PATCH] udpate comments with more postcreate scripts --- .devcontainer/Dockerfile | 5 +++-- .devcontainer/Dockerfile_raw | 24 ----------------------- .devcontainer/devcontainer.json | 34 +++++++++++---------------------- .devcontainer/postcreate.sh | 7 +++++++ 4 files changed, 21 insertions(+), 49 deletions(-) delete mode 100644 .devcontainer/Dockerfile_raw create mode 100644 .devcontainer/postcreate.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 8de39d0..99abcb8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,5 +9,6 @@ RUN sudo apt-get update && sudo apt-get install -y cmake RUN sudo apt-get install -y python3-pip && pip3 install pre-commit # Avoid ASAN Stalling -# Alternative is to update to clang-18 and -RUN sudo sysctl -w vm.mmap_rnd_bits=28 \ No newline at end of file +# Alternative is to update to clang-18 and gcc-13.2 +# Maybe crashing codespace??? +RUN sudo sysctl -w vm.mmap_rnd_bits=28 diff --git a/.devcontainer/Dockerfile_raw b/.devcontainer/Dockerfile_raw deleted file mode 100644 index 353013a..0000000 --- a/.devcontainer/Dockerfile_raw +++ /dev/null @@ -1,24 +0,0 @@ -FROM ubuntu:24.04 - -RUN apt-get update - -# Install build tools -RUN apt-get install -y git -RUN apt-get install -y gcc-14 && ln -s /usr/bin/gcc-14 /usr/bin/gcc -RUN apt-get install -y g++-14 && ln -s /usr/bin/g++-14 /usr/bin/g++ -RUN apt-get install -y clang-18 && ln -s /usr/bin/clang++-18 /usr/bin/clang++ && ln -s /usr/bin/clang-18 /usr/bin/clang - -# Install CMake -RUN apt-get install -y ca-certificates gpg wget -RUN test -f /usr/share/doc/kitware-archive-keyring/copyright || \ - wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null -RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null -RUN apt-get update -RUN apt-get install -y kitware-archive-keyring -RUN apt-get install -y cmake - -# Install Ninja -RUN apt-get install -y ninja-build - -# Disable safe directory -RUN git config --global --add safe.directory '*' \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5ec0989..d4051c8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,31 +1,19 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/cpp -// TODO: update gcc and clang to avoid address randomziation problem. - { - "name": "C++", - // "image": "mcr.microsoft.com/devcontainers/cpp:ubuntu", + "name": "Beman Project Generic Devcontainer", "build": { "dockerfile": "Dockerfile" }, - // "features": { - // // "ghcr.io/devcontainers/features/github-cli:1": {}, - // // "ghcr.io/gvatsal60/dev-container-features/pre-commit:1": {} - // } - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "cmake --workflow --preset gcc-debug" - - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" + // TODO: these commands are failing + "postCreateCommand": ["bash postcreate.sh"], + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "ms-vscode.cmake-tools" + ] + } + } } diff --git a/.devcontainer/postcreate.sh b/.devcontainer/postcreate.sh new file mode 100644 index 0000000..7e00171 --- /dev/null +++ b/.devcontainer/postcreate.sh @@ -0,0 +1,7 @@ +cd .. + +# Setup cmake build directory +cmake --workflow --preset gcc-debug +# Setup pre-commit +pre-commit +pre-commit install