From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52B62C433EF for ; Fri, 8 Jul 2022 17:14:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238692AbiGHROo (ORCPT ); Fri, 8 Jul 2022 13:14:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238706AbiGHROl (ORCPT ); Fri, 8 Jul 2022 13:14:41 -0400 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E36AB67592 for ; Fri, 8 Jul 2022 10:14:34 -0700 (PDT) Received: by mail-il1-x130.google.com with SMTP id p13so13237234ilq.0 for ; Fri, 08 Jul 2022 10:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zQnzdIq7+kcCIvPMe8V0sHVmwLfuOTlfVM008Ot6Py4=; b=KI9BztZAwGWqBN5V1q9QnQ2P553xwqMKcJ1PBZIbyQ7gMbZPbkeCwQL3TbLR8A5j79 QjWhHerTmnfbkFySBQWjI5Y6BrZ/J1AOGdsuqZZLFZnkJNeuGMMCQiIYx7Qj85SKPQU9 YlPkwY6JZKg/99Wui6eZ0i9bCYygP39NxVGc0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zQnzdIq7+kcCIvPMe8V0sHVmwLfuOTlfVM008Ot6Py4=; b=DT466km/3W0ZQCATZ/U6CYw6+bEx1u/MBXrjQpYBufjZvNIrm25b9bw0gnFNh+C+Hf kirN/SZlXuvE/xV3oFtm7qxF21ifYajwgNf28c+cO8fB1rcAvB5PpB33bJYt3AW4S/Mh dqVkFQ0WiZEYgOpfuh9jDoI9eZtBrGLb7ZBE6eLzEcVo7XuYladKaxyfqXQMpBW/iXA0 xUb//pA/0df9hQ2f378ZvhF5aquY9uWRJLlS4X9Jj21qzqzyrlJCKCpXSRiVCb3D1sfG GLwcIa75isXIOGg0t+o7r+DPFkQAYkMCLSJIfwyhC4kKp/sRDrxwB2bVVn9IG23+9qbP Qmbg== X-Gm-Message-State: AJIora8VD8ZLNIG4hZJBZExOUu9QP1cdP7wmpGdhrqccuaujDftCp4wp bvp1xdArNrR4VKMLPeSbYMNqBg== X-Google-Smtp-Source: AGRyM1uT09qTDSV0u3fir2sFYjX5xcU6HWGFLwO4j1I0IojDLJl9/4U54xIYmHCJCqaxnuz8Oy29Gw== X-Received: by 2002:a92:9412:0:b0:2da:7fb4:435d with SMTP id c18-20020a929412000000b002da7fb4435dmr2791943ili.33.1657300474283; Fri, 08 Jul 2022 10:14:34 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id u194-20020a0223cb000000b0033197f42be0sm18491290jau.157.2022.07.08.10.14.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Jul 2022 10:14:33 -0700 (PDT) Subject: Re: [PATCH 0/4] Fix kselftest build with sub-directory To: Guillaume Tucker , Masahiro Yamada , Michal Marek , Nick Desaulniers , Shuah Khan , Kees Cook , Naresh Kamboju , Anders Roxell Cc: kernel@collabora.com, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan References: From: Shuah Khan Message-ID: Date: Fri, 8 Jul 2022 11:14:32 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org On 7/8/22 10:23 AM, Guillaume Tucker wrote: > Earlier attempts to get "make O=build kselftest-all" to work were > not successful as they made undesirable changes to some functions > in the top-level Makefile. This series takes a different > approach by removing the root cause of the problem within > kselftest, which is when the sub-Makefile tries to install kernel > headers "backwards" by calling make with the top-level Makefile. > The actual issue comes from the fact that $(srctree) is ".." when > building in a sub-directory with "O=build" which then obviously > makes "-C $(top_srcdir)" point outside of the real source tree. > > With this series, the generic kselftest targets work as expected > from the top level with or without a build directory e.g.: > > $ make kselftest-all > > $ make O=build kselftest-all > > Then in order to build using the sub-Makefile explicitly, the > headers have to be installed first. This is arguably a valid > requirement to have when building a tool from a sub-Makefile. > For example, "make -C tools/testing/nvdimm/" fails in a similar > way until has been generated by a kernel build. > > Guillaume Tucker (4): > selftests: drop khdr make target > selftests: stop using KSFT_KHDR_INSTALL > selftests: drop KSFT_KHDR_INSTALL make target > Makefile: add headers_install to kselftest targets > This takes us to back to the state before b2d35fa5fc80 added khdr support. I reluctantly agreed to the change and it has proven to be a problematic change. I would rather have had the dependency stated that headers should be installed prior to building tests - test build depends on kernel build anyway and having dependency on headers having build isn't a huge deal. So I am in favor of getting rid of khdr support. However, this khdr support was a change originated from Linaro test ring. Undoing this might have implication on their workflow. I will pull them into the discussion so they are aware of it and be prepared for this change. thanks, -- Shuah