Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable build and test outside src dir #685

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

likewhatevs
Copy link
Contributor

enable build and test outside src dir

add a option build_outside_src, defaulted
to false, to undo a tweak to enable meson to work
well with builds within src dir.

this makes some tools work better + enables
moving builds etc. to /tmp (faster for iteration if ramdisk)

this enables scripts like the following, which make iteration time nice and fast:

#!/bin/bash

set -euxo pipefail
REPOS=/home/patso/repos
SCX=scx
KERNEL=sched-ext-linux
SCHED="$1"
cd $REPOS/$KERNEL
vng -v --build --pwd $REPOS/$KERNEL --config "$REPOS/$SCX/.github/workflows/sched-ext.config"
cd $REPOS/$SCX
BUILDDIR=../../../../tmp/scxbuild/
# when messing with meson
# rm -rf /tmp/scxbuild
mkdir -p $BUILDDIR
meson setup -Dkernel=$REPOS/$KERNEL -Dkernel_headers=$REPOS/$KERNEL/usr/include -Denable_stress=true -Dbpftool=/usr/bin/bpftool $BUILDDIR $REPOS/$SCX -Dbuild_outside_src=true
meson compile -C $BUILDDIR "$SCHED"
meson compile -C $BUILDDIR test_sched_"$SCHED"
meson compile -C $BUILDDIR stress_tests_"$SCHED"

./local-e2e.sh scx_layered
...

15:48:49 [INFO] CPUs: online/possible=32/32 nr_cores=32
15:48:49 [WARN] libbpf: map 'layered': BPF skeleton version is old, skipping map auto-attachment...

[    0.630701] sched_ext: BPF scheduler "layered" enabled
15:48:49 [INFO] Layered Scheduler Attached. Run `scx_layered --monitor` for metrics.
[   30.575919] sched_ext: BPF scheduler "layered" disabled (unregistered from user space)
EXIT: unregistered from user space
[   30.730614] ACPI: PM: Preparing to enter system sleep state S5
[   30.730731] kvm: exiting hardware virtualization
[   30.730835] reboot: Power down
OK: scx_layered
+ meson compile -C ../../../../tmp/scxbuild/ stress_tests_scx_layered
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /tmp/scxbuild stress_tests_scx_layered
ninja: Entering directory `/tmp/scxbuild'
[0/1] Running external command stress_tests_scx_layered (wrapped by meson to set env)

gentoo in scx on  enable-build-outside-src [$] is 📦 v1.0.4 via 🐍 v3.12.6 via 🦀 v1.80.1 took 32s 

ci checks the case when default, so if that passes (err, passes as it usually does), this did nothing other than enable that/is good to go.

enable build and test outside src dir

add a option `build_outside_src`, defaulted
to false, to undo a tweak to enable meson to work
well with builds within src dir.

this makes some tools work better + enables
moving builds etc. to /tmp (faster for iteration if
ramdisk)
@likewhatevs likewhatevs merged commit 8ed7777 into sched-ext:main Sep 25, 2024
18 of 19 checks passed
likewhatevs added a commit to sched-ext/scx-backports that referenced this pull request Oct 4, 2024
enable build and test outside src dir

add a option `build_outside_src`, defaulted
to false, to undo a tweak to enable meson to work
well with builds within src dir.

this makes some tools work better + enables
moving builds etc. to /tmp (faster for iteration if
ramdisk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant