pjcj / Devel--Cover

Code coverage metrics for Perl
http://www.pjcj.net/perl.html
93 stars 87 forks source link

Can't use Devel::Cover for pkg_add on OpenBSD #325

Open marcespie opened 1 year ago

marcespie commented 1 year ago

The module OpenBSD::MkTemp (available from cpan) results in the following error messages:

``Devel::Cover: 9% Argument "OpenBSD::MkTemp::_GEN_1" isn't numeric in addition (+) at /usr/local/libdata/perl5/site_perl/amd64-openbsd/Devel/Cover.pm line 852. Devel::Cover: 50% Argument "OpenBSD::MkTemp::_GEN_2" isn't numeric in scalar assignment at /usr/local/libdata/perl5/site_perl/amd64-openbsd/Devel/Cover.pm line 900. Devel::Cover: 100% - 4s taken Devel::Cover: Writing coverage database to /home/espie/cover_db/runs/1688455293.73376.08771 Devel::Cover: Oops, it looks like something went wrong writing the coverage. It's possible that more bad things may happen but we'll try to carry on anyway as if nothing happened. At a minimum you'll probably find that you are missing coverage. If you're interested, the problem was:

Found type 9 GLOB(0x55be246a778), but it is not representable by the Sereal encoding format at /usr/local/libdata/perl5/site_perl/amd64-openbsd/Devel/Cover/DB/IO/Sereal.pm line 46.

marcespie commented 1 year ago

(forgot to mention we're running 1.40)

pjcj commented 4 months ago

Looks like a bad interaction between Devel::Cover, OpenBSD::MkTemp and Sereal. As a workaround you could probably set $DEVEL_COVER_DB_FORMAT to either JSON or Storable.

Thanks very much for the report and sorry it's taken a while for me to respond. I appreciate all the work you do with OpenBSD.

I'm having trouble locating OpenBSD::MkTemp on cpan. Do you have a link?

marcespie commented 4 months ago

I'm not sure it's been upstreamed by Guenther. It's part of OpenBSD, so you can find it on the github mirror of OpenBSD's source code under src/gnu/u.srbin/perl/cpan/OpenBSD-MkTemp

jsoref commented 1 day ago

https://github.com/openbsd/src/blob/master/gnu/usr.bin/perl/cpan/OpenBSD-MkTemp/MkTemp.xs