• 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

88.89
/src/basic/iovec-wrapper.h
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2
#pragma once
3

4
#include <sys/types.h>
5
#include <sys/uio.h>
6

7
#include "macro.h"
8
#include "memory-util.h"
9

10
struct iovec_wrapper {
11
        struct iovec *iovec;
12
        size_t count;
13
};
14

15
struct iovec_wrapper *iovw_new(void);
16
struct iovec_wrapper *iovw_free(struct iovec_wrapper *iovw);
17
struct iovec_wrapper *iovw_free_free(struct iovec_wrapper *iovw);
18

19
DEFINE_TRIVIAL_CLEANUP_FUNC(struct iovec_wrapper*, iovw_free_free);
13✔
20

21
void iovw_done_free(struct iovec_wrapper *iovw);
22
void iovw_done(struct iovec_wrapper *iovw);
23

24
int iovw_put(struct iovec_wrapper *iovw, void *data, size_t len);
25
static inline int iovw_consume(struct iovec_wrapper *iovw, void *data, size_t len) {
22✔
26
        /* Move data into iovw or free on error */
27
        int r;
22✔
28

29
        r = iovw_put(iovw, data, len);
22✔
30
        if (r < 0)
22✔
31
                free(data);
×
32

33
        return r;
22✔
34
}
35

36
static inline bool iovw_isempty(const struct iovec_wrapper *iovw) {
22,801✔
37
        return !iovw || iovw->count == 0;
22,801✔
38
}
39

40
int iovw_put_string_field(struct iovec_wrapper *iovw, const char *field, const char *value);
41
int iovw_put_string_field_free(struct iovec_wrapper *iovw, const char *field, char *value);
42
void iovw_rebase(struct iovec_wrapper *iovw, void *old, void *new);
43
size_t iovw_size(const struct iovec_wrapper *iovw);
44
int iovw_append(struct iovec_wrapper *target, const struct iovec_wrapper *source);
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