2023-06-08 08:46:41

by Naresh Kamboju

[permalink] [raw]
Subject: selftests: -e error: missing kernel header files. Please run this and try again

The make kselftest-install failed on Linux next 20230608.

make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/build
INSTALL_PATH=/home/tuxbuild/.cache/tuxmake/builds/1/build/kselftest_install
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- 'HOSTCC=sccache clang'
'CC=sccache clang' LLVM=1 LLVM_IAS=1 kselftest-install

make[3]: Entering directory '/builds/linux/tools/testing/selftests/alsa'

-e error: missing kernel header files.
Please run this and try again:

cd /builds/linux/tools/testing/selftests/../../..
make headers

make[3]: Leaving directory '/builds/linux/tools/testing/selftests/alsa'
make[3]: *** [../lib.mk:77: kernel_header_files] Error 1

Reported-by: Linux Kernel Functional Testing <[email protected]>

Links,
===
https://storage.tuxsuite.com/public/linaro/lkft/builds/2QsWmEgSFF9iwodTUrWsdopV4Qp/

--
Linaro LKFT
https://lkft.linaro.org


2023-06-08 09:20:41

by Muhammad Usama Anjum

[permalink] [raw]
Subject: Re: selftests: -e error: missing kernel header files. Please run this and try again

On 6/8/23 1:21 PM, Naresh Kamboju wrote:
> The make kselftest-install failed on Linux next 20230608.
>
> make --silent --keep-going --jobs=8
> O=/home/tuxbuild/.cache/tuxmake/builds/1/build
> INSTALL_PATH=/home/tuxbuild/.cache/tuxmake/builds/1/build/kselftest_install
> ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- 'HOSTCC=sccache clang'
> 'CC=sccache clang' LLVM=1 LLVM_IAS=1 kselftest-install
Around 6-8 months ago, selftests used to build kernel headers from the
source tree automatically and were using those to build all applications.
But this behavior got changed where user need to build header manually
first before building kselftest because auto header build was in-consistent
in some cases.

So from several months people, who were unaware of this are building
kselftests with installed kernel headers in their distro. This was creating
failure for some newer tests for people. They didn't know that selftests
are supposed to build with kernel headers from source instead from locally
installed headers in distro. So a patch has been introduced which spits
error if kernel headers aren't built already:
https://lore.kernel.org/all/[email protected]

To fix things for your case, please build kernel headers by `make headers
...` and then build kselftests. The error is trying to say the same thing.

>
> make[3]: Entering directory '/builds/linux/tools/testing/selftests/alsa'
>
> -e error: missing kernel header files.
> Please run this and try again:
>
> cd /builds/linux/tools/testing/selftests/../../..
> make headers
>
> make[3]: Leaving directory '/builds/linux/tools/testing/selftests/alsa'
> make[3]: *** [../lib.mk:77: kernel_header_files] Error 1
>
> Reported-by: Linux Kernel Functional Testing <[email protected]>
>
> Links,
> ===
> https://storage.tuxsuite.com/public/linaro/lkft/builds/2QsWmEgSFF9iwodTUrWsdopV4Qp/
>
> --
> Linaro LKFT
> https://lkft.linaro.org

--
BR,
Muhammad Usama Anjum