Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Building perl for appliances

by tsee (Curate)
on Nov 20, 2009 at 13:55 UTC ( #808437=note: print w/ replies, xml ) Need Help??


in reply to Building perl for appliances

Let me start with answering question (2). You say that if you want to include package Foo in your distribution and Foo depends on Bar1, Bar2, Bar3, then you don't actually want to include Bar* in your distribution as well ("certainly don't want them all")? That doesn't make any sense to me. Foo declared the dependency with a reason. But maybe I'm misunderstanding you.
In Perl, there is essentially three types of library directories: core-, vendor-, and site lib. They are intended for use by the perl core, the vendor and the site admininstrator respectively. Since you intend to create a binary package of perl, you're the vendor. I suggest you use "cpan" to install your custom packages into the vendor directory and ship them as part of the package.

On some level, I actually like the idea of including extra packages in the base perl distro and then compiling them as part of the core installation. There's a couple of things that can cause trouble with this:

  • It's manual and thus tedious and error prone. In current stable perl releases, there's a bunch of magic scripts and MANIFEST that need updating with the extra files.
  • The module sources (Makefile.PL/Build.PL) may need tweaking so they don't install into the vendor library directories.
  • You have to be careful not to ship such a beast as "perl 5.10.1" because it's not. It's perl 5.10.1 PLUS your libraries. While I'm nitpicking a little, neglecting such distinctions has the potential to cause a lot pain.

In the current development branch of perl, the directory structure has been reorganized to make maintenance of the modules that live both in core and on CPAN easier. Where there used to be a giant lib/ directory and an ext/ directory for XS modules, there is now:

  • lib with the few modules that are needed super-early in the build process.
  • ext with subdirectories each containing a CPAN-distribution like setup of really-tied-to-perl-core modules
  • dist with all the modules that live primarily in core but have a CPAN version published. (Changes go to perl core first and get pushed out to CPAN as appropriate.)
  • cpan with all the modules that are maintained primarily on CPAN and that are simply updated in core

ext, dist, and cpan are organized in subdirectories which mimick an extracted CPAN tarball as closely as possible (usually ignoring the Makefile.PL). Lots of hardcoded information has been eliminated and missing Makefile.PL's are usually auto-generated. Just extracting a CPAN distribution is not likely to just work yet but the amount of fuzzing to get it included should be pretty low nowadays. Note that there is no stable release of perl that features this reorganization. You can experiment with the recent 5.11.X development releases.

Cheers
Steffen


Comment on Re: Building perl for appliances

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://808437]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-10-23 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (122 votes), past polls