There are quite a few CPAN dists on github that don't have the repo listed in the metadata. This post shows how to fix that for a dist that uses Module::Install. I hit various problems, so I'm writing down these notes for next time, and so that people can correct anything I got wrong.
I've never used Module::Install (MI from here on) and I've avoided doing this sort of PR on dists using it in the past. But yesterday I thought "how hard can it really be?", and the answer was "harder than it should have been, but easy once you know the trick". Kind of sums up much of programming, really :-)
The main thing I knew about MI was that it creates
inc/ directory in the top-level of your distribution,
which contains MI and any other plugins you're using.
This means that someone installing your module doesn't need to install
MI first: batteries included.
I forked the repo, then went to Gabor's article, which says how to add the repo to a dist's metadata, for the different builders. It says you just ad the following line:
So then I ran
perl Makefile.PL and checked the
Hmm, still not there.
Okay, maybe it gets updated when you build the dist? So I tried:
perl Makefile.PL make dist
... and had a look at
META.yml in the tarball. Nope, still no joy.
I asked on the
#toolchain channel on IRC, and it was suggested that
I look at other dists that are using MI.
A good suggestion.
The one I looked at is using Module::Install::GithubMeta;
you add the following line to your
This sets both the
homepage entries in the metadata,
repository() command just sets
as you might expect.
perl Makefile.PL, still no repo in the
so I tried building the tarball again, but no joy.
Most of the time you don't want to have
META.yml in github,
so I tried deleting it. But when I ran
perl Makefile.PL I got
a warning about
META.yml not existing. So I removed it from
as well. This time I didn't get a
At this point I gave up and emailed BINGOS, the current maintainer of MI, asking for help.
The key thing I needed to do was
inc/directory from the github repo
MI adds the
inc directory to the release tarball,
but it doesn't need it in the (author's) source directory.
Or rather, I guess the lack of the
inc directory tells MI
that you're an author not an installer?
META.ymlfrom gitub, but leave it in
MI will generate META.yml for you, but only if it's
MANIFEST. You'll get a warning about
not existing, but ignore that.
As you can tell, I've only somewhat improved my understanding of MI, but I could get the PR done.comments powered by Disqus