intltool-update spits warnings with Perl 5.22 (which might be wrongly used by callers)

Bug #1490906 reported by DimStar
68
This bug affects 10 people
Affects Status Importance Assigned to Milestone
intltool
In Progress
High
dobey
Fedora
Fix Released
Undecided

Bug Description

The issue has been identified while building gramps 4.20, with perl 5.22 installed

The build log yields:
[ 30s] Traceback (most recent call last):
[ 30s] File "setup.py", line 545, in <module>
[ 30s] "Classifier: Topic :: Sociology :: Genealogy",
[ 30s] File "/usr/lib64/python3.4/distutils/core.py", line 148, in setup
[ 30s] dist.run_commands()
[ 30s] File "/usr/lib64/python3.4/distutils/dist.py", line 955, in run_commands
[ 30s] self.run_command(cmd)
[ 30s] File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
[ 30s] cmd_obj.run()
[ 30s] File "setup.py", line 248, in run
[ 30s] build_intl(self)
[ 30s] File "setup.py", line 189, in build_intl
[ 30s] if intltool_version() < (0, 25, 0):
[ 30s] File "setup.py", line 98, in intltool_version
[ 30s] return tuple([int(num) for num in version_str.split('.')])
[ 30s] File "setup.py", line 98, in <listcomp>
[ 30s] return tuple([int(num) for num in version_str.split('.')])
[ 30s] ValueError: invalid literal for int() with base 10: 'Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^('
[ 30s] error: Bad exit status from /var/tmp/rpm-tmp.B8qgMp (%build)

The issue here is that gramps' setup.py uses the output of intltool-updates directly (in a non-safe way)... but the underlying issue is actually that intltool-update uses deprecated perl regex syntax.

I'm just preparing a patch for this issue as well - so simply lean back and wait :)

Tags: patch

Related branches

Revision history for this message
In , Ralf (ralf-redhat-bugs) wrote :

Description of problem:

Apparently, intltool-update isn't perl-5.22 (fc23) compatible. It seems to rely on perl-constructs, which have been deprecated in perl-5.22 and now cause intltool-update to face warnings from perl.

Real world example:
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^(.*)\${ <-- HERE ?([A-Z_]+)}?(.*)$/ at /usr/bin/intltool-update line 1065.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ?AC_PACKAGE_NAME}?/ at /usr/bin/intltool-update line 1193.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ?PACKAGE}?/ at /usr/bin/intltool-update line 1194.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ?AC_PACKAGE_VERSION}?/ at /usr/bin/intltool-update line 1195.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ?VERSION}?/ at /usr/bin/intltool-update line 1196.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ?AC_PACKAGE_NAME}?/ at /usr/bin/intltool-update line 1222.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ?PACKAGE}?/ at /usr/bin/intltool-update line 1223.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ?AC_PACKAGE_VERSION}?/ at /usr/bin/intltool-update line 1224.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ?VERSION}?/ at /usr/bin/intltool-update line 1225.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ?\w+}?/ at /usr/bin/intltool-update line 1226.

[Source: https://kojipkgs.fedoraproject.org//work/tasks/488/10090488/build.log]

Version-Release number of selected component (if applicable):
intltool-0.51.0-2.fc23

Revision history for this message
In , Ralf (ralf-redhat-bugs) wrote :

Created attachment 1040684
Proposed patch

I am not sure if the patch is complete but it at least seems to cover all cases I've encountered so far.

Revision history for this message
In , Ralf (ralf-redhat-bugs) wrote :

Taking.

Now that this bug is causing at least one FTBFS, I am going ahead and apply my patch (which at least fixes RHBT#1239545).

Revision history for this message
In , Ralf (ralf-redhat-bugs) wrote :
Revision history for this message
DimStar (dominique-launchpad-net) wrote :
Revision history for this message
Mike Frysinger (vapier) wrote :
dobey (dobey)
Changed in intltool:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Rodney Dawes (dobey)
Revision history for this message
Phil Wyett (philwyettreb) wrote :

The patch for review fixes issues for me with many package builds.

Is this patch to be pushed to trunk and out as a new release soon?

Vlad Orlov (monsta)
tags: added: patch
Changed in fedora:
importance: Unknown → Undecided
status: Unknown → Fix Released
Revision history for this message
Daniel Berrange (berrange) wrote :

Any chance of actually getting a release with this patch included, or is this intltool project dead ?

This bug continues to crop up on various OS - most recently FreeBSD 10 / 11 have broken since they recently updated to Perl 5.26 which makes this regex warning into a fatal error.

Revision history for this message
Jérémy THERIN (jtherin) wrote :

Please, release a new intltool with this patch!

Revision history for this message
Todd Richmond (toddrichmond) wrote :

--- intltool-update.in.orig 2018-09-21 13:34:51.366910791 -0700
+++ intltool-update.in 2018-09-21 13:32:49.378908000 -0700
@@ -1062,13 +1062,15 @@ sub SubstituteVariable
  }
     }

- if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/)
+ if ($str =~ /^(.*)\$\{?([A-Z_]+)}?(.*)$/)
     {
  my $rest = $3;
  my $untouched = $1;
  my $sub = "";
         # Ignore recursive definitions of variables
- $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\${?$2}?/;
+ my $m2 = $2;
+ my $var2 = $varhash{$m2};
+ $sub = $var2 if defined $var2 and $var2 !~ /\$\{?\Q$m2\E\}?/;

  return SubstituteVariable ("$untouched$sub$rest");
     }
@@ -1190,10 +1192,10 @@ sub FindPackageName
  $name =~ s/\(+$//g;
  $version =~ s/\(+$//g;

- $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
- $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
- $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
- $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
+ $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
+ $varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
+ $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
+ $varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
     }

     if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)[,]?([^,\)]+)?/m)
@@ -1219,11 +1221,11 @@ sub FindPackageName
  $version =~ s/\(+$//g;
         $bugurl =~ s/\(+$//g if (defined $bugurl);

- $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
- $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
- $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
- $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
- $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\${?\w+}?/);
+ $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
+ $varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
+ $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
+ $varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
+ $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\$\{?\w+}?/);
     }

     # \s makes this not work, why?
[x86_64/gcc-13.1.0-pps-8.21.0: xtools@xenon15:~/build/eng/pps/branches/8.21.0/tools/xtools]

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.