Re: BUG #5339: Version of Perl detected incorrectly

From: Jonathan Leto <jonathan(at)leto(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org, Perl5 Porters <perl5-porters(at)perl(dot)org>
Subject: Re: BUG #5339: Version of Perl detected incorrectly
Date: 2010-02-22 21:30:56
Message-ID: 9aaadf9c1002221330n68d45ac9y8486108f23b01bfb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)
>
>        This is perl, version 4.0
>        This is perl, v5.8.7 built for PA-RISC2.0
>        This 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?  They 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.  Try 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.008001"
> 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

--
Jonathan "Duke" Leto
jonathan(at)leto(dot)net
http://leto.net

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-02-22 21:31:05 Re: BUG #5339: Version of Perl detected incorrectly
Previous Message David Fetter 2010-02-22 21:30:32 Re: BUG #5339: Version of Perl detected incorrectly