Skip to contentSkip to conversation

gnu-config: improve detection of perl setup errors

PATCH Superseded Andre McCurdy 2 participants 3 messages May 23, 2015 – May 26, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gnu-config: improve detection of perl setup errors

Dry-run the 'autoconf --trace ...' command to improve error detection.

If we only read the command's output via a pipe to Autom4te::XFile then perl setup errors (e.g. mixing host and OE perl libs) which cause the autoconf command to segfault may go undetected.

---

Warning: This patch causes building of some packages to fail if OE and host perl versions differ, so should not be merged until those issues are resolved. To reproduce the current issues:

- Use a host with perl 5.18 (e.g. Ubuntu 14.04)
- Apply this patch to oe-core master or fido
- bitbake -fc configure intltool

 .../gnu-config/gnu-config/gnu-configize.in               | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in +12 -4
index d4908fc..087fcfc 100755
@@ -146,22 +146,30 @@ sub gnu_configize_current_directory ()
       return;
     }
 
+  my $autoconf_cmd;
   my $aux_dir;
   my @subdir;
   my $cmd;
   my $dest;
 
   verb "$configure_ac: tracing";
-  my $traces = new Autom4te::XFile
-    ("$autoconf"
+
+  $autoconf_cmd = "$autoconf"
      . join (' --trace=', '',
 	     # If you change this list, update the
 	     # `Autoreconf-preselections' section of autom4te.in.
 	     'AC_CONFIG_AUX_DIR:AC_CONFIG_AUX_DIR:\$1',
 	     'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1',
 	     'AC_INIT',
-	    )
-     . ' |');
+	    );
+
+  # Dry-run the 'autoconf --trace ...' command to improve error detection.
+  # If we only read the command's output via a pipe to Autom4te::XFile then
+  # perl setup errors (e.g. mixing host and OE perl libs) which cause the
+  # autoconf command to segfault may go undetected.
+  xsystem ("$autoconf_cmd >/dev/null 2>&1");
+
+  my $traces = new Autom4te::XFile ("$autoconf_cmd |");
   while ($_ = $traces->getline)
     {
       $aux_dir = $1                 if /AC_CONFIG_AUX_DIR:(.*)/;
Signature · 1 line
1.9.1
#1 lore raw
Quoted 8 lines · Andre McCurdy

Warning: This patch causes building of some packages to fail if OE and host perl versions differ, so should not be merged until those issues are resolved. To reproduce the current issues:

- Use a host with perl 5.18 (e.g. Ubuntu 14.04)
- Apply this patch to oe-core master or fido
- bitbake -fc configure intltool

Does this caveat apply to minor perl versions too? This patch causes gcc-source to break when it runs gnu-configize on my Debian machine (perl 5.20.2, OE has 5.20.0).

Ross

#2 lore raw
Quoted 7 lines · Ross
Quoted 5 lines · Andre McCurdy

Warning: This patch causes building of some packages to fail if OE and host perl versions differ, so should not be merged until those issues are resolved. To reproduce the current issues:

Quoted 8 lines
Quoted 3 lines

- Use a host with perl 5.18 (e.g. Ubuntu 14.04)
- Apply this patch to oe-core master or fido
- bitbake -fc configure intltool

Does this caveat apply to minor perl versions too? This patch causes gcc-source to break when it runs gnu-configize on my Debian machine (perl 5.20.2, OE has 5.20.0).

I don't think so. I see the gcc-source error now too and it seems to be a different case of a pre-existing failure from "autoconf --trace" which is made visible by the patch.

Running the "autoconf --trace" command manually for gcc-source gives the error:

 | configure.ac:34: error: Please use exactly Autoconf 2.64 instead of 2.69.
 | config/override.m4:12: _GCC_AUTOCONF_VERSION_CHECK is expanded from...
 | configure.ac:34: the top level
 | autom4te: m4 failed with exit status: 1
Quoted 1 line

Ross