Re: pgsql: Adjust configure to insist on Perl version >= 5.8.3. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pgsql: Adjust configure to insist on Perl version >= 5.8.3.
Date
Msg-id 245162.1633808657@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Adjust configure to insist on Perl version >= 5.8.3.  (Noah Misch <noah@leadboat.com>)
Responses Re: pgsql: Adjust configure to insist on Perl version >= 5.8.3.
List pgsql-hackers
Noah Misch <noah@leadboat.com> writes:
> On Fri, Oct 08, 2021 at 12:03:41PM -0400, Tom Lane wrote:
>> You're not going to get far with "improving the recipe", because it's
>> just not possible.  To check this, I installed perlbrew on a Fedora 34

> Your test result is evidence that "cpanm install Test::More@0.87" is the wrong
> shell command, but it's quite a leap to "just not possible".  Surely there
> exist other shell commands that install
> http://backpan.perl.org/modules/by-authors/id/M/MS/MSCHWERN/Test-Simple-0.87_03.tar.gz.
> (Perhaps none of us will care enough to identify them, but they exist.)

Oh, I never heard of backpan before.  Now I'm tempted to see how far
I can downgrade prairiedog before it breaks ;-).  However, I agree
that most people won't care about that, and probably shouldn't need to.

> By the way, I suspect 93fb39e introduced a regression in the recipe.  (I
> haven't tested, though.)  Before commit 93fb39e, "cpanm install IPC::Run"
> would update Test::More.  As of 5.8.3, the core version of Test::More is new
> enough for IPC::Run but not new enough for PostgreSQL.  I recommend adding
> "cpanm install Test::More" to restore the pre-93fb39e functionality.

Good point.  So how about like the attached?

            regards, tom lane

diff --git a/src/test/perl/README b/src/test/perl/README
index bfc7cdcfa3..ab986f14bc 100644
--- a/src/test/perl/README
+++ b/src/test/perl/README
@@ -70,20 +70,33 @@ perldoc for the test modules, e.g.:
 
     perldoc src/test/perl/PostgresNode.pm
 
-Required Perl
--------------
+Portability
+-----------
+
+Avoid using any bleeding-edge Perl features.  We have buildfarm animals
+running Perl versions as old as 5.8.3, so your tests will be expected
+to pass on that.
 
-Tests must run on perl 5.8.3 and newer. perlbrew is a good way to obtain such
-a Perl; see http://perlbrew.pl .
+Also, do not use any non-core Perl modules except IPC::Run.  Or, if you
+must do so for a particular test, arrange to skip the test when the needed
+module isn't present.  If unsure, you can consult Module::CoreList to find
+out whether a given module is part of the Perl core, and which module
+versions shipped with which Perl releases.
 
-Just install and
+One way to test for compatibility with old Perl versions is to use
+perlbrew; see http://perlbrew.pl .  After installing that, do
 
     perlbrew --force install 5.8.3
     perlbrew use 5.8.3
     perlbrew install-cpanm
+    cpanm install Test::More
     cpanm install IPC::Run
 
-then re-run configure to ensure the correct Perl is used when running
-tests. To verify that the right Perl was found:
+Then re-run Postgres' configure to ensure the correct Perl is used when
+running tests.  To verify that the right Perl was found:
 
     grep ^PERL= config.log
+
+(Note: this recipe does not create a perfect reproduction of a
+back-in-the-day Perl installation, because it will update Test::More
+and IPC::Run to current versions.  In most cases that won't matter.)

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: pgsql: Adjust configure to insist on Perl version >= 5.8.3.
Next
From: Noah Misch
Date:
Subject: Re: pgsql: Adjust configure to insist on Perl version >= 5.8.3.