Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1404064imu; Thu, 13 Dec 2018 14:41:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/W1DBn74mvXnHbP+2z7H84lMKiQ3Hac+PLTq1WTH/PBrmg3AiyguxW03DThrWP5DnoSxOpp X-Received: by 2002:a65:41c2:: with SMTP id b2mr543363pgq.67.1544740888304; Thu, 13 Dec 2018 14:41:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544740888; cv=none; d=google.com; s=arc-20160816; b=nQrp4WtS3XCt3vmINGhsJWjoPfmj2+Uij+68fAnyFktEZdgoSDS94xP5t+KA7GfqzU 1qIlvLjBX1GKkueTfc9wKN5mmMvOKjTf8XeY/j6h8qNyb8UVO0YrDKu1pcwG6f3iEEKV /OpfrduW4MjjW+ZatL+ufN/jGT2QnW/u1W9dbzuB43UqjYzze6KSEA7KeFA2xbs+bVNG agf/v6qioZDLcakydShaUs1BypVlMQoQI+Dcp7oYNSv9XYp3K08KMr8FcN6X6P/acWsc 41LRQ/W3siLAM3Q+xdPYyhcjS/V4G/X9v+4L8OlfviW/0J9r88y6xzddBbiAkGsi4GWj c8Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=W2AMk1HEyFSB8CgO3naUB6PTD14lWzuHA6aYokNOymc=; b=ZSAzXPm4b0jgV/mmnc58vMSaSWxKOaQ+I9B7CQiV5bcyOkAQM4adsMZ6yF3/FCEmiT yJMKdGCvZh8fxZSE1kuZWzSVv82p0GA125EWtJxdBhOLq1XUOr56nr6gH4p4EfemoDVO 83r+wbX+JexHl5w6gOdU6tCbInhgaF63oh2VgPgqADukTJnxwysDXXzHDGKwsIjss7eh +5n43DjJIEm+yU8FPJbt0u1n0AtdLP6ASIRXggQ9Gm/B6iDEbl63IYn0jBi9Onpq1q0r 6KkOLpybij1zHrvHQU7ZRaLi3WJU7llCUCfFDrHqwKXAC1+AKZCE2Talzaa/5jvfCi7Y 54cA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h96si2556447plb.230.2018.12.13.14.41.12; Thu, 13 Dec 2018 14:41:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727775AbeLMWkW (ORCPT + 99 others); Thu, 13 Dec 2018 17:40:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51938 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbeLMWkW (ORCPT ); Thu, 13 Dec 2018 17:40:22 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8AC1F3084259; Thu, 13 Dec 2018 22:40:20 +0000 (UTC) Received: from [10.36.112.17] (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0319F61081; Thu, 13 Dec 2018 22:40:03 +0000 (UTC) Subject: Re: [PATCH] selftests: Fix test errors related to lib.mk khdr target To: shuah@kernel.org, tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, dvhart@infradead.org, bamv2005@gmail.com, brgl@bgdev.pl, fathi.boudra@linaro.org, anders.roxell@linaro.org, daniel.diaz@linaro.org, pintu.ping@gmail.com, drjones@redhat.com, hofsass@google.com, peterx@redhat.com, peng.hao2@zte.com.cn, wei@redhat.com, davem@davemloft.net, dcaratti@redhat.com, akpm@linux-foundation.org, mhocko@suse.com, khalid.aziz@oracle.com, mpe@ellerman.id.au, aneesh.kumar@linux.vnet.ibm.com, dima@arista.com Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, stable@vger.kernel.org References: <20181213200011.10779-1-shuah@kernel.org> From: Paolo Bonzini Openpgp: preference=signencrypt Autocrypt: addr=pbonzini@redhat.com; prefer-encrypt=mutual; keydata= mQHhBFRCcBIBDqDGsz4K0zZun3jh+U6Z9wNGLKQ0kSFyjN38gMqU1SfP+TUNQepFHb/Gc0E2 CxXPkIBTvYY+ZPkoTh5xF9oS1jqI8iRLzouzF8yXs3QjQIZ2SfuCxSVwlV65jotcjD2FTN04 hVopm9llFijNZpVIOGUTqzM4U55sdsCcZUluWM6x4HSOdw5F5Utxfp1wOjD/v92Lrax0hjiX DResHSt48q+8FrZzY+AUbkUS+Jm34qjswdrgsC5uxeVcLkBgWLmov2kMaMROT0YmFY6A3m1S P/kXmHDXxhe23gKb3dgwxUTpENDBGcfEzrzilWueOeUWiOcWuFOed/C3SyijBx3Av/lbCsHU Vx6pMycNTdzU1BuAroB+Y3mNEuW56Yd44jlInzG2UOwt9XjjdKkJZ1g0P9dwptwLEgTEd3Fo UdhAQyRXGYO8oROiuh+RZ1lXp6AQ4ZjoyH8WLfTLf5g1EKCTc4C1sy1vQSdzIRu3rBIjAvnC tGZADei1IExLqB3uzXKzZ1BZ+Z8hnt2og9hb7H0y8diYfEk2w3R7wEr+Ehk5NQsT2MPI2QBd wEv1/Aj1DgUHZAHzG1QN9S8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ecLptsXaes uUHgL9dKIfvpm+rNXRn9wAwGjk0X/A== Message-ID: <623cdf7b-fc3c-2a93-c61a-a043e3d7f75b@redhat.com> Date: Thu, 13 Dec 2018 23:40:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181213200011.10779-1-shuah@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 13 Dec 2018 22:40:21 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/12/18 21:00, shuah@kernel.org wrote: > From: Shuah Khan > > Commit b2d35fa5fc80 ("selftests: add headers_install to lib.mk") added > khdr target to run headers_install target from the main Makefile. The > logic uses KSFT_KHDR_INSTALL and top_srcdir as controls to initialize > variables and include files to run headers_install from the top level > Makefile. There are a few problems with this logic. > > 1. Exposes top_srcdir to all tests > 2. Common logic impacts all tests > 3. Uses KSFT_KHDR_INSTALL, top_srcdir, and khdr in an adhoc way. Tests > add "khdr" dependency in their Makefiles to TEST_PROGS_EXTENDED in > some cases, and STATIC_LIBS in other cases. This makes this framework > confusing to use. > > The common logic that runs for all tests even when KSFT_KHDR_INSTALL > isn't defined by the test. top_srcdir is initialized to a default value > when test doesn't initialize it. It works for all tests without a sub-dir > structure and tests with sub-dir structure fail to build. > > e.g: make -C sparc64/drivers/ or make -C drivers/dma-buf > > ../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory > make: *** No rule to make target '../../../../scripts/subarch.include'. Stop. > > There is no reason to require all tests to define top_srcdir and there is > no need to require tests to add khdr dependency using adhoc changes to > TEST_* and other variables. > > Fix it with a consistent use of KSFT_KHDR_INSTALL and top_srcdir from tests > that have the dependency on headers_install. > > Change common logic to include khdr target define and "all" target with > dependency on khdr when KSFT_KHDR_INSTALL is defined. > > Only tests that have dependency on headers_install have to define just > the KSFT_KHDR_INSTALL, and top_srcdir variables and there is no need to > specify khdr dependency in the test Makefiles. Looks good. Could you please provide a topic branch so that we can avoid conflicts between our trees at the next merge window. Paolo