• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemd / systemd / 14630481637

23 Apr 2025 07:04PM UTC coverage: 72.178% (-0.002%) from 72.18%
14630481637

push

github

DaanDeMeyer
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.

297054 of 411557 relevant lines covered (72.18%)

686269.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.67
/src/network/netdev/xfrm.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <linux/if_arp.h>
4

5
#include "missing_network.h"
6
#include "networkd-link.h"
7
#include "xfrm.h"
8

9
static int xfrm_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *message) {
3✔
10
        assert(message);
3✔
11

12
        Xfrm *x = XFRM(netdev);
3✔
13
        int r;
3✔
14

15
        assert(link || x->independent);
3✔
16

17
        r = sd_netlink_message_append_u32(message, IFLA_XFRM_LINK, link ? link->ifindex : LOOPBACK_IFINDEX);
3✔
18
        if (r < 0)
3✔
19
                return r;
20

21
        r = sd_netlink_message_append_u32(message, IFLA_XFRM_IF_ID, x->if_id);
3✔
22
        if (r < 0)
3✔
23
                return r;
×
24

25
        return 0;
26
}
27

28
static int xfrm_verify(NetDev *netdev, const char *filename) {
4✔
29
        assert(filename);
4✔
30

31
        Xfrm *x = XFRM(netdev);
4✔
32

33
        if (x->if_id == 0)
4✔
34
                return log_netdev_warning_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
×
35
                                                "%s: Xfrm interface ID cannot be zero.", filename);
36
        return 0;
37
}
38

39
const NetDevVTable xfrm_vtable = {
40
        .object_size = sizeof(Xfrm),
41
        .sections = NETDEV_COMMON_SECTIONS "Xfrm\0",
42
        .fill_message_create = xfrm_fill_message_create,
43
        .config_verify = xfrm_verify,
44
        .create_type = NETDEV_CREATE_STACKED,
45
        .iftype = ARPHRD_NONE,
46
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc