Dear MakeMaker team and Nick,

executive summary of what I try to explain below: MakeMaker documentation should be updated to say that a path specified with PREFIX= etc. must be an absolute path or a ~/expansion but NOT an arbitrary relative path. Modules that use AutoLoader are not installed correctly when PREFIX= is a relative path such as ../sibling

Feel free to read on. The module I was trying to install that drove me nuts about this is CGI::Session, so if you want to grab a copy and try it yourself, the following procedure demonstrates the problem.

/home/jonathan# mkdir myperl
/home/jonathan# gunzip -c CGI-Session-3.95.tar.gz | tar -xf -
/home/jonathan# cd CGI-Session-3.95
/home/jonathan/CGI-Session-3.95# perl Makefile.PL PREFIX=../myperl
/home/jonathan/CGI-Session-3.95# make
/home/jonathan/CGI-Session-3.95# make install
(note where it is trying to install the .al files)
/home/jonathan/CGI-Session-3.95# ls ../myperl/lib/perl5/site_perl/auto
(note they are not there)
/home/jonathan/CGI-Session-3.95# mkdir ../myperl/lib/perl5/site_perl/auto
/home/jonathan/CGI-Session-3.95# make install
(note the double-relative path in the output here and that they are still not there)
/home/jonathan/CGI-Session-3.95# make realclean
/home/jonathan/CGI-Session-3.95# perl Makefile.PL PREFIX=/home/jonathan/myperl
/home/jonathan/CGI-Session-3.95# make
/home/jonathan/CGI-Session-3.95# make install
(note where it is trying to install the .al files -- same place)
(but note that this time they have been properly installed)



.

.

.

I ran into a problem while trying to install a module that uses AutoLoader and I found the workaround but I wasn't sure if it's a real issue or if I was just interpreting the documentation incorrectly.

The MakeMaker documentation, in the "PREFIX and LIB attribute" section, says:

=== start quote ==
PREFIX and LIB can be used to set several INSTALL* attributes in one go. The quickest way to install a module in a non-standard place might be
perl Makefile.PL PREFIX=~


This will install all files in the module under your home directory, with man pages and libraries going into an appropriate place (usually ~/man and ~/lib).

Another way to specify many INSTALL directories with a single parameter is LIB.
perl Makefile.PL LIB=~/lib


This will install the module's architecture-independent files into ~/lib, the architecture-dependent files into ~/lib/$archname.

Note, that in both cases the tilde expansion is done by MakeMaker, not by perl by default, nor by make.
=== end quote ===



And that makes me think that I could do something like this:

perl Makefile.PL  PREFIX=../some/relative/path

But in fact when I install the module, the AutoSplit files are not installed properly.

They SHOULD be installed in ../some/relative/path/lib/perl5/site_perl/auto/ but the auto/ directory is not even created there.
If I create it myself, the perl module tree is still not created under auto/ and the autoload files are still not installed. In fact, in the "Installing ..." part when I type "make install" , if I create the auto/ directory myself, I see it tries to use the relative path TWICE, like this:


Installing ../some/relative/path/lib/perl5/site_perl/auto/lib/Module/some/ relative/path/lib/perl5/site_perl/auto/Module/...

However,  if I specify the absolute path to the same directory:

perl Makefile.PL PREFIX=/home/jonathan/some/relative/path

Then everything is installed just fine, and I see the .al files installed in /home/jonathan/some/relative/path/lib/perl5/site_perl/auto/ just like I expect.


Conclusion:

The easiest thing to do would be to update your documentation for MakeMaker to say that the ~ expansion is a special case and that arbitrary relative paths are NOT handled correctly, and that if the prefix doesn't start with ~ then it must be given as an absolute path because a relative one will not install AutoLoader/AutoSplit files correctly (but it may work ok for modules that don't use AutoLoader).



Respectfully,

Jonathan Buhacoff



Reply via email to