Discussion:
Devel::Cover: whence the reference to Class::MethodMaker?
James E Keenan
2012-03-15 00:49:37 UTC
Permalink
On a machine where I can only install libraries underneath my home
directory, I today tried to install and use Devel::Cover. After
considerable effort, I was able to install Devel-Cover-0.79. But when I
went to use it in conjunction with 'prove' I got error output like this:

#####
$> HARNESS_PERL_SWITCHES=-MDevel::Cover prove t/001_new.t
t/001_new..........................Devel::Cover: Can't open
blib/lib/Class/MethodMaker/Engine.pm for MD5 digest: No such file or
directory
Devel::Cover: Can't open blib/lib/Class/MethodMaker/scalar.pm for MD5
digest: No such file or directory
Devel::Cover: Can't open blib/lib/Class/MethodMaker/array.pm for MD5
digest: No such file or directory
Devel::Cover: Can't open blib/lib/Class/MethodMaker/hash.pm for MD5
digest: No such file or directory
#####

Class::MethodMaker is probably not installed on this machine, and it's
certainly neither installed underneath my home directory nor used in the
testing code or the code being tested. But what's really puzzling to me
is the fact that I cannot locate the string 'MethodMaker' anywhere in
the Devel::Cover source code!

#####
[Devel-Cover-0.79] 542 $ find . -type f | xargs grep -in MethodMaker
[Devel-Cover-0.79] 543 $
#####

Can anyone suggest why I am getting this error message?

Should Class::MethodMaker be listed as a prerequisite for Devel::Cover?

Thank you very much.
Jim Keenan
Michael G Schwern
2012-03-15 02:30:13 UTC
Permalink
On a machine where I can only install libraries underneath my home directory,
I today tried to install and use Devel::Cover. After considerable effort, I
was able to install Devel-Cover-0.79. But when I went to use it in
#####
$> HARNESS_PERL_SWITCHES=-MDevel::Cover prove t/001_new.t
t/001_new..........................Devel::Cover: Can't open
blib/lib/Class/MethodMaker/Engine.pm for MD5 digest: No such file or directory
No such file or directory
No such file or directory
Devel::Cover: Can't open blib/lib/Class/MethodMaker/hash.pm for MD5 digest: No
such file or directory
#####
Class::MethodMaker is probably not installed on this machine, and it's
certainly neither installed underneath my home directory nor used in the
testing code or the code being tested. But what's really puzzling to me is
the fact that I cannot locate the string 'MethodMaker' anywhere in the
Devel::Cover source code!
Is it possible you had a pre-existing cover_db directory? Try deleting it.
--
emacs -- THAT'S NO EDITOR... IT'S AN OPERATING SYSTEM!
Paul Johnson
2012-03-15 13:07:48 UTC
Permalink
Post by James E Keenan
On a machine where I can only install libraries underneath my home
directory, I today tried to install and use Devel::Cover. After
considerable effort, I was able to install Devel-Cover-0.79.
What problems did you have, and could anything in Devel::Cover have made
that easier? I try to keep as many of the dependencies as possible
optional such that you only need to install them if you want the
functionality which uses them. I'd like to ensure that Devel::Cover is
as easy to use as possible.
Post by James E Keenan
But
when I went to use it in conjunction with 'prove' I got error output
#####
$> HARNESS_PERL_SWITCHES=-MDevel::Cover prove t/001_new.t
t/001_new..........................Devel::Cover: Can't open
blib/lib/Class/MethodMaker/Engine.pm for MD5 digest: No such file or
directory
Devel::Cover: Can't open blib/lib/Class/MethodMaker/scalar.pm for
MD5 digest: No such file or directory
Devel::Cover: Can't open blib/lib/Class/MethodMaker/array.pm for MD5
digest: No such file or directory
Devel::Cover: Can't open blib/lib/Class/MethodMaker/hash.pm for MD5
digest: No such file or directory
#####
These are actually just warnings. You're not the only person to whom
this wasn't clear. In fact, it may be that I am the only person who
understood that they were warnings and so I have just changed the
message to include the word "warning". This means that the only problem
you should see because of these warnings is that you don't see coverage
for the code in those files. It sounds like you probably don't care
much about that.
Post by James E Keenan
Class::MethodMaker is probably not installed on this machine, and
it's certainly neither installed underneath my home directory nor
used in the testing code or the code being tested. But what's
really puzzling to me is the fact that I cannot locate the string
'MethodMaker' anywhere in the Devel::Cover source code!
#####
[Devel-Cover-0.79] 542 $ find . -type f | xargs grep -in MethodMaker
[Devel-Cover-0.79] 543 $
#####
Yes, you're quite correct. Devel::Cover doesn't use this module at all.
Post by James E Keenan
Can anyone suggest why I am getting this error message?
This is usually a result of someone telling fibs to perl in the form of
#line directives which don't match reality. In this case I notice that
Class::MethodMaker uses AutoLoader which relies on AutoSplit and
AutoSplit does use such #line directives. I think I may be able to see
a way to get Devel::Cover to do the right thing in this case, and I'll
look into that at the QA hackathon if I don't get to it beforehand.

But, in your case, it seems clear to me that something, somewhere, is
using Class::MethodMaker, but it's not Devel::Cover. This is causing
the warnings you see, but you should just ignore the warnings.

Also, I should fix up Devel::Cover firstly so that it knows about
AutoSplit's tricks, and secondly so that it doesn't spit out warnings
about problems you don't care about (such as installed modules).
--
Paul Johnson - ***@pjcj.net
http://www.pjcj.net
James E Keenan
2012-03-15 23:19:29 UTC
Permalink
Post by Michael G Schwern
Is it possible you had a pre-existing cover_db directory?
No. Since, to the best of my knowledge, Devel::Cover had never been
installed on this machine, I had never tried to run 'cover' on it.
Post by Michael G Schwern
Post by James E Keenan
Class::MethodMaker is probably not installed on this machine, and
it's certainly neither installed underneath my home directory nor
used in the testing code or the code being tested.
I was wrong about that. Class::MethodMaker *is* installed on this older
(it's still at Perl 5.8.4; Debian Sarge) machine. But I grepped all the
hand-rolled Perl modules and couldn't find any use of MethodMaker.

Thanks for your responses.
jimk

Loading...