Bug 2092426

Summary: postgresql-14.3-1.fc37: FTBFS with Perl 5.36
Product: [Fedora] Fedora Reporter: Jitka Plesnikova <jplesnik>
Component: postgresqlAssignee: Filip Januš <fjanus>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: anon.amish, devrim, fjanus, hhorak, jmlich83, mkulik, panovotn, pkubat, praiskup, tgl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://koji.fedoraproject.org/koji/buildinfo?buildID=1974481
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-07 10:24:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jitka Plesnikova 2022-06-01 14:08:46 UTC
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

Comment 1 Tom Lane 2022-06-01 20:20:21 UTC
Thanks for the report!  Upstream has fixed it like this:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=eb39610f82679e015dd990a3fbba1c62e399c32a

Comment 2 Honza Horak 2022-06-06 14:23:04 UTC
The upstream patch looks good for newer perl (already part of f37), as well as with the older perl version (F36).

f36 scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=87945380
f37 scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=87945341

PR ready: https://src.fedoraproject.org/rpms/postgresql/pull-request/53# (builds on #52 that should therefore be merged first).

Comment 3 Honza Horak 2022-06-07 10:24:41 UTC
Built in rawhide: https://koji.fedoraproject.org/koji/buildinfo?buildID=1977381