Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Problem with XSLoader in Dumper.pm while using coverage

by ovedpo15 (Pilgrim)
on Dec 02, 2019 at 15:47 UTC ( [id://11109545]=perlquestion: print w/replies, xml ) Need Help??

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

Hello dear monks,
I set PERL5LIB to be a path to the Devel::Cover lib direcotry.
It contains a Dumper.pm file (which is diffrent than the regaulr and I'm not sure what it for).
The tool I ran the coverage on is using Devel::Cover but for some reason it uses some other path and not the one that Devel uses. Then it fails:
Can't load '<PATH-TO-MODULE>/Data/Dumper/Dumper.so' for module Data::D +umper: <PATH-TO-MODULE>/Data/Dumper/Dumper.so: undefined symbol: PL_h +ints at /usr/pkgs/perl/5.26.1/lib64/5.26.1/XSLoader.pm line 96. at <PATH-TO-MODULE>/Data/Dumper.pm line 36. Compilation failed in require at /nu/asa/tool.pl line 140.
Should It use the one Devel provides? If so, how can I make it use it?

Replies are listed 'Best First'.
Re: Problem with XSLoader in Dumper.pm while using coverage
by haukex (Archbishop) on Dec 02, 2019 at 18:11 UTC

    Devel::Cover only contains a Devel/Cover/Dumper.pm file, but that shouldn't conflict with Data/Dumper.pm unless you've done something strange with the paths. Maybe you could explain the directory layout a little more? And are you sure you've pointed PERL5LIB to the lib path (the directory that contains the directory Devel) and not somewhere else? Or was perhaps PERL5LIB pointing to somewhere else before you changed it?

      PERL5LIB points to Devel lib only. I get this error only when I set DEVEL_COVER_DB_FORMAT to be JSON.
        Post output of "perl -V"
Re: Problem with XSLoader in Dumper.pm while using coverage
by jcb (Parson) on Dec 02, 2019 at 23:18 UTC

    You are mixing versions again. Your error is a failure to load an XS module due to an undefined symbol. Since the XS module that is failing to load is well-tested and widely used, we can assume that its code is probably correct and you are trying to load an XS module for one version of perl into a different version of perl, which generally does not work.

    Data::Dumper is a core module. Why is it in your custom PERL5LIB tree? Are you perhaps trying to run one version of perl with the libraries for a different version of perl? That does not work.

      Thank you for the help but I don't understand why it mixes the Perl versions. This only happens when I set the env DEVEL_COVER_DB_FORMAT to be JSON.

        It probably happens because that causes Data::Dumper to be loaded for some irrelevant reason. You will need to install parallel copies of Devel::Cover with each version of perl that your tests use. If you want to combine the databases, you will probably need to install the same version of Devel::Cover with each version of perl.

        For that matter, why do you want to combine coverage results from multiple versions of perl? I could see wanting to test code with multiple versions, but then you should strive for full coverage for each version, not full coverage across all versions.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11109545]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-19 22:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found