2009-06-04 13:55:45

by Sergei Poselenov

[permalink] [raw]
Subject: Re: [PATCH] Re: 'make headers_check' failed to install headers to arbitrary location

Hello all,

On Thu, 21 May 2009 17:46:59 +0400
Sergei Poselenov <[email protected]> wrote:

> Hello all,
>
> A time ago I noted a 'make headers_check' failure, see the
> original message here:
> http://lkml.org/lkml/2009/5/14/248
>
> The proposed patch fixes this error, please review.
> Tested on 2.6.30-rc5.
>

Here is another version of the patch which fixes
the "Argument list too long" error for "make headers_check", used xargs
to minimize the perl calls (thanks, Wolfgang).

Signed-off-by: Sergei Poselenov <[email protected]>
---
scripts/Makefile.headersinst | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 095cfc8..4c54d22 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -54,8 +54,14 @@ quiet_cmd_remove = REMOVE $(unwanted)
cmd_remove = rm -f $(unwanted-file)

quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files)
- cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \
- $(addprefix $(install)/, $(all-files)); \
+# Headers list can be pretty long, xargs helps to avoid
+# the "Argument list too long" error.
+ cmd_check = rm -f hdrlist; touch hdrlist; \
+ for f in $(all-files); do \
+ echo "$(install)/$${f} " >> hdrlist; done; \
+ cat hdrlist | xargs \
+ $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \
+ rm -f hdrlist; \
touch $@

PHONY += __headersinst __headerscheck
--
1.6.0.6


2009-06-04 17:07:26

by Wolfgang Denk

[permalink] [raw]
Subject: Re: [PATCH] Re: 'make headers_check' failed to install headers to arbitrary location

Dear Sergei,

In message <[email protected]> you wrote:
>
> Here is another version of the patch which fixes
> the "Argument list too long" error for "make headers_check", used xargs
> to minimize the perl calls (thanks, Wolfgang).

Hm... but now we have a useless use of cat and a temp file.

> - cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \
> - $(addprefix $(install)/, $(all-files)); \
> +# Headers list can be pretty long, xargs helps to avoid
> +# the "Argument list too long" error.
> + cmd_check = rm -f hdrlist; touch hdrlist; \
> + for f in $(all-files); do \
> + echo "$(install)/$${f} " >> hdrlist; done; \
> + cat hdrlist | xargs \
> + $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \
> + rm -f hdrlist; \

Why not simply:

for f in $(all-files); do
echo "$(install)/$${f}"
done | xargs $(PERL) ...

?

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
A witty saying proves nothing, but saying something pointless gets
people's attention.

2009-06-05 12:11:18

by Sergei Poselenov

[permalink] [raw]
Subject: Re: [PATCH] Re: 'make headers_check' failed to install headers to arbitrary location

On Thu, 04 Jun 2009 19:07:15 +0200
Dear Wolfgang,

Wolfgang Denk <[email protected]> wrote:

> Why not simply:
>
> for f in $(all-files); do
> echo "$(install)/$${f}"
> done | xargs $(PERL) ...
>
> ?
>

Ah,right, I missed this.

Here is the modified version of the patch, tested on 2.6.30-rc8,
ARCH=arm

Subject: [PATCH] Fixed the "Argument list too long" error for "make headers_check",
used xargs to minimize the perl calls.

Signed-off-by: Sergei Poselenov <[email protected]>
---
scripts/Makefile.headersinst | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 095cfc8..0fcd838 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -54,8 +54,12 @@ quiet_cmd_remove = REMOVE $(unwanted)
cmd_remove = rm -f $(unwanted-file)

quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files)
- cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \
- $(addprefix $(install)/, $(all-files)); \
+# Headers list can be pretty long, xargs helps to avoid
+# the "Argument list too long" error.
+ cmd_check = for f in $(all-files); do \
+ echo "$(install)/$${f}"; done \
+ | xargs \
+ $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \
touch $@

PHONY += __headersinst __headerscheck
--
1.6.0.6

2009-06-05 22:59:17

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH] Re: 'make headers_check' failed to install headers to arbitrary location

On Fri, Jun 05, 2009 at 04:11:09PM +0400, Sergei Poselenov wrote:
> On Thu, 04 Jun 2009 19:07:15 +0200
> Dear Wolfgang,
>
> Wolfgang Denk <[email protected]> wrote:
>
> > Why not simply:
> >
> > for f in $(all-files); do
> > echo "$(install)/$${f}"
> > done | xargs $(PERL) ...
> >
> > ?
> >
>
> Ah,right, I missed this.
>
> Here is the modified version of the patch, tested on 2.6.30-rc8,
> ARCH=arm
>
> Subject: [PATCH] Fixed the "Argument list too long" error for "make headers_check",
> used xargs to minimize the perl calls.
>
> Signed-off-by: Sergei Poselenov <[email protected]>

I extended the chagelog with the original error message
and applied this.

Sam