[Catalyst] Catalyst 5.90010 server must be in CWD to run?

Louis Erickson lerickson at rdwarf.net
Mon Feb 20 21:25:00 GMT 2012


Yes, I'm talking to myself.  It's that kind of day.

The Changes file lists changes to Catalyst::Utils::home in 5.90009, and then an update in 5.9.0010 to make it work better.  The change is to "find if the application is a checkout in Catalyst::ScriptRunner."  Not sure what "checkout" means there, but it's clearly changed how this works.

In 5.90010, the call to Catalyst::Utils::home() is returning undef when the working directory is MyApp/script, and data when it is MyApp.  Haven't debugged into C::U::home() yet, to see if I can tell what the difference is.  Not sure what the goal of the change was yet.

On Feb 20, 2012, at 11:00 AM, Louis Erickson wrote:

> 
> The call to:
> 
> lib->import(File::Spec->catdir($FindBin::Bin, '..', 'lib'));
> 
> on line 37 of Catalyst::ScriptRunner::run has been removed.
> 
> So, I'd think this is deliberate.  It will also affect all the scripts.  What is this going to do to myapp_fastcgi, when the webserver doesn't set the WD as expected?
> 
> On Feb 20, 2012, at 10:52 AM, Louis Erickson wrote:
> 
>> I noticed a changed behavior in Catalyst, and wondered if it was deliberate.
>> 
>> I have some Catalyst apps running on the system Perl, which has a slightly older Catalyst installed.  It's 5.90007.
>> 
>> In that version, I can execute myapp_server from the scripts directory:
>> 
>> wwonko at holly:~/projects/MyApp/script $ ./myapp_server.pl 
>> [debug] Debug messages enabled
>> [debug] Statistics enabled
>> [debug] Loaded plugins:
>> .----------------------------------------------------------------------------.
>> | Catalyst::Plugin::ConfigLoader  0.30                                       |
>> '----------------------------------------------------------------------------'
>>> ... lots more snipped, the app works fine ...
>> 
>> I noticed that with 5.9.0010, installed via perlbrew, I get load failures:
>> 
>> wwonko at holly:~/projects/MyApp/script $ perlbrew switch perl-5.14.2
>> wwonko at holly:~/projects/MyApp/script $ ./myapp_server.pl 
>> Can't locate MyApp.pm in @INC (@INC contains: /home/web/www.rdwarf.com/users/wwonko/TopazLib-v1.00.00/lib/site_perl/5.14.2//i686-linux /home/web/www.rdwarf.com/users/wwonko/TopazLib-v1.00.00/lib/site_perl/5.14.2/ /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/i686-linux /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2 /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/i686-linux /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2 .) at /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Module/Runtime.pm line 317.
>> at /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Catalyst/Script/Server.pm line 239
>> 
>> 
>> Both run properly if I run the script from the MyApp directory:
>> 
>> wwonko at holly:~/projects/MyApp $ script/myapp_server.pl 
>> [debug] Debug messages enabled
>> [debug] Statistics enabled
>> [debug] Loaded plugins:
>> .----------------------------------------------------------------------------.
>> | Catalyst::Plugin::ConfigLoader  0.30                                       |
>> '----------------------------------------------------------------------------'
>>> ... lots more snipped, the app works fine ...
>> 
>> Looking at @INC, it's clear that Catalyst no longer adds "$basename/../inc" to the path - I haven't dug into the code to find where the change was.
>> 
>> Is this a deliberate change?  Is there a reason for it?  Or is it an unexpected change?
>> 
>> I know all the help and samples have people run "script/myapp_server.pl", but I never do; I run it from the script directory.  I'm also concerned that having to be in the right CWD will allow loading of unexpected modules, rather than being based on the app's location, as I'd expect.
>> 
>> Anyone know what's going on?
>> _______________________________________________
>> List: Catalyst at lists.scsys.co.uk
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
>> Dev site: http://dev.catalyst.perl.org/
> 
> 
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/




More information about the Catalyst mailing list