Skip to contentSkip to conversation

coreutils: fix do_configure error with long TMPDIR

PATCH In review [email protected] 4 participants 7 messages Aug 20, 2012 – Sep 21, 2012

lore
Share & tools
lore
#0 lore raw

cover coreutils: fix do_configure error with long TMPDIR

From: Wenzong Fan <[email protected]>

By default the 'm4/*' files will be extended with absolute path while autoreconf running, if the length of TMPDIR is too long such as 410 which is the maximum value allowed by 'sanity.bbclass', autoreconf will fail with error:

Can't exec "/bin/sh": Argument list too long ...

Fix this issue by specific the 'acpaths' to '-I ./m4'.

The following changes since commit 91ece5d5668ee1adb5c5e3d757426a0d5187bd84:

libpam: Fix missing DESTDIR for a mkdir causing build failures (2012-08-19 13:32:06 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib wenzong/2766
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=wenzong/2766

Wenzong Fan (1):
coreutils: fix do_configure error with long TMPDIR

 meta/recipes-core/coreutils/coreutils_8.14.bb |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 coreutils: fix do_configure error with long TMPDIR

From: Wenzong Fan <[email protected]>

By default the 'm4/*' files will be extended with absolute path while autoreconf running, if the length of TMPDIR is too long such as 410 which is the maximum value allowed by 'sanity.bbclass', autoreconf will fail with error:

Can't exec "/bin/sh": Argument list too long ...

Fix this issue by specific the 'acpaths' to '-I ./m4'.

[YOCTO #2766]

---
 meta/recipes-core/coreutils/coreutils_8.14.bb |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-core/coreutils/coreutils_8.14.bb +3 -1
index 9a714a9..c7c8e13 100644
@@ -7,7 +7,7 @@ BUGTRACKER = "http://debbugs.gnu.org/coreutils"
 LICENSE = "GPLv3+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
                     file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad"
-PR = "r5"
+PR = "r6"
 DEPENDS = "gmp libcap"
 DEPENDS_virtclass-native = ""
 
@@ -36,6 +36,8 @@ base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdi
 
 sbindir_progs= "chroot"
 
+acpaths = "-I ./m4"
+
 do_install_append() {
 	for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
 
Signature · 1 line
1.7.9.5
#2 lore raw
Quoted 32 lines · On 08/19/2012 07:55 PM, [email protected] wrote:

From: Wenzong Fan <[email protected]>

By default the 'm4/*' files will be extended with absolute path while autoreconf running, if the length of TMPDIR is too long such as 410 which is the maximum value allowed by 'sanity.bbclass', autoreconf will fail with error:

Can't exec "/bin/sh": Argument list too long ...

Fix this issue by specific the 'acpaths' to '-I ./m4'.

[YOCTO #2766]

---
  meta/recipes-core/coreutils/coreutils_8.14.bb |    4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-core/coreutils/coreutils_8.14.bb +1 -1
index 9a714a9..c7c8e13 100644
@@ -7,7 +7,7 @@ BUGTRACKER = "http://debbugs.gnu.org/coreutils"
  LICENSE = "GPLv3+"
  LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
                      file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad"
-PR = "r5"
+PR = "r6"
  DEPENDS = "gmp libcap"
  DEPENDS_virtclass-native = ""
 

meta/recipes-core/coreutils/coreutils_8.14.bb base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdi · line 40

Quoted 5 lines
meta/recipes-core/coreutils/coreutils_8.14.bb +2 -0
@@ -36,6 +36,8 @@ base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdi
 
  sbindir_progs= "chroot"
 
+acpaths = "-I ./m4"
+

This is a poor work-around to the problem, and does not give any idea as to what your fixing. Please investigate a proper fix not just a work-around.

Thanks
Sau!

Quoted 4 lines
meta/recipes-core/coreutils/coreutils_8.14.bb +0 -0
  do_install_append() {
  	for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
 
#3 lore raw
Quoted 37 lines · Saul Wold
Quoted 36 lines · On 08/19/2012 07:55 PM, [email protected] wrote:

From: Wenzong Fan <[email protected]>

By default the 'm4/*' files will be extended with absolute path while autoreconf running, if the length of TMPDIR is too long such as 410 which is the maximum value allowed by 'sanity.bbclass', autoreconf will fail with error:

Can't exec "/bin/sh": Argument list too long ...

Fix this issue by specific the 'acpaths' to '-I ./m4'.

[YOCTO #2766]

---
meta/recipes-core/coreutils/coreutils_8.14.bb | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-core/coreutils/coreutils_8.14.bb +0 -0
index 9a714a9..c7c8e13 100644
@@ -7,7 +7,7 @@ BUGTRACKER = "http://debbugs.gnu.org/coreutils"

LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad"

meta/recipes-core/coreutils/coreutils_8.14.bb +1 -1
-PR = "r5"
+PR = "r6"

DEPENDS = "gmp libcap"
DEPENDS_virtclass-native = ""

meta/recipes-core/coreutils/coreutils_8.14.bb +0 -0
@@ -36,6 +36,8 @@ base_bindir_progs = "cat chgrp chmod chown cp date

dd echo false kill ln ls mkdi

Quoted 7 lines

meta/recipes-core/coreutils/coreutils_8.14.bb base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdi · line 40

Quoted 4 lines

sbindir_progs= "chroot"

meta/recipes-core/coreutils/coreutils_8.14.bb +2 -0
+acpaths = "-I ./m4"
+

This is a poor work-around to the problem, and does not give any idea as to what your fixing. Please investigate a proper fix not just a work-around.

Hi Saul,

Because a too long TMPDIR will caused the failure:

Can't exec "/bin/sh": Argument list too long at /usr/lib/perl/5.10/IO/File.pm line 66.

So we have a limitation in the sanity.bbclass that the tmpdir can't be longer than 410. See commit 2dee999ab2731c2a96e82762ae04fe44f27edac6.

This limitation works for mostly packages but except for coreutils. There are 378 m4 files under '.../coreutils-8.14/m4', so if all of them extended with absolute path while the TMPDIR is long enough, it will be a very long argument list and over the ARG_MAX value that kernel defined.

I think the best solution is reducing the length of argument list, because autoreconf will be run in $S dir, so absolute path is not necessary here. The acpaths is generated by autotools.bbclass and allow to overwrite by a pre-defined value. Another option is getting autotools.bbclass generate acpatchs with relative path directly, this might work, but will effect all autotool packages instead of coreutils only.

Thanks
Wenzong

Quoted 10 lines

Thanks
Sau!

Quoted 5 lines

do_install_append() {
for i in df mktemp base64; do mv ${D}${bindir}/$i
${D}${bindir}/$i.${BPN}; done

#4 lore raw
Quoted 54 lines · wenzong fan
Quoted 38 lines · Saul Wold
Quoted 37 lines · On 08/19/2012 07:55 PM, [email protected] wrote:

From: Wenzong Fan <[email protected]>

By default the 'm4/*' files will be extended with absolute path while autoreconf running, if the length of TMPDIR is too long such as 410 which is the maximum value allowed by 'sanity.bbclass', autoreconf will fail with error:

Can't exec "/bin/sh": Argument list too long ...

Fix this issue by specific the 'acpaths' to '-I ./m4'.

[YOCTO #2766]

---
meta/recipes-core/coreutils/coreutils_8.14.bb | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-core/coreutils/coreutils_8.14.bb +0 -0
index 9a714a9..c7c8e13 100644
@@ -7,7 +7,7 @@ BUGTRACKER = "http://debbugs.gnu.org/coreutils"

LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad"

meta/recipes-core/coreutils/coreutils_8.14.bb +1 -1
-PR = "r5"
+PR = "r6"

DEPENDS = "gmp libcap"
DEPENDS_virtclass-native = ""

meta/recipes-core/coreutils/coreutils_8.14.bb +0 -0
@@ -36,6 +36,8 @@ base_bindir_progs = "cat chgrp chmod chown cp date

dd echo false kill ln ls mkdi

Quoted 7 lines

meta/recipes-core/coreutils/coreutils_8.14.bb base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdi · line 40

Quoted 4 lines

sbindir_progs= "chroot"

meta/recipes-core/coreutils/coreutils_8.14.bb +2 -0
+acpaths = "-I ./m4"
+

This is a poor work-around to the problem, and does not give any idea as to what your fixing. Please investigate a proper fix not just a work-around.

Hi Saul,

Because a too long TMPDIR will caused the failure:

Can't exec "/bin/sh": Argument list too long at
/usr/lib/perl/5.10/IO/File.pm line 66.

Quoted 7 lines

So we have a limitation in the sanity.bbclass that the tmpdir can't be longer than 410. See commit 2dee999ab2731c2a96e82762ae04fe44f27edac6.

This limitation works for mostly packages but except for coreutils. There are 378 m4 files under '.../coreutils-8.14/m4', so if all of them extended with absolute path while the TMPDIR is long enough, it will be a very long argument list and over the ARG_MAX value that kernel defined.

The ARG_MAX from '/usr/include/linux/limits.h' is '131072'. Only the m4/* extended will over than 378 * 410 = 154980 bytes, it's indeed a very long argument list.

Wenzong

Quoted 29 lines

I think the best solution is reducing the length of argument list, because autoreconf will be run in $S dir, so absolute path is not necessary here. The acpaths is generated by autotools.bbclass and allow to overwrite by a pre-defined value. Another option is getting autotools.bbclass generate acpatchs with relative path directly, this might work, but will effect all autotool packages instead of coreutils only.

Thanks
Wenzong

Quoted 10 lines

Thanks
Sau!

Quoted 5 lines

do_install_append() {
for i in df mktemp base64; do mv ${D}${bindir}/$i
${D}${bindir}/$i.${BPN}; done

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#5 lore raw
In reply to Saul Wold
Quoted 37 lines · Saul Wold
Quoted 36 lines · On 08/19/2012 07:55 PM, [email protected] wrote:

From: Wenzong Fan <[email protected]>

By default the 'm4/*' files will be extended with absolute path while autoreconf running, if the length of TMPDIR is too long such as 410 which is the maximum value allowed by 'sanity.bbclass', autoreconf will fail with error:

Can't exec "/bin/sh": Argument list too long ...

Fix this issue by specific the 'acpaths' to '-I ./m4'.

[YOCTO #2766]

---
  meta/recipes-core/coreutils/coreutils_8.14.bb |    4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-core/coreutils/coreutils_8.14.bb +0 -0
index 9a714a9..c7c8e13 100644
@@ -7,7 +7,7 @@ BUGTRACKER = "http://debbugs.gnu.org/coreutils"
  LICENSE = "GPLv3+"
  LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
 

file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad"

meta/recipes-core/coreutils/coreutils_8.14.bb +1 -1
-PR = "r5"
+PR = "r6"
  DEPENDS = "gmp libcap"
  DEPENDS_virtclass-native = ""
@@ -36,6 +36,8 @@ base_bindir_progs = "cat chgrp chmod chown cp date dd echo

false kill ln ls mkdi

Quoted 7 lines

meta/recipes-core/coreutils/coreutils_8.14.bb base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdi · line 40

Quoted 4 lines

sbindir_progs= "chroot"

meta/recipes-core/coreutils/coreutils_8.14.bb +2 -0
+acpaths = "-I ./m4"
+

This is a poor work-around to the problem, and does not give any idea as to what your fixing. Please investigate a proper fix not just a work-around.

Hi Saul,

This is because the aclocal's argument list is very long when building coreutils, it has many arguments (378 m4 files under 'coreutils-8.14/m4'), when the length of the TMPDIR is short this is OK, but when it is longer, there would be a argument list too long error.

I think that we have two solutions to fix this problem:
1) Make aclocal accept longer arguments, unfortunately, the native aclocal is running on the host, the length of the argument depends on the host's kernel (The ARG_MAX which is defined in '/usr/include/linux/limits.h'), so this way doesn't work.

2) Make coreutils' acpaths shorter, this is what this patch does, it changes the absolute path to the relative path, so it doesn't care the length of the TMPDIR anymore.

// Robert

Quoted 15 lines

Thanks
Sau!

Quoted 5 lines
  do_install_append() {
      for i in df mktemp base64; do mv ${D}${bindir}/$i

${D}${bindir}/$i.${BPN}; done

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#6 lore raw
Quoted 60 lines · Robert Yang
Quoted 37 lines · Saul Wold
Quoted 36 lines · On 08/19/2012 07:55 PM, [email protected] wrote:

From: Wenzong Fan <[email protected]>

By default the 'm4/*' files will be extended with absolute path while autoreconf running, if the length of TMPDIR is too long such as 410 which is the maximum value allowed by 'sanity.bbclass', autoreconf will fail with error:

Can't exec "/bin/sh": Argument list too long ...

Fix this issue by specific the 'acpaths' to '-I ./m4'.

[YOCTO #2766]

---
  meta/recipes-core/coreutils/coreutils_8.14.bb |    4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-core/coreutils/coreutils_8.14.bb +0 -0
index 9a714a9..c7c8e13 100644
@@ -7,7 +7,7 @@ BUGTRACKER = "http://debbugs.gnu.org/coreutils"
  LICENSE = "GPLv3+"
  LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
 

file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad"

meta/recipes-core/coreutils/coreutils_8.14.bb +1 -1
-PR = "r5"
+PR = "r6"
  DEPENDS = "gmp libcap"
  DEPENDS_virtclass-native = ""
@@ -36,6 +36,8 @@ base_bindir_progs = "cat chgrp chmod chown cp date dd echo

false kill ln ls mkdi

Quoted 7 lines

meta/recipes-core/coreutils/coreutils_8.14.bb base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdi · line 40

Quoted 4 lines

sbindir_progs= "chroot"

meta/recipes-core/coreutils/coreutils_8.14.bb +2 -0
+acpaths = "-I ./m4"
+

This is a poor work-around to the problem, and does not give any idea as to what your fixing. Please investigate a proper fix not just a work-around.

Hi Saul,

This is because the aclocal's argument list is very long when building coreutils, it has many arguments (378 m4 files under 'coreutils-8.14/m4'), when the length of the TMPDIR is short this is OK, but when it is longer, there would be a argument list too long error.

I think that we have two solutions to fix this problem:
1) Make aclocal accept longer arguments, unfortunately, the native aclocal is running on the host, the length of the argument depends on the host's kernel (The ARG_MAX which is defined in '/usr/include/linux/limits.h'), so this way doesn't work.

Quoted 3 lines

2) Make coreutils' acpaths shorter, this is what this patch does, it changes the absolute path to the relative path, so it doesn't care the length of the TMPDIR anymore.

There is solution

3) Fix autotools.bbclass to use relative paths for acpaths instead of absolute ones. Something like:

for i in find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u | sed -e 's,${S}, \.,'; do
acpaths="$acpaths -I $i"

The reason this hasn't gone in yet as it hacks around it on a per recipe basis rather than fixes an underlying problem.

Cheers,

Richard