dgaramond2 has asked for the wisdom of the Perl Monks concerning the following question:

I've been using Dist::Zilla with great success, though have never delved into its internals. It's always been good enough for my needs. Recently I upgraded from dzil 2.x to the new 4.x. There are some lingering problems/annoyances, would appreciate if fellow monks could give pointers to solutions.

* dzil no longer exclude backup files (*~), so these files end up in the distribution (causing build problems if the backup files are removed prior to building). I've looked into DZP::PruneCruft and DZP::PruneFiles but they both do not seem to allow simple excluding of *~ files.

* files in bin/* are now also required to have package declaration. I couldn't find a way to disable this behaviour, so currently I add 'package main;' to my binary files.

* the last thing is not new, I've been seeing this warning/error message for a while: @Filter/PodVersion couldn't find '=head1 VERSION' in foo, not adding '=head1 VERSION', and I didn't understand the meaning of this, since the '=head1 VERSION' did got added by dzil.

  • Comment on A few problems with new Dist::Zilla (from 2.x to 4.x)

Replies are listed 'Best First'.
Re: A few problems with new Dist::Zilla (from 2.x to 4.x)
by FalseVinylShrub (Chaplain) on Sep 30, 2010 at 12:52 UTC

    Hi

    I've experienced all of these issues too. I've only got a solution for the first:

    I'm using the ManifestSkip plugin and adding a MANIFEST.SKIP file with the patterns I want to ignore that aren't handled by PruneCruft.

    A better solution would perhaps be to make a more configurable PruneCruft because like you, I looked into it and there didn't seem to be a way to override what it considers cruft.

    I've adopted the same solution to you for the second one: adding package main; If I remember correctly this is so that the version number is added...

    I've seen the third one but not recently. Maybe I'm not using PodVersion any more.

    Still a Dist::Zilla beginner, but I find it very useful.

    Cheers

    FalseVinylShrub

    Disclaimer: Please review and test code, and use at your own risk... If I answer a question, I would like to hear if and how you solved your problem.

Re: A few problems with new Dist::Zilla (from 2.x to 4.x)
by rjbs (Pilgrim) on Oct 01, 2010 at 12:59 UTC

    The PruneCruft thing was unfortunate. The purging of ~ files had gone in over my mild objections (I can't complain too much, I did the merge), and was then removed later when there were other objections that made me feel better about my own. It should be easy to add an "also" to PruneCruft (like except, but backward) or "patterns" to PruneFiles. I think someone has probably got a plugin to do what you want, but I'm not sure. #distzilla on irc.perl.org might know.

    Files in bin/* don't strictly need a package declaration, but some things will expect them, like PodWeaver. You can just add the package -- which is what I do -- or you can change the FileFinders used by PodWeaver to only include :InstallModules and not :ExecFiles. #distzilla could also provide more step-by-step help, I think. I believe Marcel G. recently did just this change, so @MARCEL might have the change in it.

    If PodVersion is finding =head1 VERSION that DZ added, it sounds like maybe you're using PodVersion -and- PodWeaver. The latter makes the former unnecessary.

    Let me know if this is all unhelpful! ;)
    rjbs
      Thanks for the answers.

      If you use PodWeaver and add 'package main' to all bin/* files, how do you avoid creating '=head1 NAME main' for all the files?

      (Should perhaps ask in irc, but got to go offline now...)

        I don't actually use "main," I give them names that match the program name, or are very close. For example, I believe that the "cronjob" program in App::Cronjob has "package cronjob"
        rjbs