delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/01/14/07:35:07

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <4B4CB44F.2030609@x-ray.at>
References: <6fa8f66b58b73548b9a6d0e0f8a84018 AT localhost> <4B4CB44F DOT 2030609 AT x-ray DOT at>
Date: Thu, 14 Jan 2010 13:34:44 +0100
Message-ID: <6910a61001140434w766d9934l9663f32e5b50653@mail.gmail.com>
Subject: Re: Perl, abs_path from Version 5.10.1-1 to 5.10.1-2 changed behaviour (no longer uses fast_path?)
From: Reini Urban <rurban AT x-ray DOT at>
To: cygwin AT cygwin DOT com
Cc: moss AT cs DOT umass DOT edu, clkao AT cpan DOT org
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

2010/1/12 Reini Urban:
> Thorsten Gunkel schrieb:
>> Hi *,
>> I have a perl script, which stopped working, when I recently updated
>> cygwin
>> to 1.7.
>>
>> Here is a small demo script which shows the problem. It just calls
>> abs_path()
>> with different values and prints the output. It would be great if anyone
>> could confirm that they also see this behaviour.

Eliot,
Do you have a simple testcase for your svk breakage?
I see no problem in fast_abs_path for Cwd.
I rather want to fix svk, not Cwd.

As seen in http://lists.bestpractical.com/pipermail/svk-devel/2009-May/0012=
24.html
svk is not developed anymore, but bugfixes are taken.

Is it an error already reported here?
http://rt.cpan.org/Public/Dist/Display.html?Name=3DSVK

On another front I just found and fixed the perl rebase problem,
so that updating core extensions require no rebaseall anymore.
So I'll provide an updated perl package soon. Without Eliot's Cwd patch.

>> #!/bin/env perl
>>
>> use strict;
>> use Cwd 'abs_path';
>>
>> abs_path_WITHDEBUG(".");
>> abs_path_WITHDEBUG("C:\\");
>> abs_path_WITHDEBUG("C:\\Program Files\\");
>> abs_path_WITHDEBUG("C:\\Does Not Exist\\");
>> exit;
>>
>> sub abs_path_WITHDEBUG
>> {
>> =A0 my $pPath =3D shift;
>> =A0 my $result_path=3Dabs_path($pPath);
>> =A0 print "Test: \n PrePath=3D{".$pPath."}\nPostPath=3D{".$result_path."=
}\n\n";
>> =A0 return $result_path;
>> }
>>
>>
>>
>> When called with current Perl Version 5.10.1-2 it shows this output:
>> Test:
>> =A0PrePath=3D{.}
>> PostPath=3D{/tmp}
>>
>> Test:
>> =A0PrePath=3D{C:\}
>> PostPath=3D{/tmp/C:\}<--- broken
>>
>> Test:
>> =A0PrePath=3D{C:\Program Files\}
>> PostPath=3D{/tmp/C:\Program Files\}<--- broken
>>
>> Test:
>> =A0PrePath=3D{C:\Does Not Exist\}
>> PostPath=3D{/tmp/C:\Does Not Exist\}<--- broken
>>
>> Please notice, that the Windows path is justed added to the current
>> Unix path (which results in a broken path)
>>
>>
>> When I manually downgrade Perl to Version 5.10.1-1 it shows this output:
>> Test:
>> =A0PrePath=3D{.}
>> PostPath=3D{/tmp}
>>
>> Test:
>> =A0PrePath=3D{C:\}
>> PostPath=3D{/cygdrive/c}
>>
>> Test:
>> =A0PrePath=3D{C:\Program Files\}
>> PostPath=3D{/cygdrive/c/Program Files}
>>
>> C:\Does Not Exist\: No such file or directory at ./demo.pl line 20
>>
>> Here I get the correct Unix path in all cases.
>>
>> The difference seems to be in Cwd.pm:
>>
>> diff -u -U5 Cwd.pm*
>> --- Cwd.pm_old =A02010-01-12 15:37:19.718007800 +0100
>> +++ Cwd.pm_new =A02010-01-12 15:46:32.159043400 +0100
>> @@ -303,11 +303,11 @@
>> =A0 =A0 cygwin =3D>
>> =A0 =A0 {
>> =A0 =A0 =A0getcwd =A0 =A0 =A0 =A0 =A0 =A0 =3D> =A0'cwd',
>> =A0 =A0 =A0fastgetcwd =A0 =A0 =A0 =A0 =3D> =A0'cwd',
>> =A0 =A0 =A0fastcwd =A0 =A0 =A0 =A0 =A0 =A0=3D> =A0'cwd',
>> - =A0 =A0abs_path =A0 =A0 =A0 =A0 =A0 =3D> =A0'fast_abs_path',
>> +# =A0 abs_path =A0 =A0 =A0 =A0 =A0 =3D> =A0'fast_abs_path',
>> =A0 =A0 =A0realpath =A0 =A0 =A0 =A0 =A0 =3D> =A0'fast_abs_path',
>> =A0 =A0 },
>>
>> =A0 =A0 epoc =3D>
>> =A0 =A0 {
>> @@ -817,8 +817,8 @@
>> =A0*abs_path =3D \&_perl_abs_path unless defined&abs_path;
>> =A0*getcwd =3D \&_perl_getcwd unless defined&getcwd;
>>
>> =A0# added function alias for those of us more
>> =A0# used to the libc function. =A0--tchrist 27-Jan-00
>> -*realpath =3D \&abs_path;
>> +*realpath =3D \&abs_path unless defined&realpath;
>>
>> =A01;
>>
>> So abs_path used to point to fast_abs_path, but does not longer for
>> Cygwin?
>> When I use fast_abs_path instead of abs_path in my test script it works
>> for
>> both perl versions 5.10.1-1 and 5.10.1-2. What was wrong with
>> fast_abs_path?
>> Should I just replace abs_path to fast_abs_path?
>
> Yes please, until we come up with a satisfactory solution for all problem=
s.
>
> It was caused by a patch request from Eliott Moss
> http://sourceware.org/ml/cygwin/2009-12/msg00506.html for svk,
> which caused no regressions in the tests.
>
> I'll talk to Stefan M=FCller to add such tests to the PathTools package.
--=20
Reini Urban
http://phpwiki.org/           http://murbreak.at/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019