David Golden wrote:
The only reason MANIFEST.SKIP should be deleted is if Module::Build
created it because you didn't have one.  In that case, it would
actually get removed with "Build clean" (which distclean calls).

There is a subtle wrinkle that the cleanup list that "Build clean"
uses is persistent until distclean or realclean.

So you need to run 'Build realclean', then create your MANIFEST.SKIP,
then run 'perl Build.PL', etc. as normal.

I've hit this in the past. I started a new project, ran "build manifest", didn't notice in the list of adds that Module::Build created a *temporary* MANIFEST.SKIP. I edited it (seems a perfectly sensible thing to do) and then it disappeared at the next clean taking my edits with it. How annoying!

The first order solution is to stick a big note at the top of the MANIFEST.SKIP:

    ### DO NOT EDIT THIS FILE ###
    # This is a temporary MANIFEST.SKIP generated by Module::Build.
    # It will disappear next cleanup.

The second order solution is for the generated MANIFEST.SKIP to give instructions about how one can write their own MANIFEST.SKIP without MB blowing it away. Right now, if MB gets it in its head that it owns MANIFEST.SKIP, it might blow away a user created one. At this point the only solution I know of is for the user to run a clean and start over again.

    # If you want to write your own MANIFEST.SKIP, run ./Build clean
    # before doing so.

The third order solution is for MB to recognize that the MANIFEST.SKIP has been altered and leave it alone. A simple way to accomplish that would be to record a checksum of the file and check it on cleanup. If its different, leave it alone. This enables the user to A) be blissfully unaware of MANIFEST.SKIP or B) take advantage of the MB generated one and be blissfully unaware that it was supposed to be temporary.

Alternatively, just don't delete it. MANIFEST.SKIP, while strictly a generated file, is something the user is likely to edit. Its also not going to change significantly after its generated. This business of it popping in and out of existence is strictly clean, but unnecessarily confusing and complicated. It would be like if the generated Makefile.PL or README were deleted with clean. Leave it alone, ship it with the module.

I favor the latter. Its simple to implement. Its visible to the user. It doesn't require the user catch one diagnostic message and properly interpret its meaning.


--
Alligator sandwich, and make it snappy!

Reply via email to