Edited Goal, again: I want to have what Strawberry Perl's portable install does, but for Linux. And after that, for Mac OS X.

Edited Goal: I want to package a portable perl with my app without needing to have a seperate build for every Linux distro.

Goal: I want to provide a portable perl binary for Linux.

I know 99.99999% of all distros have perl pre-installed, but I need a specific version (not due to the perl code itself) and need to specifically not rely (and specifically not use) any local installed perl, modules, shared libraries, etc (or at least as much as possible).

I built a custom C app that embeds perl and adjusts some important details (sets @INC, loads/runs a bootstrap perl module, etc). This will then run separate perl files stored in specific locations on the local system.

If I can get away with not embedding perl into a custom C wrapper (that's what the C code really is) at all and just using the perl binary as supplied by Debian or otherwise, I'd be happy with it.

This app will run for the entire time the machine is on. It will only be restarted on upgrade of the app and when the machine is rebooted. I will take care of the startup separately on a per-distro-method basis. It will also run on Windows >= 2000 and Mac OS X >= 10.4, but I don't need to worry about them with this.

I really wanted a statically linked perl, but it seems to be a bad idea (XS, etc problems). I'm okay with distributing some .so files as needed (and stored in a dir along with the app itself).

  1. Does such a portable perl (or something similar) already exist?
  2. Am I an idiot for trying this? (I'm willing to back up my reasons, but am rather open-minded too)
  3. Are there some gotchas that are going to kill me in the long run (except for having to maintain my own perl)?

Example problem I'm having going the "usual" way: I compile my C + embedded perl on a Debian Lenny x86-64 box. I copy it over to my Fedora 11 x86-64 box. It fails to load libperl.so.5.10. I would like to supply this .so so it will succeed.

I really don't want to compile this on every Linux distro and version. I'm already prepared to compile once for each separate architecture (x86 and x86-64 right now, probably PPC and ARM later).

I've heard about the LD_LIBRARY_PATH ENV variable, which I assume I will have to use for this to work correctly. I can not make system-wide modifications to any config files or install any .so files (or anything else). It is important that this app is as stand-alone as possible, does not rely on the local system, does not use the libraries, modules, etc of the local system, and does not modify the local system.

Environment Embedding Executable seems that it would be great for the packaging part.

I need wisdom. Thanks in advance for whatever you can offer.


I'm a Linux user. You wouldn't know it since I mostly ask Windows questions. Whee.
If you want to do evil, science provides the most powerful weapons to do evil; but equally, if you want to do good, science puts into your hands the most powerful tools to do so.
- Richard Dawkins

In reply to Linux-version of Strawberry Perl's portable install (was: Portable Perl?) by wilsond

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.