scx-upstream/meson-scripts
Tejun Heo 43950c65bd build: Use workspace to group rust sub-projects
meson build script was building each rust sub-project under rust/ and
scheds/rust/ separately. This means that each rust project is built
independently which leads to a couple problems - 1. There are a lot of
shared dependencies but they have to be built over and over again for each
proejct. 2. Concurrency management becomes sad - we either have to unleash
multiple cargo builds at the same time possibly thrashing the system or
build one by one.

We've been trying to solve this from meson side in vain. Thankfully, in
issue #546, @vimproved suggested using cargo workspace which makes the
sub-projects share the same target directory and built together by the same
cargo instance while still allowing each project to behave independently for
development and publishing purposes.

Make the following changes:

- Create two cargo workspaces - one under rust/, the other under
  scheds/rust/. Each contains all rust projects underneath it.

- Don't let meson descend into rust/. These are libraries used by the rust
  schedulers. No need to build them from meson. Cargo will build them as
  needed.

- Change the rust_scheds build target to invoke `cargo build` in
  scheds/rust/ and let cargo do its thing.

- Remove per-scheduler meson.build files and instead generate custom_targets
  in scheds/rust/meson.build which invokes `cargo build -p $SCHED`.

- This changes rust binary directory. Update README and
  meson-scripts/install_rust_user_scheds accordingly.

- Remove per-scheduler Cargo.lock as scheds/rust/Cargo.lock is shared by all
  schedulers now.

- Unify .gitignore handling.

The followings are build times on Ryzen 3975W:

Before:
  ________________________________________________________
  Executed in  165.93 secs    fish           external
     usr time   40.55 mins    2.71 millis   40.55 mins
     sys time    3.34 mins   36.40 millis    3.34 mins

After:
  ________________________________________________________
  Executed in   36.04 secs    fish           external
     usr time  336.42 secs    0.00 millis  336.42 secs
     sys time   36.65 secs   43.95 millis   36.61 secs

Wallclock time is reduced 5x and CPU time 7x.
2024-08-25 00:47:58 -10:00
..
bpftool_build_skel scx: Initial repo setup and import of example schedulers from kernel tree 2023-11-27 14:47:04 -10:00
bpftool_dummy.c Fetch and build bpftool by default 2024-03-11 10:00:01 -07:00
build_bpftool Doc & build: Warn about sccache 2024-04-03 10:18:45 -10:00
build_libbpf Remove libbpf as a submodule 2024-03-07 18:31:09 -08:00
cargo_fetch Support offline compilation 2023-12-08 08:45:44 -10:00
cc_cflags_probe.c Add libbpf as a submodule 2024-03-01 12:39:35 -08:00
fetch_bpftool meson: check if commit exists in remote git repos 2024-06-28 15:16:56 +02:00
fetch_libbpf meson: check if commit exists in remote git repos 2024-06-28 15:16:56 +02:00
get_bpftool_ver meson.build: Update libbpf and bpftool version requirements 2024-04-04 13:16:08 -10:00
get_clang_ver get_clang_ver: Fix regex for LLVM RC Versions 2024-08-25 00:49:00 +02:00
get_sys_incls scx: Initial repo setup and import of example schedulers from kernel tree 2023-11-27 14:47:04 -10:00
install_rust_user_scheds build: Use workspace to group rust sub-projects 2024-08-25 00:47:58 -10:00
run_stress_tests Add stress-ng to scheduler tests 2024-06-10 19:48:42 -07:00
stress_tests.ini ci: enable stress tests for scx_bpfland 2024-06-27 17:28:42 +02:00
test_sched meson-scripts/test_sched: Enable scx_layered testing 2024-08-19 20:50:10 -10:00
veristat ci: fix veristat for PRs 2024-08-19 16:42:31 -07:00
veristat_diff ci: fix merge veristat cache generation 2024-08-19 18:30:32 -07:00