[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH 1/4] build: xen/include: use if_changed


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 13 Jun 2022 13:58:08 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WQ1TOciLbn+AvfbgJ3ScHsEcZBzAxLl72jSGgIwWfbU=; b=dZZbeg6MRWe+A7Nc8LfobaRc03A/Oc+41Uq7g7UWhYc2/oGWlSmildseDpsCU7Sv2vBGjMyrDQB3+a15MNFaF5yebtw5TM3KzXMxFBCISPf8yssLVKRiz0JCfWcugq05L9b3kxcK2lm5vzFZ87wNIGEVstoTwagPilEOaZeToTsKoV7TR6wzVxDBvSA0lNrWjpP1/ATtwI6k69UwmKGO6OAklr+sF5vDFg+F9SzKg/j2PHwafJsxaBl07wLpOzNcR4pB2S7DN1rHzrPWHyl4eAceerVoZTrrt4ogh+y3f2uIff4LozfDrZpzA3ftGvYUROERGJIgHexY9gZW6gR4iQ==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WQ1TOciLbn+AvfbgJ3ScHsEcZBzAxLl72jSGgIwWfbU=; b=Jtevdo/foENYVYyY4dRV0JCTLds8ktRZ77r2oNbRuiDzbwxWigafFEo9DU3sI05XeiNhab9XzY5VO/mcoc9YEjwzbuJPSv7oJDrOvnQ4fdHUSSwgRYLyUBZEgKsySzcytWyeFQR/KHBHSDRnYcTNkRDr4Y+hwYtoC7CGvPNz05ZX0sPcpM6T9LFr1bjxmzkLsPC0hV8LNR2U+W6hkc88JhHJH2sLdo6nBdsRWf9i5vRnKTgxxQj+dKRXZWQcjm2aB4fZwwNdyYiIIaJsIrz14GCJPyV4y2tyTtIWbu3e46bbOo9782kidK2YsIxmTcApT79l4N3GV3rumz043c/kwQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Z7DA8UjO7PQGrcn5DMEo/xT11Yl5xApOD95Jr3i9p/YPKkqoOnvB9U/XrgEO5YtP8Olyx4DlDl8Ki6dJzGYvKmgQKKwwByDR5dQZyhYfyCMK4IO1iVisEYmtqhLPXV/ZrGHqCc8LAODVNbyOaoV/Cfceaalv+TrAMMWU3s3TxrSdJ7hAT9Jk3SMocj/jIHujKbB4wgvunHlH2tduNIWSqWgmb9lm9c3iXp8B0cl0eBg9F+NIBsZ6slFKzu/uFP/C4pMGaWUO/yHctl2Ff7NLk/dmrmdEglR3s8OsHeeN5H2QV+GkvlyQ8Ta1szaAUUR70LYu3FV5PsuMW0p5kYGqKA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NtygYS+0ojZWaRw1/4Rfc+jL2YeNO8i7808AGPOlGcE3N4K5Lmnz7TSe88gI2KsKBZ8Ejqp0CDZA8NOY49TTJDZrzDp+KTpgtNP8SNoeWyVJNxVABOonjgbsl0uzc5kkomyH4dVBPz4YN9zgnJEL0/csuxDBYQWt4ckn7C3aj9yo8m0SioX/uhHzjp3MwNM+1b5Amez4Sp0dVYeokuj5DbUKyQjPyb23SSWvrd1tmImk/nNiye+IrNSQAEqugLNFXFITw8HkFnsd+OuDwIFWeVs9Kb5nEVCiqwHi7JAnI7MYl6jKsHx8CGjcojXGE7rH1ufXBXDzURMDF6zyt1VAWg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 13 Jun 2022 13:58:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYddkD4JsESJA0gkGnWWwykzQjSK1G6E+AgAAC3wCAABeVAIAAEeqAgAZa2QA=
  • Thread-topic: [XEN PATCH 1/4] build: xen/include: use if_changed

Hi Anthony,

> On 9 Jun 2022, at 13:55, Anthony PERARD <anthony.perard@xxxxxxxxxx> wrote:
> 
> On Thu, Jun 09, 2022 at 11:51:20AM +0000, Bertrand Marquis wrote:
>> Hi,
>> 
>>> On 9 Jun 2022, at 11:26, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>> 
>>> On 09.06.2022 12:16, Bertrand Marquis wrote:
>>>> With this change, compiling for x86 is now ending up in:
>>>> CHK     include/headers99.chk
>>>> make[9]: execvp: /bin/sh: Argument list too long
>>>> make[9]: *** [include/Makefile:181: include/headers++.chk] Error 127
>>>> 
>>>> Not quite sure yet why but I wanted to signal it early as other might be 
>>>> impacted.
>>>> 
>>>> Arm and arm64 builds are not impacted.
>>> 
>>> Hmm, that patch has passed the smoke push gate already, so there likely is
>>> more to it than there being an unconditional issue. I did build-test this
>>> before pushing, and I've just re-tested on a 2nd system without seeing an
>>> issue.
>> 
>> I have the problem only when building using Yocto, I did a normal build and 
>> the
>> issue is not coming.
>> 
> 
> Will the following patch help?
> 
> 
> From 0f32f749304b233c0d5574dc6b14f66e8709feba Mon Sep 17 00:00:00 2001
> From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> Date: Thu, 9 Jun 2022 13:42:52 +0100
> Subject: [XEN PATCH] build,include: rework shell script for headers++.chk
> 
> The command line generated for headers++.chk by make is quite long,
> and in some environment it is too long. This issue have been seen in
> Yocto build environment.
> 
> Error messages:
>    make[9]: execvp: /bin/sh: Argument list too long
>    make[9]: *** [include/Makefile:181: include/headers++.chk] Error 127
> 
> Rework to that we do the foreach loop in shell rather that make to
> reduce the command line size by a lot. We also need a way to get
> headers prerequisite for some public headers so we use a switch "case"
> in shell to be able to do some simple pattern matching. Variables
> alone in POSIX shell don't allow to work with associative array or
> variables with "/".
> 
> Reported-by: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
> Fixes: 28e13c7f43 ("build: xen/include: use if_changed")
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> ---
> xen/include/Makefile | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/include/Makefile b/xen/include/Makefile
> index 6d9bcc19b0..ca5e868f38 100644
> --- a/xen/include/Makefile
> +++ b/xen/include/Makefile
> @@ -158,13 +158,22 @@ define cmd_headerscxx_chk
>           touch $@.new;                                                     \
>           exit 0;                                                           \
>       fi;                                                                   \
> -     $(foreach i, $(filter %.h,$^),                                        \
> -         echo "#include "\"$(i)\"                                          \
> +     get_prereq() {                                                        \
> +         case $$1 in                                                       \
> +         $(foreach i, $(filter %.h,$^),                                    \
> +         $(if $($(patsubst $(srctree)/%,%,$i)-prereq),                     \
> +             $(patsubst $(srctree)/%,%,$i)$(close)                         \
> +             echo "$(foreach j, $($(patsubst $(srctree)/%,%,$i)-prereq),   \
> +                     -include c$(j))";;))                                  \
> +         esac;                                                             \
> +     };                                                                    \
> +     for i in $(filter %.h,$^); do                                         \
> +         echo "#include "\"$$i\"                                           \
>           | $(CXX) -x c++ -std=gnu++98 -Wall -Werror -D__XEN_TOOLS__        \
>             -include stdint.h -include $(srcdir)/public/xen.h               \
> -           $(foreach j, $($(patsubst $(srctree)/%,%,$i)-prereq), -include 
> c$(j)) \
> +           `get_prereq $$i`                                                \
>             -S -o /dev/null -                                               \
> -         || exit $$?; echo $(i) >> $@.new;) \
> +         || exit $$?; echo $$i >> $@.new; done;                            \
>       mv $@.new $@
> endef
> 

Just a small reminder that you need to push this patch officially :-)

Cheers
Bertrand




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.