selftests 'make install' crashing due to bpf makefile bug
Hi,
we've been working on adding selftests to CI for bpf-next and ran into problems when running 'make install'.
Steps to reproduce:
make -C tools/testing/selftests install TARGETS="bpf"
The underlying build completes fine but the install step crashes with following error:
rsync: link_stat "/kernel/bpf-next/tools/testing/selftests/bpf/runqslower"
failed: No such file or directory (2)
lib.mk expects all TEST_GEN_PROGS_EXTENDED to be present in the subsystem selftests directory, while runqslower is located in tools subdirectory instead [0].
The directory override was originally added together with the runqslower target in [1] a few months ago. The issue was most likely overlooked for two reasons:
- people don't use 'make install' for bpf selftests
- kselftest_install.sh script happily continues after errors so while the same error is present, it is easy to overlook. runqslower is "simply" not present in the created kselftest_install/bpf
We currently see two potential solutions:
a) Remove "OUTPUT=$(SCRATCH_DIR)/" from runqslower target
- Tested this for our use case but it has a potential of breaking workflows
b) Add a copy from bpf/tools to the bpf directory at the end of the target
Which one of them is preferred? Or does anyone have an alternative idea? I'm willing to post a proper patch if needed (once we agree on the proper fix) or test any proposals in our environment.
[0]: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/Makefile#n143
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3a0d3092a4edbbc
Thanks,
Veronika
Quoted 7 lines · Veronika Kabatova
Hi,
we've been working on adding selftests to CI for bpf-next and ran into problems when running 'make install'.
Quoted 6 lines
Steps to reproduce:
make -C
tools/testing/selftestsinstall TARGETS="bpf"The underlying build completes fine but the install step crashes with following error:
I assume "crashes" means fails here, not really core-dumping process, right?
Quoted 17 lines
rsync:
link_stat"/kernel/bpf-next/tools/testing/selftests/bpf/runqslower"
failed: No such file or directory (2)lib.mk expects all
TEST_GEN_PROGS_EXTENDEDto be present in the subsystem selftests directory, while runqslower is located in tools subdirectory instead [0].The directory override was originally added together with the runqslower target in [1] a few months ago. The issue was most likely overlooked for two reasons:
- people don't use 'make install' for bpf selftests
-kselftest_install.shscript happily continues after errors so while the same error is present, it is easy to overlook. runqslower is "simply" not present in the created kselftest_install/bpf
Quoted 5 lines
We currently see two potential solutions:
a) Remove "OUTPUT=$(SCRATCH_DIR)/" from runqslower target
- Tested this for our use case but it has a potential of breaking workflows
b) Add a copy from bpf/tools to the bpf directory at the end of the target
We don't want to do a) to keep runqslower completely isolated from selftest build. Doing b) should be fine, though.
Quoted 12 lines
Which one of them is preferred? Or does anyone have an alternative idea? I'm willing to post a proper patch if needed (once we agree on the proper fix) or test any proposals in our environment.
[0]: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/Makefile#n143
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3a0d3092a4edbbcThanks,
Veronika