Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

compilation problems

by morgon (Priest)
on Nov 28, 2017 at 13:07 UTC ( [id://1204426]=perlquestion: print w/replies, xml ) Need Help??

morgon has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have some suprising problems trying to compile software for openwrt.

I am on Debian testing and my perl is 5.26.1.

When I try to compile the openwrt-toolchain it fails at one point because a perl-script gets generated that contains this:

sub substitute_ac_subst_variables { my ($text) = @_; $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ( +$1)/ge; return $text; }
Unfortunately my perl dies here with "Unescaped left brace in regex is illegal here in regex".

I decided to try an older perl and installed 5.20.3 but the problem persisted.

So I tried the even older perls 5.12.5 and 5.10.1 but to my surprise the attempt to install then via perlbrew failed in the tests.

So it seems the openwrt-toolchain cannot deal with the behaviour of newer perls while the installation of old perls fails...

Before I now set up a VM with an older debian-version, I wanted to see if anybody has any other idea on how to proceed.

Many thanks!

Replies are listed 'Best First'.
Re: compilation problems
by marto (Cardinal) on Nov 28, 2017 at 13:40 UTC

    First hit from a web search for the product name and the error returns this, which looks like a good staring point. Perhaps some of the build scripts for openwrt need to be updated?. For the example above try:

    $text =~ s/\$\{([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker($1 +)/ge;

    perldelta says:

    "You have to now say something like "\{" or "{" to specify to match a LEFT CURLY BRACKET; otherwise, it is a fatal pattern compilation error. This change will allow future extensions to the language.

    These have been deprecated since v5.16, with a deprecation message raised for some uses starting in v5.22. Unfortunately, the code added to raise the message was buggy and failed to warn in some cases where it should have. Therefore, enforcement of this ban for these cases is deferred until Perl 5.30, but the code has been fixed to raise a default-on deprecation message for them in the meantime.

    Some uses of literal "{" occur in contexts where we do not foresee the meaning ever being anything but the literal, such as the very first character in the pattern, or after a "|" meaning alternation. Thusn"

    Regarding perlbrew issues, more details are required.

      The thing is that the offending script itself is generated and I don't understand enough of how things fit together to easily find the spot where you would need to fix it.

        I won't have any real spare time to look into this until the weekend at the earliest. Perhaps grep for the offending line or raise an issue on the openwrt github?

Re: compilation problems
by hippo (Bishop) on Nov 28, 2017 at 13:34 UTC
    I decided to try an older perl and installed 5.20.3 but the problem persisted.

    Perhaps, but the problem is not with that particular subroutine.

    $ cat 1204426.pl sub substitute_ac_subst_variables { my ($text) = @_; $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ( +$1)/ge; return $text; } $ perl -cw 1204426.pl 1204426.pl syntax OK $ perl -v This is perl 5, version 20, subversion 3 (v5.20.3) built for x86_64-li +nux-thread-multi (with 16 registered patches, see perl -V for more detail) Copyright 1987-2015, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. $

      FWIW I get syntax errors with that code on Perl versions back to v5.22.4.

      The change: https://perldoc.perl.org/perl5220delta.html#A-literal-%22%7b%22-should-now-be-escaped-in-a-pattern.

      "f you want a literal left curly bracket (also called a left brace) in a regular expression pattern, you should now escape it by either preceding it with a backslash ("\{" ) or enclosing it within square brackets "[{]" , or by using \Q ; otherwise a deprecation warning will be raised. This was first announced as forthcoming in the v5.16 release; it will allow future extensions to the language to happen."

      Update: marto beat me to it ...


      The way forward always starts with a minimal test.
Re: compilation problems
by Mr. Muskrat (Canon) on Nov 28, 2017 at 17:39 UTC
Re: compilation problems
by 1nickt (Canon) on Nov 28, 2017 at 13:24 UTC

    Hi Morgon,

    I can't add much of use to your question, but I can report that I am also unable to install early perls on Ubuntu 16 with perlbrew. This did not seem to be the case on Ubuntu 14, though I no longer have an installation around to verify. For example:

    $ perlbrew install 5.12.5
    Test Summary Report ------------------- op/numconvert.t (Wstat +: 0 Tests: 1440 Failed: 12) Failed tests: 104, 108, 112, 136, 140, 144, 152, 156 160, 168, 172, 176 op/range.t (Wstat +: 0 Tests: 141 Failed: 25) Failed tests: 84-95, 99-111 op/stash.t (Wstat +: 0 Tests: 31 Failed: 0) TODO passed: 26 Files=1802, Tests=349166, 423 wallclock secs (17.90 usr 5.52 sys + 15 +7.80 cusr 11.04 csys = 192.26 CPU) Result: FAIL makefile:970: recipe for target 'test_harness' failed make: *** [test_harness] Error 37 ##### Brew Failed #####


    The way forward always starts with a minimal test.
      I assume (just guessing really) that it may be due to newer gcc-versions being used.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1204426]
Approved by marto
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found