The road to the QA hackathon part I: It's all about the metadata
In a month an a half, we'll once more have the QA hackathon. Before going to Paris, I'm going to blog about the things that I want to do. I have a fairly packed list of things I'd like to do there; definitely more than I can do in 3 days, but fortunately there will be free-floating helpers that will hopefully help me out.
Also things that require feedback from other people.
Metadata now
Currently, there are three pieces of metadata that may be installed during a cpan install. They are neither complete, nor can one rely on their presence
.packlist
The packlist files contain a list of files that were installed. It's a very simple format, essentially just being a list of files and their types. Pretty much only useful for uninstalling distributions.
However, this is probably also why it's often absent. Many distributions, most notably Debian, remove them from their packages as they don't want the perl toolchain to uninstall files from debs.
Also, they're they are stored by module name (NAME in ExtUtils::MakeMaker, modulename in Module::Build), instead of distribution name (DISTNAME in ExtUtils::MakeMaker, distname in Module::Build). Usually, $distname eq $module_name =~ s/::/-/gr
, but this is not necessarily the case. The CPAN META spec only deals with distribution names, which makes actually looking it up difficult. cpanm actually parses EU::MM's Makefile to figure this out, because that's the only way to know for sure. This is far more messy than it should be.
perllocal.pod
perllocal is a file containing the history of locally installed modules. It's obviously intended for human consumption, hence it's a in POD. It contains the following pieces of information:
- The module_name of the installed distribution
- The location it was installed to.
- Its linkage type (this is usually dynamic)
- Its version
- A list of executables it installs, if any
There are a few issues with it. Firstly, like the packlists, it contains the module name instead of the distname. It's most important issue however is that it's only written by ExtUtils::MakeMaker. Module::Build doesn't deal with it in any way. Fortunately, Olivier Mengué is planning to fix that at the QA hackathon.
META.{yml,json}
CPAN clients use meta files when building and installing distributions. CPAN and CPANPLUS throw this data way, but cpanm install them, mostly for carton's sake. The meta files contain a lot of useful information on installed dists
Leave a comment