Re: BUG #5339: Version of Perl detected incorrectly - Mailing list pgsql-bugs

From Jonathan Leto
Subject Re: BUG #5339: Version of Perl detected incorrectly
Date
Msg-id 9aaadf9c1002221330n68d45ac9y8486108f23b01bfb@mail.gmail.com
Whole thread Raw
In response to Re: BUG #5339: Version of Perl detected incorrectly  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Howdy,

First, thanks to everyone for the quick responses to my bug report.

> The output format of "perl -v" has been reasonably consistent for well
> over a decade, eg (examples captured from various machines around my
> house)
>
> =A0 =A0 =A0 =A0This is perl, version 4.0
> =A0 =A0 =A0 =A0This is perl, v5.8.7 built for PA-RISC2.0
> =A0 =A0 =A0 =A0This is perl, v5.10.0 built for darwin-thread-multi-2level
>
> Why did 5.11 feel a need to go off in a new direction? =A0They haven't
> added any actual new information AFAICS, just made it harder to parse.

Perl 5 recently changed their VCS to git, and to allow for reporting
that someone is running a non-release development version, they
tweaked their version output slightly.


>>> This is not a path towards an acceptable solution, as it effectively
>>> assumes what we are setting out to prove, namely that we have found
>>> a reasonably modern version of perl. =A0Try it in perl 4...
>
>> These words don't seem to make sense. Can you translate?
>
> Which part of "it doesn't work in perl 4" is not clear to you?
> Yes, I'm aware that it *fails* in perl 4, but it doesn't produce
> an error message that would be helpful to a non Perl hacker:

You got me. I forgot that 'use' is not in Perl 4. But the error is not
going to be seen my the end user, is it? I thought the purpose of the
script was to be executed by ./configure and depending on whether it
exits successfully or not, you know if you have the proper version of
perl. Am I misunderstanding something?

>
> $ /usr/local/bin/perl4 -e 'use 5.008001;'
> syntax error in file /tmp/perl-ea01429 at line 1, next 2 tokens "use 5.00=
8001"
> Execution of /tmp/perl-ea01429 aborted due to compilation errors.
>
> That isn't going to lead to people realizing that they need a newer
> Perl, it's just going to lead to bug reports --- sent to *us*.
> I am not prepared to compromise one inch on the clarity of the error
> message put out by configure.

I totally agree with you that clarity of error messages are very
important. I think a hybrid approach will work well: first check for
Perl 5, then use the proposed method by Tim. If Perl 5 is not found,
then some loud message can be printed out, like:

Postgres only works with Perl version X.X.X and higher (or somesuch)


Duke


--=20
Jonathan "Duke" Leto
jonathan@leto.net
http://leto.net

pgsql-bugs by date:

Previous
From: Alex Hunsaker
Date:
Subject: Re: BUG #5339: Version of Perl detected incorrectly
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory