Skip Menu |

This queue is for tickets about the Catalyst-Runtime CPAN distribution.

Report information
The Basics
Id: 26455
Status: resolved
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: Nobody in particular
Requestors: m.nooning [...] comcast.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 5.7007
Fixed in: (no value)



Subject: Can't open perl script "and": No such file or
Windows XP, ActiveState Perl 5.8.8 This is the classic Windows versus Unix - missing double quotes problem. The actual directory it should look for is "C:\Documents and Settings\..." To recreate the error, first set certain environment variables prior to running "nmake test". That is, Do this on the command line prior to "nmake test": ----------paste prior to nmake test set TEST_POD=1 set TEST_HTTP=1 set TEST_HTTP=1 set TEST_LIGHTTPD=1 set TEST_LIGHTTPD=1 set TEST_MEMLEAK=1 set TEST_STRESS=1 set TEST_THREADS=1 -------------end paste prior to nmake test Now do "nmake test". On my machine, the test hangs at ------------paste hangs at t/optional_http-server-restart..............................Can't open perl script "and": No such file or dire ctory -----------end paste hangs at It is easier to just do Show quoted text
>prove t\optional_http-server-restart.t
To get past the first part, I went into optional_http-server-restart.t and made the following modifications, starting with commenting out the system command as shown. --------------paste mod 1 #system # "perl -I$FindBin::Bin/../lib $FindBin::Bin/../script/catalyst.pl TestApp"; my $i_lib = $FindBin::Bin . "/../lib"; my $catalyst_pl = $FindBin::Bin . "/../script/catalyst.pl"; if (system( "perl", "-I$i_lib", $catalyst_pl, "TestApp")) { print STDERR ("\n#Cannot system perl -I$i_lib $catalyst_pl TestApp\n"); }; -----------end paste mod 1 ------------paste mod 2 #my $pid = open my $server, #"perl -I$FindBin::Bin/../lib $FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl -port $port -restart 2>&1 |" # or die "Unable to spawn standalone HTTP server: $!"; my $pid = open my $server, "perl -I\"$i_lib\" \"$FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl\" -port $port -restart 2>&1 |" or die "Unable to spawn standalone HTTP server: $!"; ------------end paste mod 2 I also put quotes around "$files[$index]" in a couple of places. Now it makes it to where it gives the output shown below. ----------paste final output t\optional_http-server-restart....ok 2/40Server appears to have died at t\optional_http-server-restart.t line 85. # Looks like you planned 40 tests but only ran 2. # Looks like your test died just after 2. -------------end final output I do not know where to go with this from here. The tests are not "Windows directory ready". Is Catalyst? Has anyone out there been successful at installing Catalyst on Windows? Can anyone suggest what else I might do here? By the way, I also made the following change because sleep is not meant for finer granularities than one second. ----------paste sleep change #sleep 0.1; select(undef, undef, undef, 0.1); die "Server appears to have died $port" if $count++ > 50; ----------end paste sleep change Thanks
From: AGRUNDMA [...] cpan.org
Catalyst has worked fine on Windows for a long time. The tests in question are optional and really meant for developers only. Do all the non-optional tests work fine? If so, I wouldn't worry too much. But, could you provide a unified diff of your patches?
From: m.nooning [...] comcast.net
7d6 < 29,30c28,37 < system < "perl -I$FindBin::Bin/../lib $FindBin::Bin/../script/catalyst.pl TestApp"; --- Show quoted text
>
Show quoted text
> #system
Show quoted text
> # "perl -I$FindBin::Bin/../lib $FindBin::Bin/../script/catalyst.pl
TestApp"; Show quoted text
>
Show quoted text
> my $i_lib = $FindBin::Bin . "/../lib";
Show quoted text
> my $catalyst_pl = $FindBin::Bin . "/../script/catalyst.pl";
Show quoted text
>
Show quoted text
> if (system( "perl", "-I$i_lib", $catalyst_pl, "TestApp")) {
Show quoted text
> print STDERR ("\n#Cannot system perl -I$i_lib $catalyst_pl TestApp\n");
Show quoted text
> };
31a39 Show quoted text
>
38a47,51 Show quoted text
>
Show quoted text
> #my $pid = open my $server,
Show quoted text
> #"perl -I$FindBin::Bin/../lib
$FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl -port $port -restart 2>&1 |" Show quoted text
> # or die "Unable to spawn standalone HTTP server: $!";
Show quoted text
>
40c53 < "perl -I$FindBin::Bin/../lib $FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl -port $port -restart 2>&1 |" --- Show quoted text
> "perl -I\"$i_lib\"
\"$FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl\" -port $port -restart 2>&1 |" 44a58 Show quoted text
>
59c73 < open my $pm, '>>', $files[$index] --- Show quoted text
> open my $pm, '>>', "$files[$index]"
72c86 < die "Server appears to have died" if $count++ > 50; --- Show quoted text
> die "Server appears to have died $port" if $count++ > 50;
83,84c97,98 < open my $pm, '>>', $files[$index] < or die "Unable to open $files[$index] for writing: $!"; --- Show quoted text
> open my $pm, '>>', "$files[$index]"
Show quoted text
> or die "Unable to open \"$files[$index]\" for writing: $!";
115d128 < print STDERR "Host $host, port $port\n"; #xxxxxxxxx
From: m.nooning [...] comcast.net
Phooey. I took out the sleep modification. I put it back in and redid the diff (after testing, of course) Show quoted text
>Do all the non-optional tests work fine?
No. See ticket [rt.cpan.org #26452] make test failure in t/c3_mro Can't locate Win32.pm in @INC Show quoted text
>optional and really meant for developers
Outstanding! Here is the diff. ---------------paste diff 7d6 < 29,30c28,37 < system < "perl -I$FindBin::Bin/../lib $FindBin::Bin/../script/catalyst.pl TestApp"; --- Show quoted text
> > #system > # "perl -I$FindBin::Bin/../lib $FindBin::Bin/../script/catalyst.pl
TestApp"; Show quoted text
> > my $i_lib = $FindBin::Bin . "/../lib"; > my $catalyst_pl = $FindBin::Bin . "/../script/catalyst.pl"; > > if (system( "perl", "-I$i_lib", $catalyst_pl, "TestApp")) { > print STDERR ("\n#Cannot system perl -I$i_lib $catalyst_pl TestApp\n"); > };
31a39 Show quoted text
>
38a47,51 Show quoted text
> > #my $pid = open my $server, > #"perl -I$FindBin::Bin/../lib
$FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl -port $port -restart 2>&1 |" Show quoted text
> # or die "Unable to spawn standalone HTTP server: $!"; >
40c53 < "perl -I$FindBin::Bin/../lib $FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl -port $port -restart 2>&1 |" --- Show quoted text
> "perl -I\"$i_lib\"
\"$FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl\" -port $port -restart 2>&1 |" 44a58 Show quoted text
>
59c73 < open my $pm, '>>', $files[$index] --- Show quoted text
> open my $pm, '>>', "$files[$index]"
70,71c84,86 < sleep 0.1; < die "Server appears to have died" if $count++ > 50; --- Show quoted text
> #sleep 0.1; > select(undef, undef, undef, 0.1); > die "Server appears to have died $port" if $count++ > 50;
82,83c97,98 < open my $pm, '>>', $files[$index] < or die "Unable to open $files[$index] for writing: $!"; --- Show quoted text
> open my $pm, '>>', "$files[$index]" > or die "Unable to open \"$files[$index]\" for writing: $!";
---------------end paste diff
Can you resend your patch with the following changes: 1) remove the sections of code you've commented out 2) supply the diff as a unified diff (diff -u) Thank you.
Subject: Re: [rt.cpan.org #26455] Can't open perl script "and": No such file or
Date: Mon, 26 May 2008 11:16:26 -0400
To: bug-Catalyst-Runtime [...] rt.cpan.org
From: Malcolm Nooning <m.nooning [...] comcast.net>
Oh, my. This is over a year old. I have completely moved away from this. I no longer remember the issues, and certainly the code and the patches are long gone. Oh, wait, I remember the issue. Namely, when using the 'system' command on Windows. The problem is that there is usually one or more spaces in the fully qualified path name of things. For example when executing "C:\Program Files\Perl\bin\perl.exe" within the system command, Windows will try to execute "C:\Program", with "Files\Perl\bin\perl.exe" being an arguement to "C:\Program". The correction seems to be simply to insure that double quotes are around the places indicated in my patch. It is probably easier to put all sections of the 'system' command in double quotes than to figure out what does and does not actually need it. An example from the patch is shown below. Show quoted text
> if (system( "perl", "-I$i_lib", $catalyst_pl, "TestApp")) {
Actually, I would now put it around "$catalyst_pl" as well, because a future user may install catalyst in a directory path that has spaces in it! The above holds true for path names in back ticks, and anywhere a file is being opened. That is why the double quotes are around the example below, which I paste from the already shown patch. open my $pm, '>>', "$files[$index]" Thanks for doing this work, by the way. Brian Cassidy via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=26455 > > > Can you resend your patch with the following changes: > > 1) remove the sections of code you've commented out > 2) supply the diff as a unified diff (diff -u) > > Thank you. > >
So, I've reduced the issue down to running the test suite from a dir with spaces in it -- which also fails on linux, FYI. revision 7809 fixes up optional_http-server.t and optional_http-server-restart.t which should satisfy this rt ticket.
Subject: Re: [rt.cpan.org #26455] Resolved: Can't open perl script "and": No such file or
Date: Thu, 29 May 2008 19:01:07 -0400
To: bug-Catalyst-Runtime [...] rt.cpan.org
From: Malcolm Nooning <m.nooning [...] comcast.net>
Looks good to me. Please go ahead and close out this ticket. Brian Cassidy via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=26455 > > > According to our records, your request has been resolved. If you have any > further questions or concerns, please respond to this message. > >