All of lore.kernel.org
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: "Shuah Khan" <shuah@kernel.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Darren Hart" <dvhart@infradead.org>,
	"Davidlohr Bueso" <dave@stgolabs.net>,
	"André Almeida" <andrealmeid@collabora.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Mickaël Salaün" <mic@digikod.net>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Mat Martineau" <mathew.j.martineau@linux.intel.com>,
	"Matthieu Baerts" <matthieu.baerts@tessares.net>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	chiminghao <chi.minghao@zte.com.cn>,
	linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST
	FRAMEWORK), linux-kernel@vger.kernel.org (open list),
	kvm@vger.kernel.org (open list:KERNEL VIRTUAL MACHINE (KVM)),
	linux-security-module@vger.kernel.org (open list:LANDLOCK
	SECURITY MODULE),
	netdev@vger.kernel.org (open list:NETWORKING [GENERAL]),
	mptcp@lists.linux.dev (open list:NETWORKING [MPTCP]),
	linux-mm@kvack.org (open list:MEMORY MANAGEMENT)
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>, kernel@collabora.com
Subject: [PATCH V2 00/10] selftests: Fix separate output directory builds
Date: Wed, 19 Jan 2022 15:15:21 +0500	[thread overview]
Message-ID: <20220119101531.2850400-1-usama.anjum@collabora.com> (raw)

Build of several selftests fail if separate output directory is
specified by the following methods:
1) make -C tools/testing/selftests O=<build_dir>
2) export KBUILD_OUTPUT="build_dir"; make -C tools/testing/selftests

Build fails because of several reasons:
1) The kernel headers aren't found.
2) The path of output objects is wrong and hence unaccessible.

These problems can be solved by:
1) Including the correct path of uapi header files
2) By setting the BUILD variable correctly inside Makefile

Following different build scenarios have been tested after making these
changes to verify that nothing gets broken with these changes:
make -C tools/testing/selftests
make -C tools/testing/selftests/futex
make -C tools/testing/selftests/kvm
make -C tools/testing/selftests/landlock
make -C tools/testing/selftests/net
make -C tools/testing/selftests/net/mptcp
make -C tools/testing/selftests/vm
make -C tools/testing/selftests O=build
make -C tools/testing/selftests o=/opt/build
export KBUILD_OUTPUT="/opt/build"; make -C tools/testing/selftests
export KBUILD_OUTPUT="build"; make -C tools/testing/selftests
cd <any_dir>; make -C <src_path>/tools/testing/selftests
cd <any_dir>; make -C <src_path>/tools/testing/selftests O=build

---
Changes in V2:
        Revert the excessive cleanup which was breaking the individual
test build.

Muhammad Usama Anjum (10):
  selftests: set the BUILD variable to absolute path
  selftests: Add and export a kernel uapi headers path
  selftests: Correct the headers install path
  selftests: futex: Add the uapi headers include variable
  selftests: kvm: Add the uapi headers include variable
  selftests: landlock: Add the uapi headers include variable
  selftests: net: Add the uapi headers include variable
  selftests: mptcp: Add the uapi headers include variable
  selftests: vm: Add the uapi headers include variable
  selftests: vm: remove dependecy from internal kernel macros

 tools/testing/selftests/Makefile              | 32 +++++++++++++------
 .../selftests/futex/functional/Makefile       |  5 ++-
 tools/testing/selftests/kvm/Makefile          |  2 +-
 tools/testing/selftests/landlock/Makefile     |  2 +-
 tools/testing/selftests/net/Makefile          |  2 +-
 tools/testing/selftests/net/mptcp/Makefile    |  2 +-
 tools/testing/selftests/vm/Makefile           |  2 +-
 tools/testing/selftests/vm/userfaultfd.c      |  3 ++
 8 files changed, 32 insertions(+), 18 deletions(-)

-- 
2.30.2


             reply	other threads:[~2022-01-19 10:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19 10:15 Muhammad Usama Anjum [this message]
2022-01-19 10:15 ` [PATCH V2 01/10] selftests: set the BUILD variable to absolute path Muhammad Usama Anjum
2022-01-19 10:15 ` [PATCH V2 02/10] selftests: Add and export a kernel uapi headers path Muhammad Usama Anjum
2022-01-19 10:15 ` [PATCH V2 03/10] selftests: Correct the headers install path Muhammad Usama Anjum
2022-01-19 10:15 ` [PATCH V2 04/10] selftests: futex: Add the uapi headers include variable Muhammad Usama Anjum
2022-01-19 10:15 ` [PATCH V2 05/10] selftests: kvm: " Muhammad Usama Anjum
2022-01-19 10:15 ` [PATCH V2 06/10] selftests: landlock: " Muhammad Usama Anjum
2022-01-20 18:20   ` Mickaël Salaün
2022-01-19 10:15 ` [PATCH V2 07/10] selftests: net: " Muhammad Usama Anjum
2022-01-19 10:15 ` [PATCH V2 08/10] selftests: mptcp: " Muhammad Usama Anjum
2022-01-19 22:35   ` Matthieu Baerts
2022-01-19 10:15 ` [PATCH V2 09/10] selftests: vm: " Muhammad Usama Anjum
2022-01-20  1:18   ` Alistair Popple
2022-01-19 10:15 ` [PATCH V2 10/10] selftests: vm: remove dependecy from internal kernel macros Muhammad Usama Anjum
2022-01-20  1:20   ` Alistair Popple

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220119101531.2850400-1-usama.anjum@collabora.com \
    --to=usama.anjum@collabora.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrealmeid@collabora.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=dave@stgolabs.net \
    --cc=davem@davemloft.net \
    --cc=dvhart@infradead.org \
    --cc=kernel@collabora.com \
    --cc=kuba@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mathew.j.martineau@linux.intel.com \
    --cc=matthieu.baerts@tessares.net \
    --cc=mic@digikod.net \
    --cc=mingo@redhat.com \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.