Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Why I hate Dist::Zilla

by TGI (Parson)
on May 08, 2011 at 18:46 UTC ( #903657=perlmeditation: print w/replies, xml ) Need Help??

I'd love to be writing a post called Why I love Dist::Zilla. Maintaining CPAN-style modules has a fair amount of boiler-plate and boring paper-work that must be maintained and fiddled with--it's especially annoying when you make a new module, but every release cycle has its annoyances. Dist::Zilla is intended to help reduce these issues.

Granted, I had my doubts about Dist::Zilla going in. I am concerned that it is another powerful, flexible, tool, that will require many hours to really understand and use effectively. Perhaps Dist::Zilla is only a reasonable trade of the the most prolific of CPAN authors. It also has a pretty good sized list of dependencies. We all know all the arguments around dependencies and whether they are a good or bad thing, so I won't rehash them here.

So, I love the idea of Dist::Zilla, and I decided give it a whirl. The thing is, I have made two different efforts to install Dist::Zilla and blown several hours each time without getting a usable install. It's really not working out to be a good time trade-off. Frankly, this is not the trouble I was expecting. I was worried about learning curve, not installation. In my previous experience, using modules from top CPAN contributors has not been a problem. Let hunt down prereqs and BOOOM!-working distro.

Dzil is the latest latest thing in Perl, it uses Moose (which I really dig) and a bunch of MooseX modules in innovative ways to produce really clean, maintainable looking code that I can't install. The first time I tried to use it I gave up while trying to install MooseX::Types. It's been a long time, I don't remember all the related versions and everything. I decided to give it another go.

This time, I spent a lot of time diving through big long blobs of TAP output to find modulues that broke and look for dependencies that might not be properly reported.

So far, trying to install Dist::Zilla 4.200006 with Moose 2.0002 (already installed) has been painful, I spent quite a while fetching and building a big pile of prerequisites. That done, I started getting test failures.

I've had to install several modules manually after grubbing in TAP output and module source. Each one gets me a bit closer.

I can't recall everything that I've had to do, (my 10,000 line scrollback buffer overflowed). But I know I had and tracked down these issues:

  • MooseX::OneArgNew -> failed due to me having namespace::autoclean 0.11 instead of namespace::autoclean 0.12 installed. This was easy to track down since it was called out in a clear message:
    t/basic.t ............... Couldn't load class (MooseX::OneArgNew) beca +use: Undefined subroutine &namespace::autoclean::on_scope_end called +at /Users/toad/perl5/lib/perl5/namespace/ line 57. BEGIN failed--compilation aborted at /Users/toad/.cpan/build/MooseX-On +eArgNew-0.001-mHVvqm/blib/lib/MooseX/ line 11. Compilation failed in require at /Users/toad/perl5/lib/perl5/darwin-th +read-multi-2level/Class/ line 117. at /Users/toad/perl5/lib/perl5/darwin-thread-multi-2level/Class/MOP.p +m line 123 Class::MOP::__ANON__('Undefined subroutine &namespace::autoclean:: +on_scope_end call...') called at /Users/toad/perl5/lib/perl5/Try/Tiny line 100
  • Role::HasMessage -> installed properly after I updated namespace::autoclean.
  • As did Config::MVP
  • This got me to Dist::Zilla::MVP::RootSection failing the compile.t:
    # Failed test 'require Dist::Zilla::MVP::RootSection;' # at t/compile.t line 17. # Tried to require 'Dist::Zilla::MVP::RootSection'. # Error: Could not create the 'reader' method for zilla because : + The method '_inline_store' was not found in the inheritance hierarch +y for Moose::Meta::Class::__ANON__::SERIAL::10 at /Users/toad/perl5/l +ib/perl5/darwin-thread-multi-2level/Class/MOP/ line 1034 # Class::MOP::Class::__ANON__('Moose::Meta::Class=HASH(0x1022490b8 +)', '_inline_store') called at /Users/toad/perl5/lib/perl5/darwin-thr +ead-multi-2level/Class/MOP/ line 1079 # Class::MOP::Class::add_around_method_modifier('Moose::Meta::Clas +s=HASH(0x1022490b8)', '_inline_store', 'CODE(0x1022387d8)') called at + /Users/toad/perl5/lib/perl5/darwin-thread-multi-2level/Moose/Meta/Ro +le/Application/ line 222 .... AND MUCH MUCH MORE ...
  • Looking at the source of Dist::Zilla::MVP::RootSection, I saw, MooseX::LazyRequire listed in a use line, so I tried to install it. (it was not installed). Still Dist::Zilla won't build.

Later on I'll keep looking and trying to install Dist::Zilla.

So, Dist::Zilla has been an entirely negative experience. Not all of it is due to errors on the part of DZ's authors.

Lessons I take from this experience:

  • Dependencies are NOT free. This is an old chestnut, It's been well discussed to death. This experience showed me another failure mode.
  • There needs to be a way to easily choke off pendantic test output. Also, it would be nice if you could set a "fail fast" mode where we skip all remaining tests on the first failure.
  • Moose really needs to do something about its error messages. stvn and crew already know about this and would like to fix it, but it isn't a simple problem.
  • The cleanest, clearest, most elegant code in the world is useless if I can't run it.


I installed MooseX::SetOnce and then Dist::Zilla finally installed. Here's hoping that in a week or two I'll be able to write a meditation called "Why I love Dist::Zilla".

TGI says moo

Replies are listed 'Best First'.
Re: Why I hate Dist::Zilla
by moritz (Cardinal) on May 08, 2011 at 20:25 UTC
Re: Why I hate Dist::Zilla
by chromatic (Archbishop) on May 08, 2011 at 21:22 UTC

    The namespace::autoclean changes between a couple of versions were painful for a lot of people. I believe the real solution to this sort of thing is improved dependency tracking, but doing things better requires a huge change to the CPAN ecosystem and Perl 5 module management and loading, so it'd take a few years even if the effort were to begin today.

    With that said, Moose's error messages are my least favorite part of Moose.

      I'd like to know a bit more about the problems with namespace::autoclean changes.

      But I'd really like to hear your thoughts on viable approaches to dependency tracking. Please do elaborate.

      TGI says moo

      The namespace::autoclean changes between a couple of versions were painful for a lot of people. I believe the real solution to this sort of thing is improved dependency tracking, but doing things better requires a huge change to the CPAN ecosystem and Perl 5 module management and loading, so it'd take a few years even if the effort were to begin today.

      Can you elaborate?

Re: Why I hate Dist::Zilla
by educated_foo (Vicar) on May 08, 2011 at 22:32 UTC
    Holy prereqs, Batman! That's at least 177 dependencies with the latest Perl (136 non-core)! Yes, it's good not to reinvent wheels, but you also have to ask yourself why you're building an 18-wheeler when a motorcycle would do as well. Should creating and updating distributions be this complicated?
      136 non-core
      I've got my site-perl under version control, so I deleted it and installed Dist::Zilla just for the hell of it. I needed to install a couple of modules manually.

      Altogether, cpanp installed 132* modules from CPAN.

      * These:


      using perl 5.13.3 5.12.3

          A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Why I hate Dist::Zilla
by Khen1950fx (Canon) on May 09, 2011 at 15:49 UTC
    I counted 192 dependencies. Here is the whole kit'n'kaboodle:
    #!/usr/bin/perl use strict; use warnings; use CPAN; CPAN::Shell->install( "File::ShareDir", "File::Copy::Recursive", "Algorithm::Diff", "Text::Diff", "Data::Dumper", "Test::Differences", "Tree::DAG_Node", "Test::Warn", "Class::Data::Inheritable", "Exception::Class", "Test::Most", "Hash::Merge::Simple", "Perl6::Junction", "Moose::Autobox", "Config::INI::Reader", "Config::MVP::Reader", "Config::MVP::Reader::INI", "ExtUtils::Manifest", "Package::Constants", "IO::Zlib", "Archive::Tar", "Text::Template", "Software::License", "autobox", "IO::TieCombine", "App::Cmd::Setup", "Mixin::Linewise::Readers", "Pod::Eventual", "Math::Round", "Class::Singleton", "parent", "DateTime", "DateTime::TimeZone", "DateTime::Locale", "MooseX::Types::Perl", "File::ShareDir::Install", "WWW::RobotRules", "HTTP::Cookies", "Net::FTP", "Net::HTTP", "HTTP::Daemon", "HTTP::Negotiate", "File::Listing", "LWP::UserAgent", "Term::ReadKey", "Getopt::Long::Descriptive", "HTML::Tagset", "HTML::Parser", "Time::Local", "HTTP::Date", "URI", "Encode::Locale", "LWP::MediaTypes", "Compress::Raw::Bzip2", "Compress::Raw::Zlib", "IO::Uncompress::Inflate", "HTTP::Status", "CPAN::Uploader", "Log::Message", "Log::Message::Simple", "Term::UI", "YAML", "YAML::Syck", "YAML::XS", "Error", "YAML::Perl", "Filter::Util::Call", "YAML::Tiny", "Number::Compare", "Text::Glob", "File::Find::Rule", "Getopt::Long", "File::Slurp", "Pod::Usage", "Perl::Version", "String::Flogger", "Sub::Exporter", "Sub::Exporter::GlobExporter", "ExtUtils::ParseXS", "Params::Check", "Module::CoreList", "Module::Load", "Module::Load::Conditional", "Locale::Maketext::Simple", "IPC::Cmd", "ExtUtils::CBuilder", "Perl::OSType", "Module::Metadata", "Module::Build", "Attribute::Handlers", "Params::Validate", "Sys::Syslog", "Log::Dispatch::Output", "Log::Dispatch::Array", "Log::Dispatchouli", "Data::Section", "Path::Class", "MooseX::Types::Path::Class", "Module::Pluggable::Object", "String::Formatter", "JSON", "autodie", "Date::Format", "Time::Piece", "String::Errf", "Role::HasMessage", "Class::Load", "Role::Identifiable::HasIdent", "Devel::StackTrace", "StackTrace::Auto", "MooseX::Role::Parameterized", "MooseX::OneArgNew", "Tie::IxHash", "File::Path", "Time::HiRes", "IPC::Run3", "Probe::Perl", "Test::Script", "File::Which", "File::HomeDir", "File::pushd", "IO::Dir", "JSON::PP", "CPAN::Meta::YAML", "Parse::CPAN::Meta", "CPAN::Meta::Converter", "aliased", "Sub::Uplevel", "Test::Exception", "Carp::Clan", "MooseX::Types::Moose", "MooseX::LazyRequire", "MooseX::SetOnce", "Test::Deep", "File::Temp", "version", "Version::Requirements", "Sub::Identify", "namespace::clean", "base", "Variable::Magic", "B::Hooks::EndOfScope", "namespace::autoclean", "Scope::Guard", "Devel::GlobalDestruction", "Sub::Name", "Package::Stash", "Eval::Closure", "Algorithm::C3", "Class::C3", "MRO::Compat", "Package::Stash::XS", "Try::Tiny", "Test::Fatal", "Package::DeprecationManager", "Test::Requires", "Moose", "Sub::Install", "Data::OptList", "Sub::Exporter", "String::RewritePrefix", "List::MoreUtils", "Task::Weaken", "Class::Inspector", "Hook::LexWrap", "Test::SubCalls", "MIME::Base64", "Digest::base", "XSLoader", "Digest::MD5", "Clone", "Params::Util", "Test::Tester", "Test::NoWarnings", "Storable", "Exporter", "Test::Object", "IO::String", "Encode", "Test", "Text::Wrap", "Pod::Escapes", "Pod::Simple", "Pod::Man", "Scalar::Util", "File::Spec", "ExtUtils::MakeMaker", "Test::Harness", "Test::More", "File::Remove", "PPI", "Perl::PrereqScanner", "Dist::Zilla");
      what a waste of time, installing the module via cpan,cpanm etc does this, plus your script is pointless and will be out of date.
Re: Why I hate Dist::Zilla
by John M. Dlugosz (Monsignor) on May 10, 2011 at 07:48 UTC
    My previous/only CPAN contribution was in 2002 or 2003, and was done on Windows so it didn't follow the traditional ecosystem at all (though I changed it around based on feedback after my first attempt).

    If I'd like to contribute some relatively simple stuff now, what should I use? Or if doing it mostly manually, what should I read?

      For relatively simple stuff, I found that simply copying any existing distribution works well, no matter whether it uses ExtUtils::MakeMaker or Module::Install, or even Module::Build (or a newcomer, Module::Build::Tiny). Just download and unpack any such distribution, and edit the Makefile.PL (or Build.PL) to match your distribution. I found all of them to be quite obvious in the sense that I just had to search and replace the existing distribution name (or distribution path) with my distribution name.

      There are some files you might want to wipe from an existing distribution download:


      MANIFEST should then be recreated by make manifest. META.yml will be recreated when building your new distribution.

      Personally, I found that Module::Release streamlined the rest of the release process very much for me:

      1. Check that the module is up to date in version control
      2. Check that all tests pass (make test successfull)
      3. Check that all tests pass when redistributed (make disttest successfull)
      4. Upload to CPAN
      5. Tag version control with the release number
      6. Push tags to github

      Theoretically, Dist::Zilla also can do these things, but the cost/benefit ratio over my existing solution is too small for me to consider changing.

      Yesterday I created and uploaded my first distribution ever to CPAN and Dist::Zilla made it really easy for me. So thanks everyone who made that possible. :)
Re: Why I hate Dist::Zilla
by rjbs (Pilgrim) on Aug 06, 2011 at 22:24 UTC
    Next time you (or anybody else) encounters a problem like this, drop me (or us) a line. On IRC, or the dzil mailing list, or on Twitter, or AIM, or anything. I (we) would love to help you find out what's wrong and make sure we deal with the problem for future users.

    When things only get posted on perlmonks, I don't find out until months later.

Re: Why I hate Dist::Zilla
by djzort (Sexton) on Jul 08, 2012 at 06:13 UTC
    i just apt-get installed' it - though i run debian sid. i found that the dist::zilla introduction documentation is really hard to follow. if people have time, it would be of great benefit to find some new comers and get their feedback so the documentation can be improved. i have found it to be an excellent suite though dzil is really dependancy heavy. perhaps it would be sensible to slim it down - which may even reduce how memory hungry it is.

      perhaps it would be sensible to slim it down - which may even reduce how memory hungry it is.

      LOL -- just get rid of all the features, or reinvent all the wheels they use , brilliant!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://903657]
Approved by Old_Gray_Bear
Front-paged by Arunbear
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2021-05-14 18:55 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (150 votes). Check out past polls.