Marcelo wrote:
On Sat, Mar 21, 2009 at 13:42, Vaidhyanathan Mayilrangam Gopalan
<[email protected]> wrote:

With the latest cupcake merge, the make gives an error saying
argument list too long. I tracked it down to
build/core/tasks/localize.mk.

 I have to ask: how did you figure out which file was the source
 of the problem?  I was using strace to figure out which one was
 the problematic command, but that was as far as I had gotten.


make -d is your friend. It prints a lot of debugging info. The error message comes right after loading localize.mk. I confirmed it by adding a little debug message as follows:

all_resource_files := $(foreach pkg, \
        $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \
        $(PACKAGES.$(pkg).RESOURCE_FILES))
+foo := $(shell echo "*****" >&2)
+foo := $(shell echo $(all_resource_files) >&2)
+foo := $(shell echo "*****" >&2)
values_resource_files := $(shell echo $(all_resource_files) | \
               tr -s / | \
               tr " " "\n" | \

and sure enough, my echo statement also produced the argument list too long.

foo := a b c d
foo1 := a1 b1 c1 d1
foo2 := "something"
files := $(foreach p, $(foo), $(foo2.$(p)) )
bar := $(shell echo $(foo) >&2)
bar := $(shell echo $(foo1) >&2)
bar := $(shell echo $(files) >&2)

When running this makefile, $files expands to an empty list
while it should be  something.a something.b something.c
something.d according to the manual.

 No, because:

 files := $(foreach p, $(foo), $(foo2.$(p)) )

 is iterating over $(foo) and expanding $(p) in the second
 expression, producing:

    $(foo2.a)
    $(foo2.b)
    $(foo2.c)
    $(foo2.d)

 which in turn gets expanded again.  As the variables foo2.a,
 foo2.b, etc, don't exist, files is blank.

 To get what you expect, you'd have to write:

 files := $(foreach p, $(foo), $(foo2).$(p) )

 I suspect this is not the issue in localize.mk.

If you look at localize.mk, my little test is very close to what the localize.mk is doing. I do not know how it is working since it is getting expanded into a large number of variables. I will be online on IRC Sunday morning your time (I believe you are in Costa Rica) and maybe we can track this down.

Regards,
Vaidhy


_______________________________________________
android-freerunner mailing list
[email protected]
http://android.koolu.org/listinfo.cgi/android-freerunner-koolu.org

Reply via email to