Skip to content

Commit

Permalink
Pending changes exported from your codespace
Browse files Browse the repository at this point in the history
  • Loading branch information
wusatosi committed Oct 22, 2024
1 parent b0e3a3a commit e6d7c6c
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-22.04

# Install latest cmake
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo 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/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
RUN sudo apt-get update && sudo apt-get install -y cmake

# Install pre-commit
RUN sudo apt-get install -y python3-pip && pip3 install pre-commit
RUN pre-commit && pre-commit install

# Avoid ASAN Stalling
# Alternative is to update to clang-18 and
RUN sudo sysctl -w vm.mmap_rnd_bits=28
24 changes: 24 additions & 0 deletions .devcontainer/Dockerfile_raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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 '*'
31 changes: 31 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 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",
"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"
}

0 comments on commit e6d7c6c

Please sign in to comment.