zopencommunity / perlport

Perl programming language
Apache License 2.0
6 stars 3 forks source link

Using relative path in config leads to modules not found. #62

Open redstar opened 1 year ago

redstar commented 1 year ago

Using perlport_814 and this diag.pl file:

use diagnostics;

I get

>perl diag.pl
couldn't find diagnostic data in ../lib/5.37.11/pods/perldiag.pod /plex/knacke/zopen/prod/perl/lib/5.37.11/os390 /plex/knacke/zopen/prod/perl/lib/5.37.11 /plex/knacke/zopen/prod/perl/lib/5.37.11/os390 ../lib/site_perl/5.37.11/os390 ../lib/site_perl/5.37.11 ../lib/5.37.11/os390 ../lib/5.37.11 diag.pl at /plex/knacke/zopen/prod/perl/lib/5.37.11/diagnostics.pm line 259, <POD_DIAG> line 718.
Compilation failed in require at diag.pl line 1.
BEGIN failed--compilation aborted at diag.pl line 1.

The problem boils down to the relative path while searching for the module. diagnistics.pm uses $Config{privlibexp} to search for the perldiag.pod, which has the value ../lib/5.37.11. This directory does not exist if used relative to $PWD.

perl -V shows the include path:

  @INC:
    /plex/knacke/zopen/prod/perl/lib/5.37.11/os390
    /plex/knacke/zopen/prod/perl/lib/5.37.11
    /plex/knacke/zopen/prod/perl/lib/5.37.11/os390
    ../lib/site_perl/5.37.11/os390
    ../lib/site_perl/5.37.11
    ../lib/5.37.11/os390
    ../lib/5.37.11

Compared to Ubuntu (were it works):

  @INC:
    /etc/perl
    /usr/local/lib/s390x-linux-gnu/perl/5.34.0
    /usr/local/share/perl/5.34.0
    /usr/lib/s390x-linux-gnu/perl5/5.34
    /usr/share/perl5
    /usr/lib/s390x-linux-gnu/perl-base
    /usr/lib/s390x-linux-gnu/perl/5.34
    /usr/share/perl/5.34
    /usr/local/lib/site_perl

Solution seems to only use absolute paths.