lkml.org 
[lkml]   [2022]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: selftests: Install sanitised kernel headers before compilation
On Mon, Dec 19, 2022, Like Xu wrote:
> From: Like Xu <likexu@tencent.com>
>
> On many automated test boxes, selftests in a completely clean src tree
> will be compiled independently: "make -j -C tools/testing/selftests/kvm".
> Sometimes the compilation will fail and produce a false positive just
> due to missing kernel headers (or others hidden behind the complete
> kernel compilation or installation).
>
> Optimize this situation by explicitly adding the installation of sanitised
> kernel headers before compilation to the Makefile.
>
> Reported-by: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Like Xu <likexu@tencent.com>
> ---
> tools/testing/selftests/kvm/Makefile | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index 947676983da1..a33e2f72d745 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -202,6 +202,11 @@ TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(UNAME_M))
> LIBKVM += $(LIBKVM_$(UNAME_M))
>
> INSTALL_HDR_PATH = $(top_srcdir)/usr
> +
> +ifeq ($(shell make -j -C ../../../.. headers_install),)
> + $(error "Please install sanitised kernel headers manually.")
> +endif

Auto-installation of headers was recently removed[*], presumably whatever problem
existed with KSFT_KHDR_INSTALL also exists with this approach.

FWIW, I also find the need to manually do headers_install annoying, but it's easy
to workaround via bash aliases.

[*] https://lore.kernel.org/lkml/cover.1657296695.git.guillaume.tucker@collabora.com

\
 
 \ /
  Last update: 2022-12-19 17:16    [W:0.025 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site