diff --git a/docs/HACKING.md b/docs/HACKING.md index 3113bfe736..0adf5ada54 100644 --- a/docs/HACKING.md +++ b/docs/HACKING.md @@ -188,83 +188,6 @@ For more details on building fuzzers and integrating with OSS-Fuzz, visit: - [Setting up a new project - OSS-Fuzz](https://google.github.io/oss-fuzz/getting-started/new-project-guide/) - [Tutorials - OSS-Fuzz](https://google.github.io/oss-fuzz/reference/useful-links/#tutorials) -## mkosi + clangd - -[clangd](https://clangd.llvm.org/) is a language server that provides code completion, diagnostics and more -right in your editor of choice (with the right plugin installed). When using mkosi, we can run clangd in the -mkosi build container to avoid needing to build systemd on the host machine just to make clangd work. To -achieve this, create a script with the following contents in systemd's project directory on the host: - -```sh -#!/usr/bin/env sh -tee mkosi-clangd.build >/dev/null < -``` - -Note that the exact package containing clangd will differ depending on the distribution used. Some -distributions have a separate clangd package, others put the clangd binary in a clang-tools-extra package and -some bundle clangd in the clang package. - -Because mkosi needs to run as root, we also need to make sure we can enter the root password when the editor -plugin tries to run the mkosi-clangd.sh script. To be able to enter the root password in non-interactive -scripts, we use pkexec instead of sudo. pkexec will launch a graphical interface to let the user enter their -password, so that the password can be entered by the user even when pkexec is executed from a non-interactive -shell. - -Due to a bug in btrfs, it's currently impossible to mount two mkosi btrfs images at the same time. Because of -this, trying to do a regular build while the clangd image is running will fail. To circumvent this, use ext4 -instead of btrfs for the images by adding the following contents to 20-local.conf: - -``` -[Output] -Format=gpt_ext4 -``` - -Finally, to ensure clangd starts up quickly in the editor, run an incremental build with mkosi to make sure -the cached images are initialized (`mkosi -i`). - -Now, your editor will start clangd in the mkosi build image and all of clangd's features will work as -expected. - ## Debugging binaries that need to run as root in vscode When trying to debug binaries that need to run as root, we need to do some custom configuration in vscode to