hep has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I've recently started to do some perl development, mostly scripts to automate some tasks on servers, as servers don't have access to Internet and some scripts use a handful of CPAN modules I started to deploy them as compiled binaries using pp from PAR::Packer.

I was working on Debian wheezy without problem, but I just changed to jessie, problem is that now everything I compiled on my machine won't run on servers because they are linked to glibc 2.16 and servers (redhat 5 and centos 6 boxes) have glibc 2.14.

I did read the warning from PAR to not use bleeding edge OS, but I think I didn't understand what they meant until now... Anyways, is there a way to compile perl code using pp or other similar tool but linking to lower version of system's glibc. Right now I am running a virtual machine with older debian and compile everything there but it is kinda slow.

P.S.: Maybe my approach is all wrong, so suggestions on what else would be a good idea to run perl scripts on servers without all the hassle of installing cpan modules (no internet access from servers) and their dependencies are welcome...

Thanks!

UPDATE: Thanks for your replies, I probably will try to use CPAN with local install in the near future. In the mean while tried to compile another version of GLIBC but I failed miserably, I could found a workaround using debootstrap to install squeeze and then chroot to it, and compile from the chroot, maybe is not ideal but is faster than running a full virtual machine. Regards!!!

  • Comment on PAR::Packer link to lower glibc version

Replies are listed 'Best First'.
Re: PAR::Packer link to lower glibc version
by Anonymous Monk on Sep 11, 2013 at 07:46 UTC

    Right now I am running a virtual machine with older debian and compile everything there but it is kinda slow.

    This is probably the simplest and easiest solution :)

    But, apparently you can have multiple version on glibc on the same machine by managing LD_LIBRARY_PATH

    The Answer Guy 48: Multiple Concurrently Installed Version of glibc

    So you'd have to install old version of glibc on your dev-machine ( 200+ pieces of it ), recompile perl/PAR::Packer and any other modules you need to use this older version of glibc ....

    Either way its path management....:)

Re: PAR::Packer link to lower glibc version
by scorpio17 (Canon) on Sep 11, 2013 at 13:22 UTC
    I also have to manage Perl scripts that get run on a variety of servers with various OS's (but they're all unix). I copy the actual perl script to each server. For CPAN modules, I use the "install local" option on one server, then I tar up that lib directory, and copy it to the others. Set the PERL5LIB env var to the path of this lib so that perl can find it. For modules that have binary parts and/or require compiling etc., I'd recommend building on the oldest OS, and copying out from there. I would only use PAR::Packer if I needed to deploy to a Windose box for some reason. Don't install modules as root, since you might accidentally break your system perl (or change the behavior of scripts used by the OS). If I need to change something, I test on one machine, then push out the new version to the other s using rsync.
Re: PAR::Packer link to lower glibc version
by keszler (Priest) on Sep 11, 2013 at 13:48 UTC
    Another option is to set up your own local CPAN. See CPAN::Mini and Pinto for info.