CPAN Meta Spec version 2 released

Dear CPAN authors,

It is with great pleasure that we present you with the release of the CPAN Meta Spec version 2.

This document specifies the format for the next version of CPAN distribution metadata files -- the META.yml and now META.json files found in most distributions on CPAN.

Version 2 is the result of a call for proposals last year that resulted in 34 proposals and over 300 discussion emails. The final proposal was reviewed by a working group consisting of the maintainers of most of the major Perl toolchain modules, administrators of the major CPAN indexing sites and representatives from several major linux distributions that package CPAN libraries.

The new release includes not only the actual specification but new support libraries for the toolchain to work with META files in a more consistent way.

As support is added to tools like Module::Build, Module::Install or Dist::Zilla over the coming months, CPAN authors will see several new options for providing additional information about their distributions.

Some notable changes to the specification include:

  • use of JSON as the preferred serialization format (i.e. META.json)
  • prereqs are more granular, allowing every "action" (e.g. 'build', 'test') to have every type of relationship (e.g. 'requires', 'recommends')
  • adoption of Debian-inspired semantics for 'recommends' and 'suggests' for optional prereqs
  • supports listing multiple licenses
  • clearer rules for adding custom fields
  • an indicator of release stability
  • improved options for pointing to related resources, particularly code repositories

The specification version is also changing to an integer, so it can be the "major" number on CPAN::Meta and the decimals can reflect bug fixes or other non-specification changes to the library that implements any particular spec version.

Over the next month or so, we'll be blogging about some of the details of the change.

Thank you to Ken Williams for creating the initial 'META.yml' spec and maintaining it through version 1.4 and thank you to everyone who contributed ideas, patches, discussion and critique in the development of the version 2 spec.

Ricardo Signes and David Golden

This entry was posted in cpan, cpan-meta-spec, perl programming, toolchain and tagged , . Bookmark the permalink. Both comments and trackbacks are currently closed.


  1. Clinton Gormley
    Posted April 20, 2010 at 7:32 am | Permalink

    One thing about making JSON the preferred META format, is that, in its compact form, it is quite difficult to read.

    I often check the META.* file to see what dependencies the module has. It'd be nice if tools like Dist::Zilla (if it doesn't already) were to "pretty print" the META.json instead

    • dagolden
      Posted April 20, 2010 at 8:59 am | Permalink

      CPAN::Meta will pretty-print the JSON, so once Dist::Zilla and other tools switch over to using it, you'll still be able to browse the META file the way you used, to.

  2. trans
    Posted August 2, 2012 at 10:11 am | Permalink

    Curious. If the JSON format is "preferred" how does that really benefit the spec? It means YAML will have to be supported anyway, and considering that JSON is a subset of YAML, "preferred" becomes meaningless, as is having to worry about a new `.json` extension.

    • trans
      Posted August 2, 2012 at 10:13 am | Permalink

      Rather I should end saying, the worry over two possible extensions is a pain.

      • Posted August 2, 2012 at 10:29 am | Permalink

        The old spec didn't specify that clients need to check the version of the spec to see if they can handle it. Therefore, it's helps avoid backwards compatibility problems if the 1.0-1.4 spec version files are YAML and the 2+ spec files are JSON. Older clients only look for YAML files. Newer clients look for JSON first (and should know to check the version for forward compatibility).

        If you use CPAN::Meta->load_file($file), you don't have to worry about which extension it is, because it will do the right thing for you.

2 Trackbacks

  • [...] are some other changes at the horizon for your modules’ META files as well. David Golden announced the release of version 2 of the CPAN META Spec. One of the biggest changes is the adoption of JSON [...]

  • By What I’m working on in Perl | dagolden on April 28, 2010 at 6:23 pm

    [...] dagolden Whatever comes to mind Skip to content HomeAbout MeMy ProjectsMy TalksMy Code Home > perl-programming > What I’m working on in Perl « CPAN Meta Spec version 2 released [...]