Skip Menu |

This queue is for tickets about the PathTools CPAN distribution.

Report information
The Basics
Id: 17394
Status: resolved
Priority: 0/
Queue: PathTools

People
Owner: Nobody in particular
Requestors: jdhedden [...] cpan.org
Cc:
AdminCc:

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



Subject: 'make test' failes under Cygwin
PathTools v3.16 fails on 'make test' under Cygwin with Perl 5.8.8 RC1 Show quoted text
> make test
/usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/crossplatform....ok 7/50 skipped: Can't load File::Spec::VMS t/cwd..............ok 1/30Usage: Cwd::cwd() at t/cwd.t line 132. # Looks like you planned 30 tests but only ran 18. # Looks like your test died just after 18. t/cwd..............dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 19-30 Failed 12/30 tests, 60.00% okay t/Functions........ok t/rel2abs2rel......ok t/Spec.............ok 83/473 skipped: various reasons t/taint............ok t/tmpdir...........ok t/win32............skipped all skipped: this is not win32 Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/cwd.t 255 65280 30 24 80.00% 19-30 1 test and 90 subtests skipped. Failed 1/8 test scripts, 87.50% okay. 12/580 subtests failed, 97.93% okay. make: *** [test_dynamic] Error 255 Show quoted text
> perl -Mblib t/cwd.t
1..30 not ok 1 - Cwd should be loaded from blib/ during testing # Failed test (t/cwd.t at line 30) # '/usr/lib/perl5/5.8/cygwin/Cwd.pm' # doesn't match '(?i-xsm:blib)' ok 2 - main->can(...) ok 3 - chdir() not exported by default ok 4 - nor abs_path() ok 5 - nor fast_abs_path() ok 6 - cwd() shouldn't create spurious entries in %ENV # native pwd = '/usr/bin/pwd.exe' ok 7 - cwd() ok 8 - getcwd() ok 9 - fastcwd() ok 10 - fastgetcwd() ok 11 ok 12 - cwd() ok 13 ok 14 - getcwd() ok 15 ok 16 - fastcwd() ok 17 ok 18 - fastgetcwd() Usage: Cwd::cwd() at t/cwd.t line 132. # Looks like you planned 30 tests but only ran 18. # Looks like your test died just after 18. My system: Show quoted text
> perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=cygwin, osvers=1.5.19(0.15042), archname=cygwin-thread-multi-64int uname='cygwin_nt-5.0 pn100-02-2-054p 1.5.19(0.15042) 2006-01-20 13:28 i686 cygwin ' config_args='-de -Duse64bitint -Dusethreads -DPERL_DONT_CREATE_GVSV -Uusemymalloc -A define:optimize=-O3 -pipe -frename-registers -fomit-frame-pointer -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -A define:ld=/usr/bin/ld2' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -Wdeclaration-after-statement', optimize='-O3 -pipe -frename-registers -fomit-frame-pointer -march=pentium4 -mfpmath=sse -mmmx -msse -msse2', cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -Wdeclaration-after-statement' ccversion='', gccversion='3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='/usr/bin/ld2', ldflags =' -s -L/usr/local/lib' libpth=/usr/local/lib /usr/lib /lib libs=-lgdbm -ldb -lcrypt -lgdbm_compat perllibs=-lcrypt -lgdbm_compat libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' -s' cccdlflags=' ', lddlflags=' -s -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_USE_SAFE_PUTENV SPRINTF_RETURNS_STRLEN USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Locally applied patches: MAINT26907 26934 Built under cygwin Compiled at Jan 24 2006 13:26:21 %ENV: PERLIO="perlio" CYGWIN="server ntsec forkchunk:32768" @INC: /usr/lib/perl5/5.8/cygwin /usr/lib/perl5/5.8 .
On Tue Jan 31 08:00:59 2006, JDHEDDEN wrote: Show quoted text
> PathTools v3.16 fails on 'make test' under Cygwin with Perl 5.8.8 RC1 > > t/cwd..............ok 1/30Usage: Cwd::cwd() at t/cwd.t line 132.
This is caused by Cygwin Perl having its own build-in Cwd::cwd() command. Therefore, the new test added in 3.16 must be skipped under Cygwin. Attached is a patch to t/cwd.t to fix this.
--- t/cwd.t 2006-01-30 21:49:50.000000000 -0500 +++ t/cwd.t.fixed 2006-02-24 17:07:48.000000000 -0500 @@ -125,7 +125,9 @@ dir_ends_with( $result, $Test_Dir, "$func()" ); } -{ +SKIP: { + skip 'Cygwin has builtin Cwd::cwd', 1) if ($^O eq 'cygwin'); + # Some versions of File::Path (e.g. that shipped with perl 5.8.5) # call getcwd() with an argument (perhaps by calling it as a # method?), so make sure that doesn't die.
Hi, I don't think that patch is a good idea - the fact remains that File::Path will call Cwd::cwd() with an argument, and that will die. It would be better to fix the actual problem. -Ken
Subject: PathTools 'make test' fails under Cygwin [cf. perl #38628]
RT-Send-CC: perl5-porters [...] perl.org
KWILLIAMS wrote: Show quoted text
> I don't think that patch [to skip, under Cygwin, the test of > allowing an arg to Cwd::cwd] is a good idea - the fact remains that > File::Path will call Cwd::cwd() with an argument, and that will > die.
True. However, your test does not fix that either. It just prevents PathTools from being installed under Cygwin. So what's the point? If you're ignoring an arg, then why test that you're ignoring it? Show quoted text
> It would be better to fix the actual problem.
I don't disagree, but what is your notion of 'the actual problem'? Is it File::Path calling cwd with args? In that case, you shouldn't have modified Cwd's behaviour, but should have submitted a bug report against File::Path. If 'the actual problem' is Cygwin Perl's built-in Cwd::cwd no longer matching PathTools', that Perl needs to be patched. I have submitted just such a patch: http://rt.perl.org/rt3/Ticket/Display.html?id=38628 However, until that gets through to a released version of Perl, PathTools' testing should skip that test under Cywgin. I'm just trying to help things along, namely, getting PathTools' and Cygwin's Cwd::cwd behaviour to match, AND to allow PathTools to install on Cygwin using CPAN (without having to use 'force'). What is really needed is for you and Yitzchak Scott-Thoennes (sthoenna[at]efn.org) to coordinate the scheduling of changes for PathTools and Perl on this matter. Thanks.
On Fri Mar 03 09:25:22 2006, JDHEDDEN wrote: Show quoted text
> KWILLIAMS wrote:
> > I don't think that patch [to skip, under Cygwin, the test of > > allowing an arg to Cwd::cwd] is a good idea - the fact remains that > > File::Path will call Cwd::cwd() with an argument, and that will > > die.
> > True. However, your test does not fix that either.
Right. This is a cygwin bug for which there so far is no fix. Show quoted text
> I don't disagree, but what is your notion of 'the actual problem'? Is > it File::Path calling cwd with args? In that case, you shouldn't have > modified Cwd's behaviour, but should have submitted a bug report > against File::Path.
My notion of the actual problem is that cwd() dies on certain systems when called with arguments, which does happen in The Wild. That test exposes the problem. Sure, it would be nice if we could just submit a bug report to File::Path and wash our hands of it, but I don't think that would be very nice to do. It would mean we'd have to declare a dependency on that version of File::Path, but it's not available as a separate distro, so that's no good. And I don't want any non-zero version numbers in dependencies for this distro anyway, it's too fundamental to depend on other stuff. I think the following patch should get things working. Could you try it out? It seemed to do the trick for me. -Ken Index: Cwd.pm ========================================================= ========== RCS file: /Users/ken/src/CVS-repository/modules/PathTools/Cwd.pm,v retrieving revision 1.42 diff -u -r1.42 Cwd.pm --- Cwd.pm 2006/01/31 02:49:03 1.42 +++ Cwd.pm 2006/03/03 19:33:36 @@ -357,6 +357,15 @@ } } +if ($^O eq 'cygwin') { + # We need to make sure cwd() is called with no args, because it's + # got an arg-less prototype and will die if args are present. + local $^W = 0; + my $orig_cwd = \&cwd; + *cwd = sub { &$orig_cwd() } +} + + # set a reasonable (and very safe) default for fastgetcwd, in case it # isn't redefined later (20001212 rspier) *fastgetcwd = \&cwd;
Subject: RE: [rt.cpan.org #17394] 'make test' failes under Cygwin
Date: Fri, 03 Mar 2006 13:07:35 -0700
To: bug-PathTools [...] rt.cpan.org
From: "Jerry D. Hedden" <jerry [...] hedden.us>
Show quoted text
> Right. This is a cygwin bug for which there so far is no fix.\
It's not really a Cygwin bug. It's a Cygwin Perl bug. There's a file in the Perl source called cygwin.c that has Cwd::cwd coded in it. That's want I submitted the Perl patch against. Show quoted text
> Index: Cwd.pm > ========================================================= > ========== > RCS file: /Users/ken/src/CVS-repository/modules/PathTools/Cwd.pm,v > retrieving revision 1.42 > diff -u -r1.42 Cwd.pm > --- Cwd.pm 2006/01/31 02:49:03 1.42 > +++ Cwd.pm 2006/03/03 19:33:36 > @@ -357,6 +357,15 @@ > } > } > > +if ($^O eq 'cygwin') { > + # We need to make sure cwd() is called with no args, because it's > + # got an arg-less prototype and will die if args are present. > + local $^W = 0; > + my $orig_cwd = \&cwd; > + *cwd = sub { &$orig_cwd() } > +} > + > + > # set a reasonable (and very safe) default for fastgetcwd, in case it > # isn't redefined later (20001212 rspier) > *fastgetcwd = \&cwd;
The patch works fine. Is "local $^W = 0;" because of backward compatibility? If not, wouldn't "no warnings 'redefine';" be better?
On Fri Mar 03 15:07:54 2006, jerry@hedden.us wrote: Show quoted text
> > Right. This is a cygwin bug for which there so far is no fix.\
> > It's not really a Cygwin bug. It's a Cygwin Perl bug.
Sorry, that's what I meant. Show quoted text
> The patch works fine.
Great, I'll release. Show quoted text
> Is "local $^W = 0;" because of backward compatibility? >
Yup, warnings.pm first shipped with perl 5.6, but we target earlier versions than that. -Ken
BTW, I do think your patch to cygwin.c is a good idea. If it's accepted, we could skip the wrapping step when the version of perl is high enough. -Ken