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 318519.1633891331@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Adjust configure to insist on Perl version >= 5.8.3.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Adjust configure to insist on Perl version >= 5.8.3.
List pgsql-hackers
I wrote:
> The closest I can get to what we want using cpanm is with this recipe:

>     cpanm install Test::Simple@0.87_01
>     cpanm install IPC::Run@0.79
>     cpanm install ExtUtils::MakeMaker@6.50  # downgrade

Upon trying to actually use the perlbrew installation, I discovered
another oversight in the recipe: at least with old perl versions,
you end up with a non-shared libperl, so that --with-perl fails.

That leads me to the attached revision...

            regards, tom lane

diff --git a/src/test/perl/README b/src/test/perl/README
index bfc7cdcfa3..67a050b9d4 100644
--- a/src/test/perl/README
+++ b/src/test/perl/README
@@ -70,20 +70,36 @@ 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
 
+    export PERLBREW_CONFIGURE_FLAGS='-de -Duseshrplib'
     perlbrew --force install 5.8.3
     perlbrew use 5.8.3
     perlbrew install-cpanm
-    cpanm install IPC::Run
+    cpanm install Test::Simple@0.87_01
+    cpanm install IPC::Run@0.79
+    cpanm install ExtUtils::MakeMaker@6.50  # downgrade
 
-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
+
+Due to limitations of cpanm, this recipe doesn't exactly duplicate the
+module list of older buildfarm animals.  The discrepancies should seldom
+matter, but if you want to be sure, bypass cpanm and instead manually
+install the desired versions of Test::Simple and IPC::Run.

pgsql-hackers by date:

Previous
From: Mikael Kjellström
Date:
Subject: Re: Time to upgrade buildfarm coverage for some EOL'd OSes?
Next
From: Peter Eisentraut
Date:
Subject: Re: Adding CI to our tree