1

Let's say I've created a directory using module-starter, and written several additional modules and tests since.

make test would then run all tests in t/ on all modules in lib/, however make dist will only pack files mentioned in MANIFEST into tar.gz.

So I got burnt recently by running make test && make dist and still getting a broken package.

My question is: am I missing something, or this can be reported as a minor bug in MakeMaker? (Which Makefile.PL seems to rely upon).

Dallaylaen
  • 5,268
  • 20
  • 34
  • I'm missing the bug? Do you mean you shouldn't have to update your manifest? How would it automagically know what you wanted to add? – Brian Roach Mar 18 '11 at 19:18
  • I wouldn't mind having it the other way around: skip files NOT in manifest when testing. This is hard to overlook, and no magic required. – Dallaylaen Mar 18 '11 at 19:33
  • 1
    You should consider using [Dist::Zilla](http://dzil.org). One of its standard plugins is TestRelease, which unpacks the tarball and runs tests using that, to ensure that the distribution you're releasing really does pass its tests. – cjm Mar 18 '11 at 21:02

2 Answers2

5

You can use make disttest which will create a distribution directory from the MANIFEST (equivalent to make distdir) and run make test in that. This guarantees you're running against the same files as will be shipped.

I also rebuild my MANIFEST as part of making a release, which requires keeping your MANIFEST.SKIP up to date.

All in all, my basic release script is:

perl Makefile.PL
make manifest
make disttest
make dist
Schwern
  • 153,029
  • 25
  • 195
  • 336
3

Run make distcheck before you release your package. This will warn you about anything potentially missing from your MANIFEST.

Some modules generate files during the build process (including under lib/), so files missing in the MANIFEST shouldn't necessarily cause make dist to fail.

mob
  • 117,087
  • 18
  • 149
  • 283