pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
plperl tests fail with latest Perl 5.36
5+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2022-06-01 eb39610f82 c085387345 b5265196e5 d4c1618421 9fdeae8486 b53780e1be a3b685fdd1 6f9ea6cf33 d5e1d5ed90 eeac7dd9ff 1072e4c45d  Fix pl/perl test case so it will still work under Perl 5.36.
* plperl tests fail with latest Perl 5.36
@ 2022-06-01 14:22  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2022-06-01 14:22 UTC (permalink / raw)
  To: pgsql-hackers@lists.postgresql.org

Apparently 5.36 rejiggers warning classifications in a way that breaks
one of our test cases.  Perhaps we should switch it to some other
warning-triggering condition.

			regards, tom lane

------- Forwarded Message

Date:    Wed, 01 Jun 2022 14:08:46 +0000
From:    bugzilla@redhat.com
To:      tgl@sss.pgh.pa.us
Subject: [Bug 2092426] New: postgresql-14.3-1.fc37: FTBFS with Perl 5.36

https://bugzilla.redhat.com/show_bug.cgi?id=2092426

            Bug ID: 2092426
           Summary: postgresql-14.3-1.fc37: FTBFS with Perl 5.36
           Product: Fedora
           Version: rawhide
               URL: https://koji.fedoraproject.org/koji/buildinfo?buildID=
                    1974481
            Status: NEW
         Component: postgresql
          Assignee: fjanus@redhat.com
          Reporter: jplesnik@redhat.com
        QA Contact: extras-qa@fedoraproject.org
                CC: anon.amish@gmail.com, devrim@gunduz.org,
                    fjanus@redhat.com, hhorak@redhat.com,
                    jmlich83@gmail.com, mkulik@redhat.com,
                    panovotn@redhat.com, pkubat@redhat.com,
                    praiskup@redhat.com, tgl@sss.pgh.pa.us
  Target Milestone: ---
    Classification: Fedora



I am working on adding Perl 5.36 to Fedora Rawhide/37 (not done yet).

The rebuild of postgresql failed with this version in side tag f37-perl:

=== make failure: src/pl/plperl/regression.diffs ===
diff -U3
/builddir/build/BUILD/postgresql-14.3/src/pl/plperl/expected/plperl.out
/builddir/build/BUILD/postgresql-14.3/src/pl/plperl/results/plperl.out
--- /builddir/build/BUILD/postgresql-14.3/src/pl/plperl/expected/plperl.out    
2022-05-09 21:14:45.000000000 +0000
+++ /builddir/build/BUILD/postgresql-14.3/src/pl/plperl/results/plperl.out     
2022-06-01 11:23:50.925042793 +0000
@@ -726,8 +726,6 @@
 -- check that we can "use warnings" (in this case to turn a warn into an
error)
 -- yields "ERROR:  Useless use of sort in scalar context."
 DO $do$ use warnings FATAL => qw(void) ; my @y; my $x = sort @y; 1; $do$
LANGUAGE plperl;
-ERROR:  Useless use of sort in scalar context at line 1.
-CONTEXT:  PL/Perl anonymous code block
 -- make sure functions marked as VOID without an explicit return work
 CREATE OR REPLACE FUNCTION myfuncs() RETURNS void AS $$
    $_SHARED{myquote} = sub {

The reason of the failure is a change to existing diagnostics[1]:

"Useless use of sort in scalar context is now in the new scalar category.

When sort is used in scalar context, it provokes a warning that doing this is
not useful. This warning used to be in the void category. A new category for
warnings about scalar context has now been added, called scalar."


Solution is replacing
use warnings FATAL => qw(void)
by
use warnings FATAL => qw(scalar)
for this case.

[1]
https://metacpan.org/dist/perl/view/pod/perldelta.pod#Changes-to-Existing-Diagnostics


-- 
You are receiving this mail because:
You are on the CC list for the bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2092426


------- End of Forwarded Message





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: plperl tests fail with latest Perl 5.36
@ 2022-06-01 15:11  Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Dagfinn Ilmari Mannsåker @ 2022-06-01 15:11 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers@lists.postgresql.org

Tom Lane <tgl@sss.pgh.pa.us> writes:

> Apparently 5.36 rejiggers warning classifications in a way that breaks
> one of our test cases.  Perhaps we should switch it to some other
> warning-triggering condition.

The simplest thing is to actually use sort in void context,
i.e. removing the `my $x = ` part from the test, see the attached.

Tested on 5.36.0 and 5.8.9.

- ilmari

Attachments:

0001-Fix-plperl-test-for-change-of-warning-category-in-pe.patch (text/x-diff, 2.2K) download From e8ab5acf49c9e78a523beb01b37bcd506665f254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org> Date: Wed, 1 Jun 2022 16:07:48 +0100 Subject: [PATCH] Fix plperl test for change of warning category in perl 5.36 The warning about using in scalar context is now in the 'scalar' category, not 'void'. Actually use sort in void context to keep the warning in the same category across perl versions. --- src/pl/plperl/expected/plperl.out | 4 ++-- src/pl/plperl/sql/plperl.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pl/plperl/expected/plperl.out b/src/pl/plperl/expected/plperl.out index d8a1ff5dd8..aa02bcd5bb 100644 --- a/src/pl/plperl/expected/plperl.out +++ b/src/pl/plperl/expected/plperl.out @@ -725,8 +725,8 @@ ERROR: Can't use string ("foo") as a SCALAR ref while "strict refs" in use at l CONTEXT: PL/Perl anonymous code block -- check that we can "use warnings" (in this case to turn a warn into an error) -- yields "ERROR: Useless use of sort in scalar context." -DO $do$ use warnings FATAL => qw(void) ; my @y; my $x = sort @y; 1; $do$ LANGUAGE plperl; -ERROR: Useless use of sort in scalar context at line 1. +DO $do$ use warnings FATAL => qw(void) ; my @y; sort @y; 1; $do$ LANGUAGE plperl; +ERROR: Useless use of sort in void context at line 1. CONTEXT: PL/Perl anonymous code block -- make sure functions marked as VOID without an explicit return work CREATE OR REPLACE FUNCTION myfuncs() RETURNS void AS $$ diff --git a/src/pl/plperl/sql/plperl.sql b/src/pl/plperl/sql/plperl.sql index b0d950b230..ab222366cd 100644 --- a/src/pl/plperl/sql/plperl.sql +++ b/src/pl/plperl/sql/plperl.sql @@ -470,7 +470,7 @@ DO $do$ use strict; my $name = "foo"; my $ref = $$name; $do$ LANGUAGE plperl; -- check that we can "use warnings" (in this case to turn a warn into an error) -- yields "ERROR: Useless use of sort in scalar context." -DO $do$ use warnings FATAL => qw(void) ; my @y; my $x = sort @y; 1; $do$ LANGUAGE plperl; +DO $do$ use warnings FATAL => qw(void) ; my @y; sort @y; 1; $do$ LANGUAGE plperl; -- make sure functions marked as VOID without an explicit return work CREATE OR REPLACE FUNCTION myfuncs() RETURNS void AS $$ -- 2.30.2
^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: plperl tests fail with latest Perl 5.36
@ 2022-06-01 15:40  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2022-06-01 15:40 UTC (permalink / raw)
  To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; +Cc: pgsql-hackers@lists.postgresql.org

=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= <ilmari@ilmari.org> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> Apparently 5.36 rejiggers warning classifications in a way that breaks
>> one of our test cases.  Perhaps we should switch it to some other
>> warning-triggering condition.

> The simplest thing is to actually use sort in void context,
> i.e. removing the `my $x = ` part from the test, see the attached.

Looks reasonable to me, but I'm hardly a Perl monk.  Anybody have
a different opinion?

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: plperl tests fail with latest Perl 5.36
@ 2022-06-01 16:52  Robert Haas <robertmhaas@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Robert Haas @ 2022-06-01 16:52 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On Wed, Jun 1, 2022 at 11:40 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Looks reasonable to me, but I'm hardly a Perl monk.  Anybody have
> a different opinion?

Well, it falsifies the immediately preceding comment, but I think it's
fine otherwise.

-- 
Robert Haas
EDB: http://www.enterprisedb.com





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: plperl tests fail with latest Perl 5.36
@ 2022-06-01 17:30  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Robert Haas <robertmhaas@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2022-06-01 17:30 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Jun 1, 2022 at 11:40 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Looks reasonable to me, but I'm hardly a Perl monk.  Anybody have
>> a different opinion?

> Well, it falsifies the immediately preceding comment, but I think it's
> fine otherwise.

Duh, right, will fix.

This seems appropriate to back-patch as far as 9.2, since AFAIK there's
not currently anything that breaks plperl in the out-of-support branches.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2022-06-01 17:30 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-06-01 14:22 plperl tests fail with latest Perl 5.36 Tom Lane <tgl@sss.pgh.pa.us>
2022-06-01 15:11 ` Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
2022-06-01 15:40   ` Tom Lane <tgl@sss.pgh.pa.us>
2022-06-01 16:52     ` Robert Haas <robertmhaas@gmail.com>
2022-06-01 17:30       ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox