Skip Menu |

This queue is for tickets about the FindBin-libs CPAN distribution.

Report information
The Basics
Id: 25940
Status: resolved
Worked: 30 min
Priority: 0/
Queue: FindBin-libs

People
Owner: LEMBARK [...] cpan.org
Requestors: nikita.dedik [...] bulyon.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.33
Fixed in: (no value)



Subject: FindBin::libs still doesn't compile because of abs_path under Win32
Thanks for providing a fix for bug #24946! Unfortunately, it didn't solve the problem. I've patched the code myself, and my solution worked. I believe you'd better reverse to version 1.33 of the module and apply the simplier patch: it just checks if abs_path works for directory always missing at least under Win32 (see line 60): unless( eval { abs_path cwd } && eval { abs_path '//' } ) instead of: unless( eval { abs_path cwd } ) and replaces abs_path with rel2abs in case the first one doesn't work. Thanks a lot! P.S.: Test 03.t always fails on @binz export test - just because there is really no bin directory along the path of test directory. So you'd either need to add empty bin directory in the distribution or rethink the test :). Thanks!
Subject: Re: [rt.cpan.org #25940] FindBin::libs still doesn't compile because of abs_path under Win32
Date: Fri, 30 Mar 2007 11:50:11 -0400
To: bug-FindBin-libs [...] rt.cpan.org
From: Steven Lembark <lembark [...] wrkhors.com>
Nikita Dedik via RT wrote: Show quoted text
> Fri Mar 30 02:53:35 2007: Request 25940 was acted upon. > Transaction: Ticket created by nikita.dedik@bulyon.com > Queue: FindBin-libs > Subject: FindBin::libs still doesn't compile because of abs_path under Win32 > Broken in: 1.33 > Severity: Critical > Owner: Nobody > Requestors: nikita.dedik@bulyon.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=25940 > > > > Thanks for providing a fix for bug #24946! Unfortunately, it didn't > solve the problem. > > I've patched the code myself, and my solution worked. I believe you'd > better reverse to version 1.33 of the module and apply the simplier > patch: it just checks if abs_path works for directory always missing at > least under Win32 (see line 60): > > unless( eval { abs_path cwd } && eval { abs_path '//' } ) > > instead of: > > unless( eval { abs_path cwd } ) > > and replaces abs_path with rel2abs in case the first one doesn't work. > > Thanks a lot!
Show quoted text
> P.S.: Test 03.t always fails on @binz export test - just because there > is really no bin directory along the path of test directory. So you'd > either need to add empty bin directory in the distribution or rethink > the test :). Thanks!
I can't test these things since I don't have access to windows. The problems you are seeing look more like errors in the porting of abs_path to W32. What does "abs_path '//'" do for you? The only time that "abs_path cwd" could fail is if the directory tree has been modified since the time you did a cd (e.g., rm -rf of the directory above you after you've gotten in or the removal of a symlink used to set the original path). -- Steven Lembark 85-09 90th Street Workhorse Computing Woodhaven, NY 11421 lembark@wrkhors.com +1 888 359 3508
From: nikita.dedik [...] bulyon.com
Show quoted text
> I can't test these things since I don't have access to > windows. The problems you are seeing look more like errors > in the porting of abs_path to W32.
But I believe it's obvious that using FindBin::libs for finding "bin" directory along the path, while the test script is located at, say, "C:/ FindBin-lib" directory and there are no "C:/FindBin-lib/bin" and "C:/ bin" directories, "@binz export" test will fail :). I believe you should include an empty "bin" directory either in "t" directory or the root of distribution. Show quoted text
> What does "abs_path '//'" do for you? The only time that > "abs_path cwd" could fail is if the directory tree has > been modified since the time you did a cd (e.g., rm -rf > of the directory above you after you've gotten in or the > removal of a symlink used to set the original path).
I use abs_path '//' to test if abs_path works correctly - it returns '/ ' under Unix, but with no eval it dies in Windows (No such file or directory: //) - I use the fact that '//' is invalid path in Windows, and thus can catch the case when abs_path dies instead of working fine. Thus, writing unless (eval { abs_path } && eval { abs_path '//' }) { replace_abs_path_with_rel2abs() } gives us this behavior: abs_path works correctly in Unix and stays in place in symbol table and dies for '//' in Windows getting replaced with rel2abs.
Subject: Re: [rt.cpan.org #25940] FindBin::libs still doesn't compile because of abs_path under Win32
Date: Fri, 30 Mar 2007 13:07:41 -0400
To: bug-FindBin-libs [...] rt.cpan.org
From: Steven Lembark <lembark [...] wrkhors.com>
Subject: Re: [rt.cpan.org #25940] FindBin::libs still doesn't compile because of abs_path under Win32 To: bug-FindBin-libs@rt.cpan.org Cc: Bcc: Show quoted text
>> I can't test these things since I don't have access to >> windows. The problems you are seeing look more like errors >> in the porting of abs_path to W32.
Show quoted text
> But I believe it's obvious that using FindBin::libs for finding "bin" > directory along the path, while the test script is located at, say, "C:/ > FindBin-lib" directory and there are no "C:/FindBin-lib/bin" and "C:/ > bin" directories, "@binz export" test will fail :). I believe you > should include an empty "bin" directory either in "t" directory or the > root of distribution.
Been too long since I worked on msdos (1990); the longer I work with *NIX the more I realize why the rooted filesystem make more sense. Last I looked the msdos directory scheme used backslashes ('\')... Show quoted text
> I use abs_path '//' to test if abs_path works correctly - it returns '/
I'll add that then, if it works for you. Note that rel2abs does not perform the same function as abs_path. The former only resolves relative directories, the latter also resolves symlinks. The call to abs_path avoids putting the same absolute path onto the list more than once via symlinks or other subterfuge. Check for 1.35 on CPAN today. -- Steven Lembark 85-09 90th Street Workhorse Computing Woodhaven, NY 11421 lembark@wrkhors.com +1 888 359 3508
From: nikita.dedik [...] bulyon.com
Show quoted text
> Note that rel2abs does not perform the same function as > abs_path. The former only resolves relative directories, > the latter also resolves symlinks. The call to abs_path > avoids putting the same absolute path onto the list more > than once via symlinks or other subterfuge.
Sure rel2abs is worse in this case, but if it's the only way - what can we do? Symlinks is such a rare case in Windows (only supported by one of latest NTFS version and almost not used), so that we can silently "forget" it. Show quoted text
> Check for 1.35 on CPAN today.
Thanks!!
Subject: Re: [rt.cpan.org #25940] FindBin::libs still doesn't compile because of abs_path under Win32
Date: Fri, 30 Mar 2007 13:20:19 -0400
To: bug-FindBin-libs [...] rt.cpan.org
From: Steven Lembark <lembark [...] wrkhors.com>
Show quoted text
>> Check for 1.35 on CPAN today.
> Thanks!!
It's there now, just needs to be indexed. Probably fastest to grab it from <http://search.cpan.org/~lembark/FindBin-libs-1.35/> In a few hours. -- Steven Lembark 85-09 90th Street Workhorse Computing Woodhaven, NY 11421 lembark@wrkhors.com +1 888 359 3508
From: nikita.dedik [...] bulyon.com
Thanks a lot, the module works now on Win32! The only thing left: I believe you should apply the same './bin' workaround which you used in 03.t to 02.t which does still fail '@binz export' test (while 03.t doesn't!). Thanks!
Was fixed in 1.34.