Skip to contentSkip to conversation

Minimum Perl version?

DISCUSSION Tait 5 participants 10 messages Jun 15, 2016

lore
Share & tools
lore

Tait

author
#0 lore raw

What is the minimum Perl version git expects to support?

I ask, because f922df8... seems to have introduced a open() syntax that is not compatible with some older Perl versions.

#1 lore raw
Quoted 5 lines · Tait

What is the minimum Perl version git expects to support?

I ask, because f922df8... seems to have introduced a open() syntax that is not compatible with some older Perl versions.

I've found that for add -p you'll need 5.8.x or newer, due to stuff like

                my $fh = undef;
                open($fh, '-|', @_) or die;

which fails in e.g. perl 5.6.
There could be some other stuff (in addition to add -p) that also does this kind of thing.

-Tor

#2 lore raw
Quoted 7 lines · Tor Arntsen
Quoted 5 lines · Tait

What is the minimum Perl version git expects to support?

I ask, because f922df8... seems to have introduced a open() syntax that is not compatible with some older Perl versions.

Quoted 8 lines

I've found that for add -p you'll need 5.8.x or newer, due to stuff like

               my $fh = undef;
               open($fh, '-|', @_) or die;

which fails in e.g. perl 5.6.
There could be some other stuff (in addition to add -p) that also does this kind of thing.

If that's the case (I don't have a 5.6 here to do archeology on) then git add -p never worked in 5.6. That was added in 5cde71d6 when it was introduced in 2006:

+sub run_cmd_pipe {
+ my $fh = undef;
+ open($fh, '-|', @_) or die;
+ return <$fh>;
+}

Can you show us the specific error you're getting, and the output of your perl -V ?

#3 lore raw
Quoted 1 line · Ævar Arnfjörð Bjarmason

On Fri, Sep 24, 2010 at 10:27, Tor Arntsen <[email protected]> wrote:

[..]

Quoted 13 lines
Quoted 8 lines

I've found that for add -p you'll need 5.8.x or newer, due to stuff like

               my $fh = undef;
               open($fh, '-|', @_) or die;

which fails in e.g. perl 5.6.
There could be some other stuff (in addition to add -p) that also does this kind of thing.

If that's the case (I don't have a 5.6 here to do archeology on) then git add -p never worked in 5.6. That was added in 5cde71d6 when it was introduced in 2006:

Quoted 8 lines

   +sub run_cmd_pipe {
   +       my $fh = undef;
   +       open($fh, '-|', @_) or die;
   +       return <$fh>;
   +}

Can you show us the specific error you're getting, and the output of your perl -V ?

I don't have that particular installation anymore (I installed perl 5.8 on the machine I had trouble with), and the only other system I have left with perl 5.6 only has an old Git 1.5 version. But it's easy enough to reproduce, Perl 5.6 simply doesn't support that notation. Put the code above in a perl script and execute it:

Can't use an undefined value as filehandle reference at test-pl.pl line 5. (that's the 'open' line)

I can provide the output of -V if you wish, but I don't think it matters really, except for the version:

"Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:".. I.e. perl 5.6.1. The above is from Irix, the original installation I ran Git on was AIX with Perl 5.6.1.

-Tor

#4 lore raw
Quoted 11 lines · Tor Arntsen
Quoted 10 lines

If that's the case (I don't have a 5.6 here to do archeology on) then git add -p never worked in 5.6. That was added in 5cde71d6 when it was introduced in 2006:

   +sub run_cmd_pipe {
   +       my $fh = undef;
   +       open($fh, '-|', @_) or die;
   +       return <$fh>;
   +}

Quoted 2 lines

Can't use an undefined value as filehandle reference at test-pl.pl line 5. (that's the 'open' line)

Maybe it is not the syntax (the separate argument for open mode in this case), but the initialization of $fh to 'undef' which is the problem here?

#5 lore raw
Quoted 3 lines · Alex Riesen

Maybe it is not the syntax (the separate argument for open mode in this case), but the initialization of $fh to 'undef' which is the problem here?

That's correct, I believe, but I also think the underlying problem here is having support for dynamic filehandles which can be exported. You could assign something to $fh and then call open(), but that won't give you what the code asks for.

It should in principle be possible to replace
my $fh = undef;
open ($fh..)
with
use FileHandle;
my $fh = new FileHandle (...)
etc.
which works also on Perl 5.6.

When I first ran into this I did a little bit of hacking in that direction, but I didn't make a full effort and didn't get it to work - in the meantime the customer system which required perl 5.6 (for performance reasons) migrated to a later version of AIX and I was then free to upgrade the perl version to 5.8 on this (my maintance copy of their system), in other words I wasn't affected by the problem anymore and abandoned what I had started working on.

-Tor

#6 lore raw
In reply to Tait
Quoted 5 lines · Tait

What is the minimum Perl version git expects to support?

I ask, because f922df8... seems to have introduced a open() syntax that is not compatible with some older Perl versions.

We generally support 5.6 or above, but 5.8 or above for some other programs.

As far as I can tell there was no new open syntax introduced in that series that wasn't supported before.

What specifically is breaking for you, and on what perl version?

author
#7 lore raw
Quoted 7 lines
Quoted 4 lines

What is the minimum Perl version git expects to support?

I ask, because f922df8... seems to have introduced a open() syntax that is not compatible with some older Perl versions.

We generally support 5.6 or above, but 5.8 or above for some other programs.

I am having to use a system with 5.6.1 to do cvsimport and cvsexportcommit, and interactive add. I haven't tried sendmail or other functions, yet. This system was previously using git 1.6.5.something, and did not have these problems as of that release, but now that I'm building git 1.7.3, they have appeared.

Perl 5.6.1 doesn't support the list open syntax, so one must replace open(my $fh, '-|', @list) with open(my $fh, '-|'), and then exec(@list). I'm working up a patch set to fill my own needs on this system, but based on the subsequent discussion about setting 5.8 as the minimum, it sounds like it's not worth submitting.

Thanks.

#8 lore raw
Quoted 5 lines · Tait
Quoted 5 lines
Quoted 4 lines

What is the minimum Perl version git expects to support?

I ask, because f922df8... seems to have introduced a open() syntax that is not compatible with some older Perl versions.

Quoted 8 lines
Quoted 2 lines

We generally support 5.6 or above, but 5.8 or above for some other programs.

I am having to use a system with 5.6.1 to do cvsimport and cvsexportcommit, and interactive add. I haven't tried sendmail or other functions, yet. This system was previously using git 1.6.5.something, and did not have these problems as of that release, but now that I'm building git 1.7.3, they have appeared.

Maybe marking everything as needing 5.8 or later isn't the right thing to do. E.g. the git-*cvs*.perl code mostly isn't touched, but cvsexportcommit does use Git.pm, so that would also need to be pinned at 5.6 if cvsexportcommit was.

Quoted 5 lines

Perl 5.6.1 doesn't support the list open syntax, so one must replace open(my $fh, '-|', @list) with open(my $fh, '-|'), and then exec(@list). I'm working up a patch set to fill my own needs on this system, but based on the subsequent discussion about setting 5.8 as the minimum, it sounds like it's not worth submitting.

The issue isn't that we don't have a workaround for individual bits like open(my $fh, '-|', @list), but rather that keeping all of the code 5.6 compatible is a burden on ongoing maintenance for a very marginal benefit.

#9 lore raw
Quoted 26 lines · Ævar Arnfjörð Bjarmason
Quoted 5 lines · Tait
Quoted 5 lines
Quoted 4 lines

What is the minimum Perl version git expects to support?

I ask, because f922df8... seems to have introduced a open() syntax that is not compatible with some older Perl versions.

Quoted 8 lines
Quoted 2 lines

We generally support 5.6 or above, but 5.8 or above for some other programs.

I am having to use a system with 5.6.1 to do cvsimport and cvsexportcommit, and interactive add. I haven't tried sendmail or other functions, yet. This system was previously using git 1.6.5.something, and did not have these problems as of that release, but now that I'm building git 1.7.3, they have appeared.

Maybe marking everything as needing 5.8 or later isn't the right thing to do. E.g. the git-*cvs*.perl code mostly isn't touched, but cvsexportcommit does use Git.pm, so that would also need to be pinned at 5.6 if cvsexportcommit was.

Quoted 5 lines

Perl 5.6.1 doesn't support the list open syntax, so one must replace open(my $fh, '-|', @list) with open(my $fh, '-|'), and then exec(@list). I'm working up a patch set to fill my own needs on this system, but based on the subsequent discussion about setting 5.8 as the minimum, it sounds like it's not worth submitting.

Quoted 4 lines

The issue isn't that we don't have a workaround for individual bits like open(my $fh, '-|', @list), but rather that keeping all of the code 5.6 compatible is a burden on ongoing maintenance for a very marginal benefit.

If someone steps up and makes various snippets of code 5.6 compatible while not introducing any penalties for 5.8 users, I see no reason to drop those patches.

Tait, submit your patches and I'm sure they'll be reviewed the same as everything else. If they make the code a lot harder to understand or a lot slower, I'm sure they'll be dropped. If they don't, I'm reasonably certain Junio will take them on. I barely speak Perl though, so reviewing them will have to be done by someone else.

Signature · 7 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.