Обсуждение: Small PATCH: check of 2 Perl modules

Поиск
Список
Период
Сортировка

Small PATCH: check of 2 Perl modules

От
Eugene Kazakov
Дата:
TAP-tests need two Perl modules: Test::More and IPC::Run.

The patch adds checking of modules in configure.in and configure.


Eugene Kazakov,
Postgres Professional


Вложения

Re: Small PATCH: check of 2 Perl modules

От
Robert Haas
Дата:
On Fri, Feb 12, 2016 at 8:20 AM, Eugene Kazakov
<e.kazakov@postgrespro.ru> wrote:
> TAP-tests need two Perl modules: Test::More and IPC::Run.
>
> The patch adds checking of modules in configure.in and configure.

Why would we want that?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: Small PATCH: check of 2 Perl modules

От
Michael Paquier
Дата:
On Sat, Feb 13, 2016 at 1:47 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Fri, Feb 12, 2016 at 8:20 AM, Eugene Kazakov
> <e.kazakov@postgrespro.ru> wrote:
>> TAP-tests need two Perl modules: Test::More and IPC::Run.
>>
>> The patch adds checking of modules in configure.in and configure.
>
> Why would we want that?

I was doubtful at the beginning, but it doesn't hurt to have those
sanity checks in configure actually. The idea is that when
--enable-tap-tests is used now we simply error with "Can't locate
IPC/Run.pm in @INC" when kicking the tests, this check would allow one
to know if his environment is adapted to run the tests or not before
compiling anything.

And with this patch, we would fail now with that:
configure: error: Need Perl IPC::Run module

By the way, the patch given upthread by Eugene is incorrect. To begin
with, AX_PROG_PERL_MODULES has not been compiled by autoconf and I
can't believe that it is available on all platforms, for example on
OSX 10.8 I could not see it. And it is actually here:
https://www.gnu.org/software/autoconf-archive/ax_prog_perl_modules.html

I would recommend grabbing a copy of this file, and change the error
message as follows:
Perl module IPC::Run is required to run TAP tests

See the patch attached as reference, we could simplify the macro of
this m4 file and remove the check for perl, which is here:
+# Make sure we have perl
+if test -z "$PERL"; then
+AC_CHECK_PROG(PERL,perl,perl)
+fi
Though I kept the original script as-is in the patch attached.
Regards,
--
Michael

Вложения

Re: Small PATCH: check of 2 Perl modules

От
Eugene Kazakov
Дата:
13.02.2016 16:04, Michael Paquier :
> On Sat, Feb 13, 2016 at 1:47 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>> On Fri, Feb 12, 2016 at 8:20 AM, Eugene Kazakov
>> <e.kazakov@postgrespro.ru> wrote:
>>> TAP-tests need two Perl modules: Test::More and IPC::Run.
>>>
>>> The patch adds checking of modules in configure.in and configure.
>> Why would we want that?
> I was doubtful at the beginning, but it doesn't hurt to have those
> sanity checks in configure actually. The idea is that when
> --enable-tap-tests is used now we simply error with "Can't locate
> IPC/Run.pm in @INC" when kicking the tests, this check would allow one
> to know if his environment is adapted to run the tests or not before
> compiling anything.
>
> And with this patch, we would fail now with that:
> configure: error: Need Perl IPC::Run module
>
> By the way, the patch given upthread by Eugene is incorrect. To begin
> with, AX_PROG_PERL_MODULES has not been compiled by autoconf and I
> can't believe that it is available on all platforms, for example on
> OSX 10.8 I could not see it. And it is actually here:
> https://www.gnu.org/software/autoconf-archive/ax_prog_perl_modules.html
>
> I would recommend grabbing a copy of this file, and change the error
> message as follows:
> Perl module IPC::Run is required to run TAP tests
>
> See the patch attached as reference, we could simplify the macro of
> this m4 file and remove the check for perl, which is here:
> +# Make sure we have perl
> +if test -z "$PERL"; then
> +AC_CHECK_PROG(PERL,perl,perl)
> +fi
> Though I kept the original script as-is in the patch attached.
> Regards,
Michael,

Thank you. You are right, of course. I missed the
m4_ax_prog_perl_modules. Please, see the fixed version of patch in the
attach. I added m4_ax_prog_perl_modules and change the error messages.

The best regards,
Eugene Kazakov,
Postgres Professional

Вложения

Re: Small PATCH: check of 2 Perl modules

От
Peter Eisentraut
Дата:
On 2/12/16 8:20 AM, Eugene Kazakov wrote:
> TAP-tests need two Perl modules: Test::More and IPC::Run.
> 
> The patch adds checking of modules in configure.in and configure.

I think those modules are part of a standard Perl installation.



Re: Small PATCH: check of 2 Perl modules

От
Teodor Sigaev
Дата:
> On 2/12/16 8:20 AM, Eugene Kazakov wrote:
>> TAP-tests need two Perl modules: Test::More and IPC::Run.
> I think those modules are part of a standard Perl installation.

IPC::Run is not. At least for perl from ports tree in FreeBSD.


-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 



Re: Small PATCH: check of 2 Perl modules

От
Michael Paquier
Дата:
On Mon, Feb 15, 2016 at 10:57 PM, Teodor Sigaev <teodor@sigaev.ru> wrote:
>> On 2/12/16 8:20 AM, Eugene Kazakov wrote:
>>>
>>> TAP-tests need two Perl modules: Test::More and IPC::Run.
>>
>> I think those modules are part of a standard Perl installation.
>
> IPC::Run is not. At least for perl from ports tree in FreeBSD.

On OSX and on Windows as well they are now shipped AFAIK.
-- 
Michael



Re: Small PATCH: check of 2 Perl modules

От
Tom Lane
Дата:
Teodor Sigaev <teodor@sigaev.ru> writes:
>> On 2/12/16 8:20 AM, Eugene Kazakov wrote:
>>> TAP-tests need two Perl modules: Test::More and IPC::Run.

>> I think those modules are part of a standard Perl installation.

> IPC::Run is not. At least for perl from ports tree in FreeBSD.

Yeah, I remember having had to install IPC::Run from CPAN, and a couple
of other things too (but I don't remember Test::More specifically), when
setting up some of my buildfarm critters.  It's likely that a lot of
distros bundle these, but I don't think IPC::Run is in a basic
built-from-source Perl.

The real question though is do we need a configure check at all.

Given that investigation into a CMake conversion is actively going
on, I'm hesitant to move the goalposts for it by introducing a brand
new type of configure check.  Maybe we should punt this issue until
that patch is either accepted or decisively rejected.
        regards, tom lane



Re: Small PATCH: check of 2 Perl modules

От
Peter Eisentraut
Дата:
On 2/15/16 8:57 AM, Teodor Sigaev wrote:
>> On 2/12/16 8:20 AM, Eugene Kazakov wrote:
>>> TAP-tests need two Perl modules: Test::More and IPC::Run.
>> I think those modules are part of a standard Perl installation.
> 
> IPC::Run is not. At least for perl from ports tree in FreeBSD.

Right, that's why we added the configure option.  But Test::More is
standard.




Re: Small PATCH: check of 2 Perl modules

От
Victor Wagner
Дата:
On Mon, 15 Feb 2016 08:34:11 -0500
Peter Eisentraut <peter_e@gmx.net> wrote:

> On 2/12/16 8:20 AM, Eugene Kazakov wrote:
> > TAP-tests need two Perl modules: Test::More and IPC::Run.
> > 
> > The patch adds checking of modules in configure.in and configure.  
> 
> I think those modules are part of a standard Perl installation.

Not everyone have "standard perl installation" nowadays. Most Linux
users, for example, use Perl package from the distrubution, and
distributions love to strip down standard perl installation putting its
parts into separate packages, some of which might be optional.

For example, in Centos 6 it is part of perl-Test-Simple package. which
might be not included into docker images or simular minimal systems for
container-based deployment.

So, it worth few lines of the configure.in to remind user that "Your
perl installation is not standard enough".
-- 




Re: Small PATCH: check of 2 Perl modules

От
Alvaro Herrera
Дата:
Victor Wagner wrote:

> Not everyone have "standard perl installation" nowadays. Most Linux
> users, for example, use Perl package from the distrubution, and
> distributions love to strip down standard perl installation putting its
> parts into separate packages, some of which might be optional.
> 
> For example, in Centos 6 it is part of perl-Test-Simple package. which
> might be not included into docker images or simular minimal systems for
> container-based deployment.

That's a good point ...

> So, it worth few lines of the configure.in to remind user that "Your
> perl installation is not standard enough".

... but I agree with the point upthread that this should wait to see
what happens with the CMake stuff, since this is not a newly introduced
problem.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: Small PATCH: check of 2 Perl modules

От
Victor Wagner
Дата:
On Tue, 16 Feb 2016 12:23:56 -0300
Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

> ... but I agree with the point upthread that this should wait to see
> what happens with the CMake stuff, since this is not a newly
> introduced problem.

I doubt, that CMake stuff would be ready for 9.6. There is just one
commitfest left, and it would be quite a radical change.

And even if would appear in the next release, it cannot be easily
backpatched to 9.5. So we'll probably live with autoconf until the
end-of-life of 9.5 series at least.  



--                                   Victor Wagner <vitus@wagner.pp.ru>



Re: Small PATCH: check of 2 Perl modules

От
Robert Haas
Дата:
On Tue, Feb 16, 2016 at 11:48 AM, Victor Wagner <vitus@wagner.pp.ru> wrote:
> On Tue, 16 Feb 2016 12:23:56 -0300
> Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>
>> ... but I agree with the point upthread that this should wait to see
>> what happens with the CMake stuff, since this is not a newly
>> introduced problem.
>
> I doubt, that CMake stuff would be ready for 9.6. There is just one
> commitfest left, and it would be quite a radical change.
>
> And even if would appear in the next release, it cannot be easily
> backpatched to 9.5. So we'll probably live with autoconf until the
> end-of-life of 9.5 series at least.

Yeah, I'm rather doubtful about anything happening with cmake any time soon.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company