Message ID | 20221211030352.2622425-1-masahiroy@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1596193wrr; Sat, 10 Dec 2022 19:15:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf6CHRJXGuMX6KIRpz191J5MXQGJogHH3qJfgNn8CraduLc+c8qAFlmIRDzYbovLrqcgVmrR X-Received: by 2002:a17:906:3c17:b0:7c0:dfb7:4476 with SMTP id h23-20020a1709063c1700b007c0dfb74476mr9838844ejg.57.1670728523309; Sat, 10 Dec 2022 19:15:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670728523; cv=none; d=google.com; s=arc-20160816; b=I1zs8epQ8i2U17hpUleWmR45lFiU8C2fSLlmK7AUm08Bi9O4MsLiLgbNrPJ9jOiN9N vEnyQ1awGjNx/lbJxoIt+4hwB841MscotZSaZuwxil9PD4Rm1cTcR6Or3g9xGFfm67AR x8VBc4RNyCjJySJNI9MnFTZdemIGbUuxVDzzeVQv4Gjz+2PKP1COIT/D0Ter7pJecCH7 mqKhXHPCXVkGHrxqRwvCNjUVsJqX+sIva7Qk29lA66izTeuq7fHHPBiDMcAEQ8NZpn7u AHdR/CcViAQM6d+BEv3fFn3Y8jXcOhlWRk/Pp+izVulGPBY7FkU8ioL1jDXU2f/eAyKH 2ZgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=uJFXerKNyvEfn7d5vanhGOL40C09ySFmgUv+3KWdq58=; b=HVQnk3eVfaDhtq3M+JSlKFzxfGQFzaSWBZ4gJkxSlQhZzyy5+JawIwIG/Am8MjlhoC yyMTHlzAOE+xUZ5lQppGN7kSsrKnzefAogr15XQfMqYZjJy0Mk4foZk2WWYuhxiSL8lV Z+BM3w1ZAdaEcuVKsxTUa5ni0ZtPLz4k/GjWnzqQ0J+AWyLIip4WvMkhoBqm0PEme/qo G7yarJZi2gYPdixG/nkXDcmaKMGghk5UblgTAtHqVuersULPXuP/Q1ny+su2bu/xCzTk RnFg8wp4G7APJCxldFg1nfquYvrh9adbz88dzRwyhHi/DMILuZPb1Ud2fnkP7QQTQTlV xnSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cIJtLunh; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l16-20020a170906795000b007ba89a4fd85si3568381ejo.487.2022.12.10.19.14.52; Sat, 10 Dec 2022 19:15:23 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=cIJtLunh; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbiLKDEE (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Sat, 10 Dec 2022 22:04:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbiLKDEC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 10 Dec 2022 22:04:02 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B2D8FD37; Sat, 10 Dec 2022 19:04:02 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BBC84B80937; Sun, 11 Dec 2022 03:04:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13B32C433EF; Sun, 11 Dec 2022 03:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670727839; bh=KRNswHAYO1IcuR9kG0iBZlhOuhjVaWb06YuN0ImwPlE=; h=From:To:Cc:Subject:Date:From; b=cIJtLunhw2FQPzxttbW8f+vSGCrdQiBhGtcgwyNa6vH/80dogQvDn3eDg0d4p45nV /GDnjqqHgwbrFLkdC2pZofiaByQrBWWT7SOjUf6PmB3Kbsib5d9vMIva32cTVTwI38 KWEE2cWUhKPQCCwJROjnYlUej+mlGyK12hyq+VpqQGfwnjIBxVCMZPQB0dQV8PBKm8 F4cbP4IujgmRZ39TRQr44r70fogKnMqC2dTNnGAF9pb0ns6kWEAc8sh4pN9XNV0MK0 7H23efSSwnevuGV05ag2WMTwLaPL2aDUoBFVEaPH695IyBAtlLIRe9y/b3xzcXPX2k BEJihBtEgnZrA== From: Masahiro Yamada <masahiroy@kernel.org> To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada <masahiroy@kernel.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Nicolas Schier <nicolas@fjasle.eu> Subject: [PATCH] kbuild: ensure Make >= 3.82 is used Date: Sun, 11 Dec 2022 12:03:52 +0900 Message-Id: <20221211030352.2622425-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751885832487167088?= X-GMAIL-MSGID: =?utf-8?q?1751885832487167088?= |
Series |
kbuild: ensure Make >= 3.82 is used
|
|
Commit Message
Masahiro Yamada
Dec. 11, 2022, 3:03 a.m. UTC
Documentation/process/changes.rst notes the minimal GNU Make version,
but it is not checked anywhere.
We could check $(MAKE_VERSION), but another simple way is to check
$(.FEATURES) since the feature list always grows although this way
is not always possible. For example Make 4.0 through 4.2 have the
same set of $(.FEATURES).
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Changes in v3:
- Check the version in a different way
Makefile | 5 +++++
1 file changed, 5 insertions(+)
Comments
On Sun, Dec 11, 2022 at 12:03:52PM +0900, Masahiro Yamada wrote: > Documentation/process/changes.rst notes the minimal GNU Make version, > but it is not checked anywhere. > > We could check $(MAKE_VERSION), but another simple way is to check > $(.FEATURES) since the feature list always grows although this way > is not always possible. For example Make 4.0 through 4.2 have the > same set of $(.FEATURES). > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> > --- > > Changes in v3: > - Check the version in a different way > > Makefile | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/Makefile b/Makefile > index 2dda1e9a717a..66dfc5751470 100644 > --- a/Makefile > +++ b/Makefile > @@ -11,6 +11,11 @@ NAME = Hurr durr I'ma ninja sloth > # Comments in this file are targeted only to the developer, do not > # expect to learn how to build the kernel reading this file. > > +# Ensure Make >= 3.82 > +ifeq ($(filter undefine,$(.FEATURES)),) > +$(error Make $(MAKE_VERSION) is too old) Would it make sense to state what version is needed, similar to the Kconfig checks for compiler and binutils? > +endif > + > $(if $(filter __%, $(MAKECMDGOALS)), \ > $(error targets prefixed with '__' are only for internal use)) > > -- > 2.34.1 >
On Mon 12 Dec 2022 10:21:10 GMT, Nathan Chancellor wrote: > On Sun, Dec 11, 2022 at 12:03:52PM +0900, Masahiro Yamada wrote: > > Documentation/process/changes.rst notes the minimal GNU Make version, > > but it is not checked anywhere. > > > > We could check $(MAKE_VERSION), but another simple way is to check > > $(.FEATURES) since the feature list always grows although this way > > is not always possible. For example Make 4.0 through 4.2 have the > > same set of $(.FEATURES). > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > > Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> > > --- > > > > Changes in v3: > > - Check the version in a different way > > > > Makefile | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/Makefile b/Makefile > > index 2dda1e9a717a..66dfc5751470 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -11,6 +11,11 @@ NAME = Hurr durr I'ma ninja sloth > > # Comments in this file are targeted only to the developer, do not > > # expect to learn how to build the kernel reading this file. > > > > +# Ensure Make >= 3.82 > > +ifeq ($(filter undefine,$(.FEATURES)),) > > +$(error Make $(MAKE_VERSION) is too old) > > Would it make sense to state what version is needed, similar to the > Kconfig checks for compiler and binutils? Checking against 'undefine' (introduced in make-3.82~38) is quite a nice way, I think. Otherwise we needed something like $(filter 3.82% 3.9% 4.% 5.% ..., $(MAKE_VERSION)). Kind regards, Nicolas
On Tue, Dec 13, 2022 at 04:58:30AM +0100 Nicolas Schier wrote: > On Mon 12 Dec 2022 10:21:10 GMT, Nathan Chancellor wrote: > > On Sun, Dec 11, 2022 at 12:03:52PM +0900, Masahiro Yamada wrote: > > > Documentation/process/changes.rst notes the minimal GNU Make version, > > > but it is not checked anywhere. > > > > > > We could check $(MAKE_VERSION), but another simple way is to check > > > $(.FEATURES) since the feature list always grows although this way > > > is not always possible. For example Make 4.0 through 4.2 have the > > > same set of $(.FEATURES). > > > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > > > > Reviewed-by: Nathan Chancellor <nathan@kernel.org> > > Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> > > > > --- > > > > > > Changes in v3: > > > - Check the version in a different way > > > > > > Makefile | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/Makefile b/Makefile > > > index 2dda1e9a717a..66dfc5751470 100644 > > > --- a/Makefile > > > +++ b/Makefile > > > @@ -11,6 +11,11 @@ NAME = Hurr durr I'ma ninja sloth > > > # Comments in this file are targeted only to the developer, do not > > > # expect to learn how to build the kernel reading this file. > > > > > > +# Ensure Make >= 3.82 > > > +ifeq ($(filter undefine,$(.FEATURES)),) > > > +$(error Make $(MAKE_VERSION) is too old) > > > > Would it make sense to state what version is needed, similar to the > > Kconfig checks for compiler and binutils? > > Checking against 'undefine' (introduced in make-3.82~38) is quite a > nice way, I think. Otherwise we needed something like > $(filter 3.82% 3.9% 4.% 5.% ..., $(MAKE_VERSION)). > Nathan, sorry, I somehow I read your question completely wrong. I would also appreciate if the minimum make version would be shown in the error message. Kind regards, Nicolas
On Tue, Dec 13, 2022 at 11:05:05AM +0100, Nicolas Schier wrote: > On Tue, Dec 13, 2022 at 04:58:30AM +0100 Nicolas Schier wrote: > > On Mon 12 Dec 2022 10:21:10 GMT, Nathan Chancellor wrote: > > > On Sun, Dec 11, 2022 at 12:03:52PM +0900, Masahiro Yamada wrote: > > > > Documentation/process/changes.rst notes the minimal GNU Make version, > > > > but it is not checked anywhere. > > > > > > > > We could check $(MAKE_VERSION), but another simple way is to check > > > > $(.FEATURES) since the feature list always grows although this way > > > > is not always possible. For example Make 4.0 through 4.2 have the > > > > same set of $(.FEATURES). > > > > > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > > > > > > Reviewed-by: Nathan Chancellor <nathan@kernel.org> > > > > Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> > > > > > > --- > > > > > > > > Changes in v3: > > > > - Check the version in a different way > > > > > > > > Makefile | 5 +++++ > > > > 1 file changed, 5 insertions(+) > > > > > > > > diff --git a/Makefile b/Makefile > > > > index 2dda1e9a717a..66dfc5751470 100644 > > > > --- a/Makefile > > > > +++ b/Makefile > > > > @@ -11,6 +11,11 @@ NAME = Hurr durr I'ma ninja sloth > > > > # Comments in this file are targeted only to the developer, do not > > > > # expect to learn how to build the kernel reading this file. > > > > > > > > +# Ensure Make >= 3.82 > > > > +ifeq ($(filter undefine,$(.FEATURES)),) > > > > +$(error Make $(MAKE_VERSION) is too old) > > > > > > Would it make sense to state what version is needed, similar to the > > > Kconfig checks for compiler and binutils? > > > > Checking against 'undefine' (introduced in make-3.82~38) is quite a > > nice way, I think. Otherwise we needed something like > > $(filter 3.82% 3.9% 4.% 5.% ..., $(MAKE_VERSION)). > > > > Nathan, sorry, I somehow I read your question completely wrong. I would also > appreciate if the minimum make version would be shown in the error message. No worries, I have done that many a time :) I see Masahiro updated this to v4 with this feedback taken into consideration so I am glad to see we are all in agreement. Cheers, Nathan
From: Nicolas Schier > Sent: 13 December 2022 03:59 ... > > > diff --git a/Makefile b/Makefile > > > index 2dda1e9a717a..66dfc5751470 100644 > > > --- a/Makefile > > > +++ b/Makefile > > > @@ -11,6 +11,11 @@ NAME = Hurr durr I'ma ninja sloth > > > # Comments in this file are targeted only to the developer, do not > > > # expect to learn how to build the kernel reading this file. > > > > > > +# Ensure Make >= 3.82 Wouldn't it be better to say either: # Ensure gmake supports 'undefine' (added in 3.82) or: # Building with gmake versions prior to 3.82 fails due to # bug 'brief description'. # Check for 'undefine' support as a surrogate for the bug fix. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
On Wed 14 Dec 2022 11:05:10 GMT, David Laight wrote: > From: Nicolas Schier > > Sent: 13 December 2022 03:59 > ... > > > > diff --git a/Makefile b/Makefile > > > > index 2dda1e9a717a..66dfc5751470 100644 > > > > --- a/Makefile > > > > +++ b/Makefile > > > > @@ -11,6 +11,11 @@ NAME = Hurr durr I'ma ninja sloth > > > > # Comments in this file are targeted only to the developer, do not > > > > # expect to learn how to build the kernel reading this file. > > > > > > > > +# Ensure Make >= 3.82 > > Wouldn't it be better to say either: > # Ensure gmake supports 'undefine' (added in 3.82) > or: > # Building with gmake versions prior to 3.82 fails due to > # bug 'brief description'. > # Check for 'undefine' support as a surrogate for the bug fix. > > David 'undefine' is not the only feature that has been introduced in make 3.82 that we use, e.g. 'private' keyword is used in rust/Makefile but 'private' is not checkable via .FEATURES. Checking for 'undefine' in .FEATURES is kind of a hack to detect make 3.82, but as written earlier, it prevents doing other explicit version comparison like $(filter-out 3.80 3.81 3.82 3.99.% $(filter 1.% 2.% 3.*)). I think $(filter undefine,$(.FEATURES)),) is a sensible compromise. Kind regards, Nicolas
diff --git a/Makefile b/Makefile index 2dda1e9a717a..66dfc5751470 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,11 @@ NAME = Hurr durr I'ma ninja sloth # Comments in this file are targeted only to the developer, do not # expect to learn how to build the kernel reading this file. +# Ensure Make >= 3.82 +ifeq ($(filter undefine,$(.FEATURES)),) +$(error Make $(MAKE_VERSION) is too old) +endif + $(if $(filter __%, $(MAKECMDGOALS)), \ $(error targets prefixed with '__' are only for internal use))