Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE79DC433DF for ; Tue, 25 Aug 2020 07:13:15 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9811A2074D for ; Tue, 25 Aug 2020 07:13:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9811A2074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kAT8d-0001nh-2F; Tue, 25 Aug 2020 07:12:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kAT8b-0001nb-ME for xen-devel@lists.xenproject.org; Tue, 25 Aug 2020 07:12:57 +0000 X-Inumbo-ID: 3bde8642-0170-402d-869d-b79b662ad499 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3bde8642-0170-402d-869d-b79b662ad499; Tue, 25 Aug 2020 07:12:56 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4C672AE39; Tue, 25 Aug 2020 07:13:26 +0000 (UTC) Subject: Re: Kconfig vs tool chain capabilities To: Jan Beulich , "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Anthony Perard References: <6d5a2014-5184-04f0-62f9-60ddd7537886@suse.com> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: Date: Tue, 25 Aug 2020 09:12:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <6d5a2014-5184-04f0-62f9-60ddd7537886@suse.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 25.08.20 08:31, Jan Beulich wrote: > Hello, > > while the (ongoing) migration to Linux'es Kbuild has brought (and > will continue to bring) quite a few good improvements, there's one > aspect that was - afaict - slipped in without any prior mentioning > and discussing. This mail is meant to serve as a starting point to > have such a discussion "after the fact". The implication is that I > expect there to not be an argument along the lines of "is already > in the tree". In fact one or two of my acks for related patches > were made dependent upon such a discussion to happen, without a > preset outcome. > > I'd also like to ask to avoid an argument of "Linux is doing so, > hence we should do so, too". We really ought to form our own > opinion rather than "blindly" inheriting whatever they do. > > The issue is the intended recognition and recording of tool chain > capabilities. Until now I'm unconvinced this is the intended > purpose of Kconfig, unlike user land's typical ./configure. The > latter serves to interrogate the system of available functionality, > including but not limited to tool chain capabilities. Admin > overrides to this are possible via --enable*, --disable*, or > --with* kinds of options handed to the script. > > As opposed, Kconfig traditionally has served as merely a tool to > collect (build) admin decisions, recording them as well as derived > data. The implication was that the person doing the configuration > was responsible to ensure that selections requiring special tool > chain capabilities would be enabled only if the tool chain used > was actually capable of dealing with the involved code. > > Therefore I see two questions that need answering before either > making more wide spread use of the new functionality, or before > undoing the present uses and returning back to the original model: > > 1) Does it make sense for tool chain capabilities to be recorded? > > 2) Does the recording actually work reliably? > > As to 1), I'm personally of the opinion that the original model > was the better one, even if I can see advantages from downstream > (distro in particular) pov. Yet even for them it may mean they > would not get presented certain options which they may want to > enable, if only they knew they'd need to upgrade their tool > chain. For developers otoh, I don't think this model is a helpful > one: They absolutely should be aware of pieces they end up not > building (and which hence they're also not going test). > > (I'd like to note that there may certainly be cases where during > the building of the tree features get enabled/disabled by other > means without the person doing the build becoming aware. I think > such should equally be converted to Kconfig selections, with the > build simply failing if tool chain prereqs aren't met. The > typical case though is a choice between different ways of > generating code, with no effect on resulting functionality > beyond a possible difference in performance.) > > Additionally the answer to 2) is, I'm afraid, continuing to be > "No", as there is - afaict - no way for a once recorded .config > to get updated if the underlying tool chain changed. All options > to overcome this that I have been able to think of so far > (unconditional invocation of kconfig; hashing of involved [tool > chain] binaries) come with a pretty heavy overhead on build time > and/or other complications. I think both problems can be solved at the same time via the following approach: - collect the data which is reflected in today's CONFIG_ variables in a single script and store it in a file, e.g in a format like: CC_IS_GCC y GCC_VERSION 70500 CLANG_VERSION 0 CC_HAS_VISIBILITY_ATTRIBUTE y - check the tool data at each build to match the contents of that file and either fail the build or update the file and rerun kconfig if they don't match (I think failing the build and requiring to run a "make config" would be the better approach) - fill the CONFIG_ variable contents from that file in kconfig instead of issuing the single shell commands Juergen