From patchwork Wed Jan 19 10:15:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 12717395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0B35C433F5 for ; Wed, 19 Jan 2022 10:15:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2525E6B0071; Wed, 19 Jan 2022 05:15:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 202D06B0073; Wed, 19 Jan 2022 05:15:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0CAD26B0074; Wed, 19 Jan 2022 05:15:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0193.hostedemail.com [216.40.44.193]) by kanga.kvack.org (Postfix) with ESMTP id EF1766B0071 for ; Wed, 19 Jan 2022 05:15:56 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B34E295187 for ; Wed, 19 Jan 2022 10:15:56 +0000 (UTC) X-FDA: 79046630712.06.69E0CF4 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by imf16.hostedemail.com (Postfix) with ESMTP id 44C24180065 for ; Wed, 19 Jan 2022 10:15:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: usama.anjum) with ESMTPSA id 7FB081F44427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1642587349; bh=XYDVAxDFFZ3GjKZiYyLIQ7Ax/B1PlxHAo12P/LTWddY=; h=From:To:Cc:Subject:Date:From; b=QyNw3SnikBjxgmXldT58LDxt+66FxBTgRH/NFcT508gIl9Mo/FfR5aLJfGlutBmBh TiNACBRkmu1H+lpBMOChjSwlTXNzv/uov/IfDI5sCYV25iGqHYmXS9lE0rlQhLCnit KhRu728rGpQQTLF3vwYnT6k0kEOKnqaJC/O/C/ovuzrJf1x43QWkD4ZCVC9EG5h/83 NGwXJjN/JtVN2u5Nvk/bBOIG80m3VM1PqMNzh56eDaoqadx2Jz1MrAjgesDzGW/T8Z wsGhO5dStqXKya0txfhufgUBcLmMBHnY1S1x0HOjI32Q/LEYyh5wGcxijiG8ugVVtl SFNIHZFa3tYcQ== From: Muhammad Usama Anjum To: Shuah Khan , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , =?utf-8?q?Andr=C3=A9_Almeida?= , Paolo Bonzini , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , "David S. Miller" , Jakub Kicinski , Mat Martineau , Matthieu Baerts , Andrew Morton , chiminghao , 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 , kernel@collabora.com Subject: [PATCH V2 00/10] selftests: Fix separate output directory builds Date: Wed, 19 Jan 2022 15:15:21 +0500 Message-Id: <20220119101531.2850400-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 44C24180065 X-Stat-Signature: uhj9ahcjfb31yijmsyeoin3zustzuzku Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=QyNw3Sni; spf=pass (imf16.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.227 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com X-HE-Tag: 1642587351-726035 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Build of several selftests fail if separate output directory is specified by the following methods: 1) make -C tools/testing/selftests O= 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 ; make -C /tools/testing/selftests cd ; make -C /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(-)