From 16915ff424e01f42a67dad5b6569b60b5816d437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Tue, 29 Mar 2022 14:45:33 -0400 Subject: [PATCH] build/dev: add vscode devcontainer and dhtnode task --- .devcontainer/devcontainer.json | 12 +++++++++ .vscode/launch.json | 23 ++++++++++++++++++ .vscode/tasks.json | 43 +++++++++++++++++++++++++++++++++ docker/DockerfileDepsLlvm | 2 +- 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..9157472b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "name": "C++", + "build": { + "dockerfile": "../docker/DockerfileDepsLlvm", + }, + "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"], + "settings": {}, + "extensions": [ + "ms-vscode.cpptools" + ], + "forwardPorts": [4222], +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..f0d80452 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,23 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "dhtnode", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/tools/dhtnode", + "args": ["-v", "-p", "4222"], + "cwd": "${workspaceFolder}/build", + "environment": [], + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "build" + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..90624d9f --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,43 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "options": { + "cwd": "${workspaceRoot}/build" + }, + "command": "make", + "args": ["-j4"], + "dependsOn": "cmake" + }, + { + "label": "cmake", + "type": "shell", + "options": { + "cwd": "${workspaceRoot}/build" + }, + "command": "cmake", + "args": [ + "${workspaceRoot}", + "-DCMAKE_BUILD_TYPE=Debug", + "-DOPENDHT_PROXY_CLIENT=On", + "-DOPENDHT_PROXY_SERVER=On", + "-DOPENDHT_C=On" + ], + "dependsOn": "builddir" + }, + { + "label": "builddir", + "type": "shell", + "options": { + "cwd": "${workspaceRoot}" + }, + "command": "mkdir", + "args": [ + "-p", + "${workspaceRoot}/build" + ] + }, + ] +} diff --git a/docker/DockerfileDepsLlvm b/docker/DockerfileDepsLlvm index 308a7a04..6c675be1 100644 --- a/docker/DockerfileDepsLlvm +++ b/docker/DockerfileDepsLlvm @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y \ && echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections RUN apt-get update \ - && apt-get install -y llvm llvm-dev clang make cmake pkg-config git wget libncurses5-dev libreadline-dev \ + && apt-get install -y llvm llvm-dev lldb clang gdb make cmake pkg-config git wget libncurses5-dev libreadline-dev \ nettle-dev libgnutls28-dev libuv1-dev libmsgpack-dev libjsoncpp-dev cython3 python3-dev \ python3-setuptools libcppunit-dev python3-pip \ autotools-dev autoconf libssl-dev libargon2-dev \ -- GitLab