Occupational safety at the Leaning Toothpick of Babble

zaki
Thu, 08 Sep 2022 14:26:34 +0000
code, parsing, perl programming language, regex

qq always interpolates

I was looking over some of the PPR tests for changes and noticed that the non-interpolating quote-likes test had listed qq'' (qq with single quote delimiters) as non-interpolating. I double-checked the documentation and implementation and noted that qq always interpolates then took this information to Damian Conway. This was fixed in PPR 0.001005.

Cut log₂(N) times

CPANTS reports alerted me that the last development release was failing for Perl ≥ v5.30.0. Looking at the reports and the line which was failing, I saw that it was happening during regex compilation. There was previously a bug at that line that also had something to do with regex compilation when interpolating, so I thought maybe it had something to do with that. Nope. It was a new bug!

So I created a minimum example and ran it through my various perlbrew Perls to see if I was still getting the bug. I was. I hopped on IRC and asked #p5p how I could bisect Perl and find out when the behaviour changed and TonyC pointed me to the Porting/bisect.pl and Porting/bisect-runner.pl scripts. Once I had those pieces, all I needed to do was run

    perl ./Porting/bisect.pl --start v5.28.3 --end v5.30.3 \
      --with-module=PPR --no-module-tests \
      -- \
        ./perl -I lib ppr-warn-min.pl

and wait 23 minutes and showed that the first commit that failed was 7c932d07ca. I have ccache installed so that saved some time with compilation. That line installs PPR (at 0.001005) and then runs my minimal example.

I then reported my findings in a bug report to PPR.

In the meantime, I wanted to make sure that wasn't the only issue, so I went ahead and released Babble 0.090007_02 which squashes the warning. This worked fine when running through perlbrew and CPANTS also had no issues.

In the meantime, Damian Conway fixed PPR to address the bug, so I bumped the minimum version of PPR and reverted the squashed warning for Babble-0.090007_03.

If that works out, I'll release a stable Babble release soon.

Appendix: List of issues and pull requests participated in along the way

Babble

Bug #126285 for Babble: Regexp related test failures

Bug #132725 for Babble: several warnings and broken translation of non-postfixderef array expression ($exe(0)) by PostfixDeref

Bug #132727 for Babble: Order dependent translation can create illegal syntax

Bug #132728 for Babble: empty signatures '()' result in illegal syntax:

PPR

Bug #143876 for PPR: Interpolation within quote-like with single-quote delimiters (rt.cpan.org #143876)

Bug #144248 for PPR: Regex compilation warning for (??{})*+ on Perl v5.30+ (rt.cpan.org #144248)