]> git.ipfire.org Git - thirdparty/systemd.git/commit
mkosi: Run clangd within the tools tree instead of the build container
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 23 Apr 2025 15:31:20 +0000 (17:31 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 23 Apr 2025 19:04:07 +0000 (21:04 +0200)
commitbde994efcc45d4e612a15fbd61de42b3149dea20
treeec4d0da3af3d41f9a556631809d93d0fe291ee7f
parentcfe8f3ec748f74d0d3500207cea3952d44f9328d
mkosi: Run clangd within the tools tree instead of the build container

Running within the build sandbox has a number of disadvantages:
- We have a separate clangd cache for each distribution/release combo
- It requires to build the full image before clangd can be used
- It breaks every time the image becomes out of date and requires a
  rebuild
- We can't look at system headers as we don't have the knowledge to map
  them from inside the build sandbox to the corresponding path on the host

Instead, let's have mkosi.clangd run clangd within the tools tree. We
already require building systemd for both the host and the target anyway,
and all the dependencies to build systemd are installed in the tools tree
already for that, as well as clangd since it's installed together with the
other clang tooling we install in the tools tree. Unlike the previous approach,
this approach only requires the mkosi tools tree to be built upfront, which has
a much higher chance of not invalidating its cache. We can also trivially map
system header lookups from within the sandbox to the path within mkosi.tools
on the host so that starts working as well.
docs/HACKING.md
mkosi/mkosi.clangd
mkosi/mkosi.images/build/mkosi.build.chroot [deleted file]