Skip to content

Conversation

@simonmcqueen
Copy link
Member

@simonmcqueen simonmcqueen commented Aug 4, 2021

This change puts autobuild back into a working state if your Perl is old. A lot of our LTS stuff builds or tests (with autobuild) on pretty old kit. A series of changes in Feb earlier this year introduced some syntax that I guess is too modern.

The Perl error looked like:

-bash-3.00$ cat doc_group_build.log 
Warning: Use of "shift" without parentheses is ambiguous at
        /home/oftao/docgit/autobuild/common/prettify.pm line 1719 (#1)
    (S ambiguous) You wrote a unary operator followed by something that
    looks like a binary operator that could also have been interpreted as a
    term or unary operator.  For instance, if you know that the rand
    function has a default argument of 1.0, and you write
    
        rand + 5;
    
    you may THINK you wrote the same thing as
    
        rand() + 5;
    
    but in actual fact, you got
    
        rand(+5);
    
    So put in parentheses to say what you really mean.
    
String found where operator expected at
        /home/oftao/docgit/autobuild/common/prettify.pm line 1719, near "// """ (#2)
    (S syntax) The Perl lexer knows whether to expect a term or an operator.
    If it sees what it knows to be a term when it was expecting to see an
    operator, it gives you this warning.  Usually it indicates that an
    operator or delimiter was omitted, such as a semicolon.
    
        (Missing operator before  ""?)
Warning: Use of "shift" without parentheses is ambiguous at
        /home/oftao/docgit/autobuild/common/prettify.pm line 1720 (#1)
Number found where operator expected at
        /home/oftao/docgit/autobuild/common/prettify.pm line 1720, near "// 1" (#2)
        (Missing operator before  1?)
Warning: Use of "shift" without parentheses is ambiguous at
        /home/oftao/docgit/autobuild/common/prettify.pm line 1721 (#1)
String found where operator expected at
        /home/oftao/docgit/autobuild/common/prettify.pm line 1721, near "// """ (#2)
        (Missing operator before  ""?)
Warning: Use of "shift" without parentheses is ambiguous at
        /home/oftao/docgit/autobuild/common/prettify.pm line 1722 (#1)
String found where operator expected at
        /home/oftao/docgit/autobuild/common/prettify.pm line 1722, near "// """ (#2)
        (Missing operator before  ""?)

syntax error at /home/oftao/docgit/autobuild/common/prettify.pm line 1719, near "// """
syntax error at /home/oftao/docgit/autobuild/common/prettify.pm line 1720, near "// 1"
syntax error at /home/oftao/docgit/autobuild/common/prettify.pm line 1721, near "// """
syntax error at /home/oftao/docgit/autobuild/common/prettify.pm line 1722, near "// """
BEGIN not safe after errors--compilation aborted at /home/oftao/docgit/autobuild/common/prettify.pm line 1839.
Compilation failed in require at /home/oftao/docgit/autobuild/command/notify.pm line 13.
BEGIN failed--compilation aborted at /home/oftao/docgit/autobuild/command/notify.pm line 13.
Compilation failed in require at /home/oftao/docgit/autobuild//autobuild.pl line 73 (#3)
    (F) Probably means you had a syntax error.  Common reasons include:
    
        A keyword is misspelled.
        A semicolon is missing.
        A comma is missing.
        An opening or closing parenthesis is missing.
        An opening or closing brace is missing.
        A closing quote is missing.
    
    Often there will be another error message associated with the syntax
    error giving more information.  (Sometimes it helps to turn on -w.)
    The error message itself often tells you where it was in the line when
    it decided to give up.  Sometimes the actual error is several tokens
    before this, because Perl is good at understanding random input.
    Occasionally the line number may be misleading, and once in a blue moon
    the only way to figure out what's triggering the error is to call
    perl -c repeatedly, chopping away half the program each time to see
    if the error went away.  Sort of the cybernetic version of S<20
    questions>.
    
Uncaught exception from user code:
        syntax error at /home/oftao/docgit/autobuild/common/prettify.pm line 1719, near "// """
syntax error at /home/oftao/docgit/autobuild/common/prettify.pm line 1720, near "// 1"
syntax error at /home/oftao/docgit/autobuild/common/prettify.pm line 1721, near "// """
syntax error at /home/oftao/docgit/autobuild/common/prettify.pm line 1722, near "// """
BEGIN not safe after errors--compilation aborted at /home/oftao/docgit/autobuild/common/prettify.pm line 1839.
Compilation failed in require at /home/oftao/docgit/autobuild/command/notify.pm line 13.
BEGIN failed--compilation aborted at /home/oftao/docgit/autobuild/command/notify.pm line 13.
Compilation failed in require at /home/oftao/docgit/autobuild//autobuild.pl line 73.

@iguessthislldo
Copy link
Member

I don't know how easy it is to get an older Perl running on a newer Linux, but it might be worth it to adding this Perl version to the CI.

@jwillemsen
Copy link
Member

See https://github.com/marketplace/actions/setup-perl-environment for using multiple perl versions

@simonmcqueen simonmcqueen merged commit 126a10f into DOCGroup:master Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants