public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: selftests: Install sanitised kernel headers before compilation
@ 2022-12-19  9:55 Like Xu
  2022-12-19 16:14 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Like Xu @ 2022-12-19  9:55 UTC (permalink / raw)
  To: seanjc; +Cc: Paolo Bonzini, Shuah Khan, kvm, linux-kselftest, linux-kernel

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
+
 LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
 LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include
 ifeq ($(ARCH),x86_64)
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-19 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-19  9:55 [PATCH] KVM: selftests: Install sanitised kernel headers before compilation Like Xu
2022-12-19 16:14 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox