Installing CPAN libraries with the system Perl is broken

I’ve tested this on a few, fully up-to-date Rocky 8 machines. The system perl:
Installed Packages
Name : perl
Epoch : 4
Version : 5.26.3
Release : 422.el8
Architecture : x86_64
Size : 0.0
Source : perl-5.26.3-422.el8.src.rpm

Won’t build any of the CPAN libraries I’m trying to install. I had to install some dependencies to get to the point I could test this:

dnf -y install perl-App-cpanminus perl-LWP-Protocol-https

After those packages were installed, I drop super-user privileges, as I’m trying to run this as an unprivileged user, leveraging the perl “local::lib” stuff that cpanm says it will use automatically.

cpanm ExtUtils::Config

which fails.
If I go into the build dir as indicated in the logs and try by hand:
make clean
perl Makefile.PL
make
make test

the make test fails, as the it can’t find the .pm files:
more /uufs/chpc.utah.edu/common/home/u0064824/.cpanm/work/1746052039.105352/build.log
cpanm (App::cpanminus) 1.7044 on perl 5.026003 built for x86_64-linux-thread-multi
Work directory is /uufs/chpc.utah.edu/common/home/u0064824/.cpanm/work/1746052039.105352
You have make /bin/make
You have LWP 6.34
You have /bin/tar: tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /bin/unzip
Searching ExtUtils::Config () on cpanmetadb …
→ Working on ExtUtils::Config
Fetching https://www.cpan.org/authors/id/L/LE/LEONT/ExtUtils-Config-0.010.tar.gz
→ OK
Unpacking ExtUtils-Config-0.010.tar.gz
Entering ExtUtils-Config-0.010
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 … Yes (7.34)
Configuring ExtUtils-Config-0.010
Running Makefile.PL
Checking if your kit is complete…
Looks good
Generating a Unix-style Makefile
Writing Makefile for ExtUtils::Config
Writing MYMETA.yml and MYMETA.json
→ OK
Checking dependencies from MYMETA.json …
Checking if you have Test::More 0.88 … Yes (1.302135)
Checking if you have File::Spec 0 … Yes (3.74)
Checking if you have IPC::Open3 0 … Yes (1.20)
Checking if you have Data::Dumper 0 … Yes (2.167)
Checking if you have warnings 0 … Yes (1.37)
Checking if you have strict 0 … Yes (1.11)
Checking if you have IO::Handle 0 … Yes (1.36)
Checking if you have ExtUtils::MakeMaker 0 … Yes (7.34)
Checking if you have ExtUtils::MakeMaker::Config 0 … Yes (7.34)
Building and testing ExtUtils-Config-0.010
PERL_DL_NONLAZY=1 “/usr/bin/perl” “-MExtUtils::Command::MM” “-MTest::Harness” “-e” "undef Test::Harness::Switches; test_harness(0, ‘blib/lib’, ‘blib/arch’)" t/.t

Failed test ‘ExtUtils/Config.pm loaded ok’

at t/00-compile.t line 44.

got: ‘512’

expected: ‘0’

Can’t locate ExtUtils/Config.pm in @INC (you may need to install the ExtUtils::Config module) (@INC contains: /uufs/chpc.utah.edu/common/home/u0064824/.cpanm/work/1746052039.105352/ExtUtils-Config-0.010/blib/arch /uufs/chpc.utah.edu/common/hom
e/u0064824/.cpanm/work/1746052039.105352/ExtUtils-Config-0.010/blib/lib /uufs/chpc.utah.edu/common/home/u0064824/.cpanm/work/1746052039.105352/ExtUtils-Config-0.010/blib/lib /uufs/chpc.utah.edu/common/home/u0064824/.cpanm/work/1746052039.10535
2/ExtUtils-Config-0.010/blib/arch /uufs/chpc.utah.edu/common/home/u0064824/perl5/lib/perl5/5.26.3/x86_64-linux-thread-multi /uufs/chpc.utah.edu/common/home/u0064824/perl5/lib/perl5/5.26.3/x86_64-linux-thread-multi /uufs/chpc.utah.edu/common/ho
me/u0064824/perl5/lib/perl5/5.26.3 /uufs/chpc.utah.edu/common/home/u0064824/perl5/lib/perl5/x86_64-linux-thread-multi /uufs/chpc.utah.edu/common/home/u0064824/perl5/lib/perl5/5.26.3/x86_64-linux-thread-multi /uufs/chpc.utah.edu/common/home/u00
64824/perl5/lib/perl5/5.26.3 /uufs/chpc.utah.edu/common/home/u0064824/perl5/lib/perl5/x86_64-linux-thread-multi /uufs/chpc.utah.edu/common/home/u0064824/perl5/lib/perl5 /uufs/chpc.utah.edu/common/home/u0064824/perl5/lib/perl5/5.26.3/x86_64-lin
ux-thread-multi /uufs/chpc.utah.edu/common/home/u0064824/perl5/lib/perl5/5.26.3 /uufs/chpc.utah.edu/common/home/u0064824/perl5/lib/perl5/x86_64-linux-thread-multi /uufs/chpc.utah.edu/common/home/u0064824/perl5/lib/perl5 /usr/local/lib64/perl5
/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at -e line 1.

I thought this was just something I’d messed up, but after trying it on three machines now, I’m not so sure.

Steve Harper

An additional data point - common to all these machines my home directory is shared from a central NFS server, which is where local::lib is writing these files. I thought to test this with another account that was using a local home directory and the problem went away. This is an enterprise grade NFS server from vastdata, that we are using in production with lots of clients, so I a bit perplexed that this is (apparently) the only thing we are having problems with months after having deployed it.

Welcome to the forums.

It indeed builds fine when on a local disk rather than NFS.

[label@cm01 ~]$ cpanm ExtUtils::Config
!
! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/label/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!         cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
--> Working on ExtUtils::Config
Fetching https://www.cpan.org/authors/id/L/LE/LEONT/ExtUtils-Config-0.010.tar.gz ... OK
Configuring ExtUtils-Config-0.010 ... OK
Building and testing ExtUtils-Config-0.010 ... OK
Successfully installed ExtUtils-Config-0.010
1 distribution installed

[label@cm01 ~]$ find perl5/
perl5/
perl5/bin
perl5/lib
perl5/lib/perl5
perl5/lib/perl5/x86_64-linux-thread-multi
perl5/lib/perl5/x86_64-linux-thread-multi/auto
perl5/lib/perl5/x86_64-linux-thread-multi/auto/ExtUtils
perl5/lib/perl5/x86_64-linux-thread-multi/auto/ExtUtils/Config
perl5/lib/perl5/x86_64-linux-thread-multi/auto/ExtUtils/Config/.packlist
perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
perl5/lib/perl5/x86_64-linux-thread-multi/.meta
perl5/lib/perl5/x86_64-linux-thread-multi/.meta/ExtUtils-Config-0.010
perl5/lib/perl5/x86_64-linux-thread-multi/.meta/ExtUtils-Config-0.010/install.json
perl5/lib/perl5/x86_64-linux-thread-multi/.meta/ExtUtils-Config-0.010/MYMETA.json
perl5/lib/perl5/5.26.3
perl5/lib/perl5/5.26.3/x86_64-linux-thread-multi
perl5/lib/perl5/ExtUtils
perl5/lib/perl5/ExtUtils/Config
perl5/lib/perl5/ExtUtils/Config/MakeMaker.pm
perl5/lib/perl5/ExtUtils/Config.pm
perl5/man
perl5/man/man3
perl5/man/man3/ExtUtils::Config.3pm
perl5/man/man3/ExtUtils::Config::MakeMaker.3pm

If the issue is that it is failing in an NFS directory, I would start looking at various logs to see if something comes up to tell you what lead up to the problem (/var/log/audit.log, /var/log/messages, dmesg).

So to see if my problem is the Vast NFS server or NFS servers in general, I set up a simple NFS server on my workstation modified the exports to share with just the one rocky 8 client, and mounted the nfs share on the client. Then I copied over the home directory, made sure the permissions were good, removed the “perl5” and “.cpanm” directories, and updated the home directory to the NFS one in /etc/passwd and reran the test as that user. That worked without any problems. Rerunning the test with a user with a homedir on the Vast, still broken.

I’ll check /var/log/audit.log, etc.

Steve Harper

cpanm ExtUtils::Config
→ Working on ExtUtils::Config
Fetching https://www.cpan.org/authors/id/L/LE/LEONT/ExtUtils-Config-0.010.tar.gz … OK
Configuring ExtUtils-Config-0.010 … OK
Building and testing ExtUtils-Config-0.010 … FAIL
! Installing ExtUtils::Config failed. See /uufs/chpc.utah.edu/common/home/u0065624/.cpanm/work/1746114995.131991/build.log for details. Retry with --force to force install it.
[u0065624@test-rocky8 ~]$ find perl5
perl5
perl5/bin
perl5/lib
perl5/lib/perl5
perl5/lib/perl5/5.26.3
perl5/lib/perl5/5.26.3/x86_64-linux-thread-multi
perl5/lib/perl5/x86_64-linux-thread-multi
perl5/lib/perl5/x86_64-linux-thread-multi/.meta
perl5/lib/perl5/x86_64-linux-thread-multi/.meta/local-lib-2.000029
perl5/lib/perl5/x86_64-linux-thread-multi/.meta/local-lib-2.000029/MYMETA.json
perl5/lib/perl5/x86_64-linux-thread-multi/.meta/local-lib-2.000029/install.json
perl5/lib/perl5/x86_64-linux-thread-multi/auto
perl5/lib/perl5/x86_64-linux-thread-multi/auto/local
perl5/lib/perl5/x86_64-linux-thread-multi/auto/local/lib
perl5/lib/perl5/x86_64-linux-thread-multi/auto/local/lib/.packlist
perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod

So the work around we landed on is to use CPAN minus and set the build dir for that
export PERL_CPANM_HOME=/tmp/$USER/.cpanm/build

Then the build works fine and the libraries are installed to the users NFS home dir, where they are thereafter available for use without any problems.

Steve Harper