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

Been a while...

I'm trying to install DBIx::Class::AuditLog. I want it to be available system-wide, so I'm using CPAN or cpanm as root on my CentOS 7 box to install it. Other modules installed system-wide, as expected, but D:C:AL (and it alone) seems to go to root's home directory, and I'm not sure why: Here's what I tried:

cpan[7]> install DBIx::Class::AuditLog Running install for module 'DBIx::Class::AuditLog' Running make for I/IO/IONCACHE/DBIx-Class-AuditLog-0.6.2.tar.gz Fetching with LWP: http://cpan.ulak.net.tr/authors/id/I/IO/IONCACHE/DBIx-Class-AuditLog-0 +.6.2.tar.gz Fetching with LWP: http://cpan.ulak.net.tr/authors/id/I/IO/IONCACHE/CHECKSUMS Checksum for /root/.cpan/sources/authors/id/I/IO/IONCACHE/DBIx-Class-A +uditLog-0.6.2.tar.gz ok Scanning cache /root/.cpan/build for sizes DONE CPAN.pm: Building I/IO/IONCACHE/DBIx-Class-AuditLog-0.6.2.tar.gz Created MYMETA.yml and MYMETA.json Creating new 'Build' script for 'DBIx-Class-AuditLog' version '0.6.2' Building DBIx-Class-AuditLog IONCACHE/DBIx-Class-AuditLog-0.6.2.tar.gz ./Build -- OK Running Build test t/001_deploy.t ....................... ok t/002_cud.t .......................... ok t/003_get_changes.t .................. ok t/004_force_auditlog.t ............... ok t/005_modify_audit_value.t ........... ok t/006_resultsets-default_rs_class.t .. ok t/007_resultset-loadcomponent.t ...... ok t/008_relationships.t ................ ok t/009_recursive-update.t ............. ok t/010_bug_undef_columns_logged.t ..... ok t/011_update_on_deleted_row.t ........ ok t/012_cud_view.t ..................... ok t/release-pod-syntax.t ............... skipped: these tests are for re +lease candidate testing All tests successful. Files=13, Tests=76, 12 wallclock secs ( 0.09 usr 0.02 sys + 9.94 cus +r 0.73 csys = 10.78 CPU) Result: PASS IONCACHE/DBIx-Class-AuditLog-0.6.2.tar.gz ./Build test -- OK Running Build install Building DBIx-Class-AuditLog Installing /root/perl5/lib/perl5/DBIx/Class/AuditLog.pm Installing /root/perl5/lib/perl5/DBIx/Class/Schema/AuditLog.pm Installing /root/perl5/lib/perl5/DBIx/Class/Schema/AuditLog/Structure. +pm Installing /root/perl5/lib/perl5/DBIx/Class/Schema/AuditLog/Structure/ +AuditedTable.pm Installing /root/perl5/lib/perl5/DBIx/Class/Schema/AuditLog/Structure/ +Field.pm Installing /root/perl5/lib/perl5/DBIx/Class/Schema/AuditLog/Structure/ +Base.pm Installing /root/perl5/lib/perl5/DBIx/Class/Schema/AuditLog/Structure/ +Action.pm Installing /root/perl5/lib/perl5/DBIx/Class/Schema/AuditLog/Structure/ +Change.pm Installing /root/perl5/lib/perl5/DBIx/Class/Schema/AuditLog/Structure/ +Changeset.pm Installing /root/perl5/lib/perl5/DBIx/Class/Schema/AuditLog/Structure/ +User.pm Installing /root/perl5/lib/perl5/DBIx/Class/Schema/AuditLog/Structure/ +View.pm Installing /root/perl5/lib/perl5/DBIx/Class/ResultSet/AuditLog.pm Installing /root/perl5/man/man3/DBIx::Class::Schema::AuditLog::Structu +re::View.3pm Installing /root/perl5/man/man3/DBIx::Class::Schema::AuditLog::Structu +re::User.3pm Installing /root/perl5/man/man3/DBIx::Class::Schema::AuditLog::Structu +re::Action.3pm Installing /root/perl5/man/man3/DBIx::Class::ResultSet::AuditLog.3pm Installing /root/perl5/man/man3/DBIx::Class::Schema::AuditLog::Structu +re::Change.3pm Installing /root/perl5/man/man3/DBIx::Class::Schema::AuditLog::Structu +re::Base.3pm Installing /root/perl5/man/man3/DBIx::Class::Schema::AuditLog::Structu +re.3pm Installing /root/perl5/man/man3/DBIx::Class::Schema::AuditLog.3pm Installing /root/perl5/man/man3/DBIx::Class::Schema::AuditLog::Structu +re::AuditedTable.3pm Installing /root/perl5/man/man3/DBIx::Class::Schema::AuditLog::Structu +re::Field.3pm Installing /root/perl5/man/man3/DBIx::Class::Schema::AuditLog::Structu +re::Changeset.3pm Installing /root/perl5/man/man3/DBIx::Class::AuditLog.3pm IONCACHE/DBIx-Class-AuditLog-0.6.2.tar.gz ./Build install -- OK

Can I simply move the files out of ~/perl5 into /usr/local/share/perl5/ (where other modules have happily installed)? I've completely blown away .cpan and tried again, and tried cpanm, so this problem seems specific to the module. Any ideas?


davis

  • Comment on Forcing DBIx::Class::AuditLog to install to the System perl's path
  • Download Code

Replies are listed 'Best First'.
Re: Forcing DBIx::Class::AuditLog to install to the System perl's path
by MidLifeXis (Monsignor) on Aug 03, 2015 at 12:20 UTC

    System perl is for the system utilities. Install the module using the system packaging tools or install your own perl for your apps. By decoupling your applications from the system perl you avoid two major (imo) risks: 1) breaking the system perl with an upgrade to a module the system cannot handle, or 2) a system upgrade breaking your applications. Install your own perl as part of the application stack.

    --MidLifeXis

Re: Forcing DBIx::Class::AuditLog to install to the System perl's path
by Leon Timmermans (Acolyte) on Aug 05, 2015 at 11:21 UTC
    Do you happen to have a .modulebuildrc file laying around, for example from an old local::lib setup? That could explain what you're seeing here.
Re: Forcing DBIx::Class::AuditLog to install to the System perl's path
by Anonymous Monk on Aug 03, 2015 at 11:57 UTC

    I don't have experience with that module specifically, but this is the general approach that tends to work for a lot of different modules: Try installing it manually according to "Manual installation" in the documentation. Stay logged in as root, and specify the absolute path to the system Perl in the first command, e.g. /usr/bin/perl Build.PL

Re: Forcing DBIx::Class::AuditLog to install to the System perl's path
by Anonymous Monk on Aug 03, 2015 at 15:11 UTC
    You run the serious risk of breaking something that you never dreamed of breaking, if you do that. Install into a private library such as /usr/local/lib and append this to PERL5LIB. Or, if you are feeling really ambitious, build a Perl that includes it in @LIB.