How many parsers does it take to break META.yml?

dagolden on 2009-01-08T22:35:21

It looks like Perl 5.10.1 may include Parse::CPAN::Meta, so that CPAN and CPANPLUS will support 'configure_requires' out-of-the-box. This is a major step in improving forward compatibility of the CPAN installation toolchain.

However, it sparked a discussion on perl5-porters whether Parse::CPAN::Meta is ready to take on any META.yml on CPAN and so I used the visitcpan tool I wrote about in my last journal post to investigate.

I checked not only how Parse::CPAN::Meta handled META.yml, but also YAML::XS, YAML::Syck, YAML::Tiny and YAML.pm. Plus, I cross-checked each pair to see whether they produced the same output.

The results show that very few of the 16,000 or so distributions on CPAN have META.yml problems (most probably don't even have META.yml). But of those that do, the different YAML parsers can give subtly different output. (Click any red "-" box to see details.)

Is Parse::CPAN::Meta any worse than the others? Hard to say. Personally, I think it's "good enough" for 5.10.1 and hope any corner cases are fixed over time.

-- dagolden


To utf-8 or not to utf-8, that is the question

bart on 2009-01-08T23:03:34

Looking through several of those red minus signs, I saw that apparently a lot of the problem are caused by whether the YAML parser treats the META.yml file as UTF-8, or as some single byte encoding (most likely ISO-8859-1).

Some examples: 1, 2, 3

It looks like a knot needs to be cut through, a decision needs to be made: what encoding should a META.yml file be? Maybe it could make use of a BOM in case the default is ISO-8859-1, and the author prefers UTF-8, for some reason (for example, to spell his name correctly)?

I am guessing that once that decision is made, all these parsers can be convinced to treat the META.yml files the same way, and that then, most of these differences will simply vanish.

those +/- boxes look familiar

domm on 2009-01-09T12:04:03

... good that cpants is of some use :-)

Re:those +/- boxes look familiar

dagolden on 2009-01-09T12:13:14

Yes -- saved me some time figuring out how to do a table like that, plus I told all the cranks on #p5p complaining about red-green colorblindness that I just copied CPANTS... :-)