Not too long ago I mentioned on this blog that Alien::Base had reached a milestone, well today I’m announcing that its getting even closer.

Before I get there lets recap. The Alien namespace contains modules which provide external libraries to Perl modules. Alien:: modules typically can detect the presence of a library on your system or if not, install it. Then they can provide the locations and other information to the Perl modules that need them. Alien::Base aims to make these modules easier to write by providing most of this functionality in a configurable way.

Alien::Base, once it has decided that a computer does not have the library, will try to install it. One of my biggest concepts in designing Alien::Base is where it installs the library to. In contrast to attempting to install it to the system-at-large, it puts it in a static data location relative to the Alien:: module in question; it does this via File::ShareDir. Why is this important? Several reasons:

It can be done without root privileges It respects perlbrew/local::lib It doesn’t unexpectedly change your system

For me number 3 is the most important. When installing a Perl module I don’t expect that there will be effects to the system outside of the Perl directory. This does bring a few drawbacks:

Counter to #2 above, each installed Perl will need a separate copy of the library While satisfying the compile-time dependency is easy, satisfying the run-time dependency is hard

Yes #1 can be annoying if a large library is needed for multiple Perls. A workaround would be to manually install the library system-wide (via apt for example). Another that is planned is to add support for the new local::c project which brings local::lib-like functionality for C libraries.

Today’s news is that #2 has been fixed! Alien::Base now accomplishes this by appending to your $ENV{LD_RUN_PATH} just in time to load the library. This will mean a slight change to the mechanism of use of the Alien:: module. The dependent module will now need to explicitly import the Alien:: module.

package Some::Module::UsesMyLibrary; use strict; use warnings; # this line now required for Alien::Base based modules use Alien::MyLibrary; require XSLoader; XSLoader::load(); # your code 1;

In the past Alien:: modules have relied on system-installation, static libraries or rpath to do this work, but this mechanism seems to be simple and effective.

This was the last big hurdle to Alien::Base, so now I can (pretty) safely say, “Alien::Base is coming!” I had hoped to announce this when I first released Alien::Base, but some other functionality if taking longer than anticipated.

I expect a pre-alpha release to come soon, perhaps even this week. When I see that CPANtesters approves, I will then release the alpha version, at which point I will make a call for libraries which need wrapping, so keep that in mind; start thinking of those unwritten Alien:: modules you have always wished for; Alien::Base is going to empower YOU to create them!