[Catalyst] Re: A few questions (possibly a FAQ)

Matt S Trout dbix-class at trout.me.uk
Tue Dec 20 17:17:28 CET 2005


On Tue, Dec 20, 2005 at 09:20:06AM -0500, Joe Landman wrote:
> We start our by building Perl the way we need it with the right options 
> compiled in for our needs.  We have tried leveraging the existing 
> distribution Perl's only to find that some modules we need do not 
> compile properly against them.  They are never the same set of modules 
> which fail to compile (all CPAN modules BTW).

Welcome to vendor perl dists. The source distros (and of course the BSDs)
tend to produce better behaved stuff but I've often ended up shipping a
custom perl to clients for remarkably simple things.
 
> It would be functionally similar to a perl build with the bunch of 
> modules, though we have found that in some distributions when we replace 
> Perl with a repaired RPM that various core services stop functioning. 
> So we decided upon a separate tree.

Oh, hang on, RPM-based distros? Yeah. Separate perl. Always.

> Our build is pretty straightforward.  Uses a make file to automate 
> things and track dependencies.  If we can get the normal Perl build to 
> do this, that would be great.  It wasn't clear to me how, if we included 
> Task::Catalyst in one of the modules, that it would be able to first 
> find, and then second pull down all the dependant bits.

during the 'sh Configure' process you get asked if you want to pull extra
stuff via CPAN. Say yes, give it Task::Catalyst and in config.sh you get

extras='Task::Catalyst'

which translates into an EXTRAS entry in the Makefile

>   If it does 
> this, please do point me to the FAQ (I would appreciate the 
> clue-by-four) that I missed.  My understanding is that we still have to 
> pull down all the dependencies by hand.  If there is a better way, 
> really, I am all ears!

The final target under 'all' is extras.make, and the final target under
'install.perl' is extras.install, which are -

extras.make: perl$(EXE_EXT)
        - at test -s extras.lst && PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst`

extras.test: perl$(EXE_EXT)
        - at test -s extras.lst && PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst`

extras.install: perl$(EXE_EXT)
        - at test -s extras.lst && PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`

so the modules are CPAN'ed in and built at 'make' time and will be installed
along with everything else, which should be enough to make the various
install watchers happy.

> Using the CPAN mechanism would be great, though 
> my customers sometimes don't have access to CPAN, and shipping a 3 GB 
> tarball is considered bad form.

My minicpan is only around half a gig, so its amenable to stuffing on a CD
at least :)

I use a shell script to grab it rather than the original minicpan, although
the shell script does currently invoke perl in a couple of places (could
easily be replaced with sed, mind) - this allows me to yank my entire set
of updates with a single rsync rather than minicpan's umpteen LWP calls.

> Actually, if there was a way to do
> 
> 	perl -MCPAN -e 'install 
> Task::Catalyst::with:all::the::nice::plugins::like::sessions::and::authentication' 
> -p /path/to/install/tree
> 
> this would be very helpful... :)

http://dev.catalyst.perl.org/wiki/SolvedIssues#si.70

while oriented round installing to a ~ directory has worked very well for me
on a number of occasions; the approach should be easy enough to adapt.

> If there was a Bundle::Catalyst::Minimal which gave a minimal (baseline) 
> Catalyst, a Bundle::Catalyst::Plugins::Sessions, a 
> Bundle::Catalyst::Plugins::Authentication, ...  this might make life 
> that much easier ...  (s/Bundle/Task/g)

Probably a good idea; do the maintainers of the respective module collections
fancy putting together Task packages for them?

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list