Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp887057rwd; Tue, 13 Jun 2023 01:32:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7qYUgk/2ULFtsQV2a+g7i/xHz2WZ9KS7Lea/atbZNh6Unp9jAL4z3fJKEGr9JmRB5AQE6s X-Received: by 2002:a05:6a20:840d:b0:11a:f632:78fb with SMTP id c13-20020a056a20840d00b0011af63278fbmr6066886pzd.19.1686645150634; Tue, 13 Jun 2023 01:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686645150; cv=none; d=google.com; s=arc-20160816; b=yigta7LCkXwCBTPFrDSCAdgz4WFluD5ZN2fYKaGxuV4tli44qu47yaPRxVlv1vaV2H ifTDENjVfWB98k25tbr3QP5hFqHqLd8cRV1Hzf8VA7qyeFG5sQwCivllk8wNhfrS93v1 oK8QSQnRFZqk/R0HePiwGpmp/QJkeFUaxbS50VpFlRaYYI9WRQ6yWJ4VhHhe3Nj9Fnpu 3jYCG91cgItmdVxSFj8o6gVXSXmS6neMwv7KRJWs+9+rduL+Vp6NyFjq8W49ktKLVjzM HOTb5RLIC1+w0UAjy7jS9njbSAfZ0xBrdDsBRAATQ8OqqhZ0EZ+XIQ86XMKE3ZtfzFZs 6jNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=6TAJg6eHsmjSOvv6+q3DUn7ukvlGnJfAy3fxeLTBdwI=; b=fL4GC/kXjelp+vvhHO8PX826mZpVya6fGfHpQIjXbIoyx3Q2Gj+DUxdNUMOGo/6geV ZPH6nzoQ/cVOkxBMUXeeqgqThgGzyBjPz+NtpgZYTao+loxZq/k5Y2WpMDlsBXSduc0S hgxLQLOBbdlSCWnDeQUC5Sya3fx6Imu4+Cd/bXxBW/hAnhOjsCTZ0jQJ5RpA1dBMopBU lg6Hm2kGF58vHFuPpeCSzX2YjO0Utnwux332Q4mB3rNSQ8GqOlMfWR95XsJkxqvbfJq+ osbUcrDTOncAPUMfTAXsxfjgujBshJFDRThh07Yum3CJgjI97FmKo6fAuqVcEqYnb8Zi +vSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hO7vn83i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w22-20020a639356000000b0054293d20c38si4613165pgm.729.2023.06.13.01.32.19; Tue, 13 Jun 2023 01:32:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hO7vn83i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238917AbjFMIQY (ORCPT + 99 others); Tue, 13 Jun 2023 04:16:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237456AbjFMIQW (ORCPT ); Tue, 13 Jun 2023 04:16:22 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3D60E4E; Tue, 13 Jun 2023 01:16:20 -0700 (PDT) Received: from [192.168.10.54] (unknown [119.155.33.163]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id 1ABF86606ED2; Tue, 13 Jun 2023 09:16:16 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686644179; bh=23nB+nTv3KCcOlVRmQT97LpYYVvrc8jbpP9qb6C81us=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=hO7vn83iGsoPMQ+DTS+RAHvOkpTsmthC2Fn31D1IGPll3ujIv2OV3ql9BpdJ9se3J c2JoYUPtlplbg6zGgNkSckcSca3gJcYH4nkTBOYB24ztZW2fm9/sisbUaZ4UXXM3Ow DIr4yW7vRnLJyYPZbKNnb7Kj8cYFEaAqj5KjluL3t6oOv/LOi36zcaqp4fwY5bTMK0 EfPxd54u8W0lVHPsoGSXJsuRqU1pUhRQQcb7svcuU3Bf2GAFdRzLWZD3TbSRxCVekB jF3u4UxoHawFeKq3O+J9K8Jnk7gSJXUXTgVBskfxnJLIj44g0Mr7luT0BkaFUMJiqN /5fb555dPbQEg== Message-ID: Date: Tue, 13 Jun 2023 13:16:12 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cc: Muhammad Usama Anjum , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, jhubbard@nvidia.com Subject: Re: [PATCH] selftests: lib.mk: fix out-of-tree builds Content-Language: en-US To: Anders Roxell , shuah@kernel.org, Andrew Morton , "open list : MEMORY MANAGEMENT" , John Hubbard References: <20230613074931.666966-1-anders.roxell@linaro.org> From: Muhammad Usama Anjum In-Reply-To: <20230613074931.666966-1-anders.roxell@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_SORBS_WEB, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch needs to go through mm tree as the commit which it fixes is in mm. On 6/13/23 12:49 PM, Anders Roxell wrote: > Since commit ("selftests: error out if kernel header files are not yet > built") got merged, the kselftest build correctly because the > KBUILD_OUTPUT isn't set when building out-of-tree and specifying 'O=' > This is the error message that pops up. > > make --silent --keep-going --jobs=32 O=/home/anders/.cache/tuxmake/builds/1482/build INSTALL_PATH=/home/anders/.cache/tuxmake/builds/1482/build/kselftest_install ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- V=1 CROSS_COMPILE_COMPAT=arm-linux-gnueabihf- kselftest-install > make[3]: Entering directory '/home/anders/src/kernel/next/tools/testing/selftests/alsa' > > -e error: missing kernel header files. > Please run this and try again: > > cd /home/anders/src/kernel/next/tools/testing/selftests/../../.. > make headers > > make[3]: Leaving directory '/home/anders/src/kernel/next/tools/testing/selftests/alsa' > make[3]: *** [../lib.mk:77: kernel_header_files] Error 1 > > Fixing the issue by assigning KBUILD_OUTPUT the same way how its done in > kselftest's Makefile. By adding 'KBUILD_OUTPUT := $(O)' 'if $(origin O)' > is set to 'command line'. This will set the the BUILD dir to > KBUILD_OUTPUT/kselftest when doing out-of-tree builds which makes them > in its own separete output directory. > > Signed-off-by: Anders Roxell Please add fixes tag. ("selftests: error out if kernel header files are not yet built") Tested-by: Muhammad Usama Anjum > --- > tools/testing/selftests/lib.mk | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk > index b8ea03b9a015..d17854285f2b 100644 > --- a/tools/testing/selftests/lib.mk > +++ b/tools/testing/selftests/lib.mk > @@ -44,6 +44,10 @@ endif > selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST)))) > top_srcdir = $(selfdir)/../../.. > > +ifeq ("$(origin O)", "command line") > + KBUILD_OUTPUT := $(O) > +endif > + > ifneq ($(KBUILD_OUTPUT),) > # Make's built-in functions such as $(abspath ...), $(realpath ...) cannot > # expand a shell special character '~'. We use a somewhat tedious way here. -- BR, Muhammad Usama Anjum