Why Module::Build sucks
I never understood why Module::Build attracted people at all
It is limited, broken and has less features than the good old EU::MM (ExtUtils::MakeMaker).
1. dependencies, like the equivalent of make or make clean never works.
It does not check or clean important intermediate dirs and object files.
I always have to do a make realclean, to start testing with a new perl,
or updated xs file.
2. You cannot use a XS as a submodule in your package.
E.g. with Base\XS.xs windows builds will fail. Windows only!
You'll never find that out until someone else will blaim Windows.
It is just a bad Module::Build and ExtUtils::CBuilder design.
It is even not documented.
3. On cygwin it is about 20x times slower than it should. Building Module::Build lasts ~20 minutes, because it calls a slow function to check for case-sensitivity for each file, uncached.
It is my fault, because I added this slow check, but it needed years to get the fix into Module::Build. It is still not released. (Note: My official cygwin perl is patched, this works fine.)
It has 68 open bugs. I filed just one or two so far, and ignore the rest.
My current favorites:
- On Windows extra_compiler_flags is ignored.
- On Windows have_compiler fails because its companion ExtUtils::CBuilder writes to a tempfile, does not close it, but wants to compile it, which fails obviously.
With EU::MM you can override almost everything with a clever API design.
Just define your MY:: override and you can do everything. Add, replace, hook.
No need for a cookbook.
Not so with Module::Build. I never saw a useful example how to override broken Module::Build methods, because those methods are too big.
With EU::MM you need to override just the getters and setters, not the methods.
With a method driven approach you need at least after, before and around methods,
as with every useful object system. (Moose for example got it from CLOS).
With a data driven approach as in EU::MM you work as in perl with tie overrides,
just fix the the data as they will appear in the Makefile.
Module.:Build is for dummies, do not use it. Even if the beginning looks sexy.
Check how many CORE modules use Module::Build. None.
In the meantime I converted all modules I took over from Module::Build to EU::MM, it became unbearable. But from time to time I still have to suffer this mess.
And sorry, I'm not in the mood to continue fixing the known problems. I just fixed the case-sensitivity check to use caching, buit the rest is beyond repair.
The flaws are fundamental, and don't want to ducktype it.
One should use EU::MM and ExtUtils::Embed, and avoid Module::Build and ExtUtils::CBuilder to avoid trouble on windows and other stricter platforms.