Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Dedicated monks!

I'm in search of wisdom regarding perlbrew, specifically about controlling where perlbrew installs architecture-specific (i.e. compiled) modules.

I have installed perlbrew in standard fashion, used it to install a few versions of perl, and then installed some modules. But my architecture-specific files are going to a common tree, leading to this type of error:

$ which perl /home/jroth/perl5/perlbrew/perls/perl-5.16.3/bin/perl perl -M JSON::XS -e 1 Perl API version v5.14.0 of JSON::XS does not match v5.16.0 at /home/j +roth/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/XSLoader.pm line 92. Compilation failed in require. BEGIN failed--compilation aborted.
Where did JSON::XS get installed?
find /home/jroth/perl5 -name XS.pm | grep JSON /home/jroth/perl5/lib/perl5/x86_64-linux/JSON/XS.pm
A shared directory! And where is my current perl looking for modules?
perl -E 'say join $/, @INC' /home/jroth/perl5/lib/perl5/x86_64-linux-gnu-thread-multi /home/jroth/perl5/lib/perl5/x86_64-linux /home/jroth/perl5/lib/perl5 /home/jroth/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/x86_ +64-linux /home/jroth/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3 /home/jroth/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/x86_64-linux /home/jroth/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3
Does my environment have anything to do with this?
env | grep -i perl5lib PERL5LIB=/home/jroth/perl5/lib/perl5/x86_64-linux-gnu-thread-multi:/ho +me/jroth/perl5/lib/perl5
Did I do that?
grep -i perl5lib ~/.bashrc ~/.bash_profile (n/t)
It appears I have two problems:

1. Under perlbrew, CPAN clients install architecture-specific files in a common tree, i.e.

/home/jroth/perl5/lib/perl5/x86_64-linux-gnu-thread-multi /home/jroth/perl5/lib/perl5/x86_64-linux
even though these compiled files are most certainly incompatible across perl versions.

2. Under perlbrew, perl looks for architecture-specific files in a common tree, even though there are appropriate directories specific to each version of perl, i.e. one of

/home/jroth/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/x86_ +64-linux /home/jroth/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3 /home/jroth/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/x86_64-linux /home/jroth/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3
My questions are then, how to to set the preferences for a CPAN client under perlbrew to install to the latter set of directories (whether arguments, environment settings or patches?)

And similarly, to remove the former architecture-specific-shared directories from the PERL5LIB environment variable.

I'm confused that with perlbrew being around so long and having such a good reputation, no else seems to have this fundamental complaint and no bug has been filed against perlbrew on this issue.

Well there is a question at stackoverflow How can Install multiple Perl versions without them tripping over each other's XS modules? although the only answer is brian d foy's "don't use perlbrew, give each perl binary a version, i.e. perl-5.16.3 and let them find their own installed modules".

And there is Kent NL's post, although I didn't find it helpful, as cpanm clients continued installed to the shared tree, even after installing cpanm for each perl version.

Thanks for your interest and support!

UPDATE: For reasons unclear, my PERL5LIB environment variable is no longer set, and perlbrew is now behaving properly. I think it's possible that one of the terminals I was working had retained environment settings from local::lib, even after I had cleaned out those settings from .bashrc.

UPDATE 2: I've filed a bug against perlbrew, suggesting a warning on detecting any non-null PERL5LIB setting.


In reply to Architecture-specific module conflicts under perlbrew by gnosti

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-04-19 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found