Logo

Blog


Gitpod and C++ Insights

A while back I discovered a new project Gitpod. The idea is as simple as clever. It is a development IDE which runs in a browser. Not that fancy? True, but this project comes with a full development environment. It launches a Docker instance which then provides a shell. You control the Docker image, hence you can install all the tools necessary for the development of your project.

For example, setting up a development environment for C++ Insights is a bit annoying. You need the LLVM libraries, a recent C++ compiler, clang-format, python (2 and 3, I'm working on migrating it all to 3, sorry), clang-tidy, cmake and doxygen. All these tools are more or less common for C++ development, however, you need specific versions of it. Plus a LLVM development setup is not that common. Gitpod takes all that away. Just click the “Open in Gitpod” Button at the C++ Insights GitHub page and there you go. You get an IDE, a shell which already ran cmake to configure the build. All that is left for you to do is type ninja -j2. Small side note, running plain ninja will give you some compiler crashes as the time in the Docker container is limited.

I hope that this setup enables people to easily jump in playing with the code or/and provide a patch without having to go through all that hazel.

This is how it looks:

Login with your GitHub account. Gitpod home page

Gitpod is preparing the workspace and pulling the Docker image required. Gitpod launching C++ Insights

And there we are, an editor and a shell. Ready to start development. Gitpod ready to develop features for C++ Insights.

Currently, I’m looking to set up gdb for debugging and provide a release and a debug configuration.

For now, I failed to set up clangd properly which would give a better experience in the editor. It is capable of showing clang analyzer findings and follow symbols.

There is also an option to build the workspace whenever something is pushed into master. I will enable this, if there is a larger number of people using Gitpod for C++ Insights.

Let me know what you think and tell me, if there is something missing in the Docker image or just provide a pull request to add it.

Andreas