Commit 7960981
committed
build: switch c scheds to make
Currently we have two build systems: Cargo and Meson. Meson builds the C
schedulers and is the only way, but can also drive Cargo providing a
bunch of extra parameters. Meson also provides the framework for our
current CI stress testing.
Add a Makefile based system for building the C schedulers. We lose a lot
of knobs in this migration, but that's deliberate - the very large
matrix of Meson options was really confusing, and led to weird edge
cases that we'd often miss in CI and with local testing.
Also add the builds for the C schedulers to the CI for the first time.
No real testing other than "it builds" yet.
This change does not remove the Meson builds, but that is the direction.
Letting them run in parallel for a while as the CI currently still
relies on Meson and we should iron out any quirks with the build first.
For example, we may need to vendor libbpf in Make like it was in Meson,
but let's work that out in tree. All documentation is updated to remove
references to Meson according to this plan.
Implementation notes:
- Only allows out of source builds. In source builds annoy me, and I'd
rather we didn't maintain both types. Follows the `O=build` style of
Linux but defaults to `build` if absent.
- Uses `pkg-config` to find `libbpf`, making it easy to override the
path if needed. We may still need to vendor libbpf after we find out
how it does on distros.
- Only supports calling `make` from the root. I tried to make it easier
to call `cd scheds/c; make` but had a lot of trouble with `lib` not
being nested under it.
- Supports environment variables for the other tools, and these largely
line up with our Cargo based build system. Aspirationally we should
keep them matching wherever it makes sense.
Test plan:
- CI
```
jake@rooster:/data/users/jake/repos/scx/ > make install INSTALL_DIR=/tmp/nix-shell.lnmzMH/tmp.zBN35egECj
make[2]: Nothing to be done for 'all'.
make[2]: Nothing to be done for 'all'.
make -C /data/users/jake/repos/scx/scheds/c install
Installing schedulers to /tmp/nix-shell.lnmzMH/tmp.zBN35egECj
Installing /data/users/jake/repos/scx/build/scheds/c/scx_simple
Installing /data/users/jake/repos/scx/build/scheds/c/scx_qmap
Installing /data/users/jake/repos/scx/build/scheds/c/scx_central
Installing /data/users/jake/repos/scx/build/scheds/c/scx_userland
Installing /data/users/jake/repos/scx/build/scheds/c/scx_nest
Installing /data/users/jake/repos/scx/build/scheds/c/scx_flatcg
Installing /data/users/jake/repos/scx/build/scheds/c/scx_pair
Installing /data/users/jake/repos/scx/build/scheds/c/scx_prev
Installing /data/users/jake/repos/scx/build/scheds/c/scx_sdt
jake@rooster:/data/users/jake/repos/scx/ > ls /tmp/nix-shell.lnmzMH/tmp.zBN35egECj
scx_central scx_flatcg scx_nest scx_pair scx_prev scx_qmap scx_sdt scx_simple scx_userland
jake@rooster:/data/users/jake/repos/scx/ > sudo /tmp/nix-shell.lnmzMH/tmp.zBN35egECj/scx_central
[SEQ 0]
total : 19 local: 0 queued: 1 lost: 0
timer : 22 dispatch: 34 mismatch: 13 retry: 0
overflow: 0
[SEQ 1]
total : 2285 local: 18 queued: 0 lost: 0
timer : 995 dispatch: 6908 mismatch: 25 retry: 0
overflow: 0
[SEQ 2]
total : 2981 local: 61 queued: 0 lost: 0
timer : 1964 dispatch: 9048 mismatch: 29 retry: 0
overflow: 0
^CEXIT: unregistered from user space
```1 parent 76984a9 commit 7960981
File tree
8 files changed
+276
-205
lines changed- .github/include
- lib
- scheds/c
8 files changed
+276
-205
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
230 | 233 | | |
| 234 | + | |
231 | 235 | | |
232 | 236 | | |
233 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| |||
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
| 175 | + | |
173 | 176 | | |
174 | 177 | | |
175 | 178 | | |
| |||
179 | 182 | | |
180 | 183 | | |
181 | 184 | | |
| 185 | + | |
182 | 186 | | |
183 | 187 | | |
184 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
0 commit comments