in reply to Re^5: Do Pure Perl CPAN packages really need to use ExtUtils::Command::MM?
in thread Do Pure Perl CPAN packages really need to use ExtUtils::Command::MM?
Sadly, despite all this back and forth I still don't get your point.
Because having to use bash -c'cd .. ; ./Build test' to run a single test is not right.
M:B lets the distro writer put custom paths in @INC to make the automated build-test-install cycle run more smoothly. You are not an automaton. If you don't want to take advantage of the fact that M:B automatically puts the right paths into @INC, then put the paths yourself into PERL5LIB. Then you don't need to cd to any directory at all. Nor do you need to run "./Build" or make or any other harness.
If your script wasn't buggy in the first place...
This is post is not about buggy scripts and never has been. The issue at hand is how to configure M:M so that files that are needed for testing/building are available in @INC but don't end up getting installed at runtime.
M:B manages to provide a 100% portable way to put such files in a distro subdir of the distro-writer's choosing. It ensures that they will be available for test/build but does not install them to system/site directories after testing is complete. They stay put in the distro.
M:M is very rigid about how to handle such modules and it forces programmers into what I consider problematic or questionable practices:
- Compensating for the hardcoded @INC by putting "use lib" all over test scripts raises separation of concern issues.
- Rooting "build/test but not runtime" modules in the distro root is just ugly and interferes with automation.
- Adding a line to the Makefile to insert a directory into PERL5LIB is not universally portable.
- Running tests via a test harness (test.pl) and moving tests to "tests" enables "make test" to work fine but borks "./Build test". The tests all run and pass, but Build never sees the TAP output. Maybe there is a solution to this, but I'm still looking for it.
If you really want to be helpful, propose a solution that uses ExtUtils::MakeMaker to run make file commands, doesn't interfere with M:B, is 100% portable, respects separation of concerns (no confusing operational code with the configuration needs of a specific environment), and ensures that files meant for build/test but not runtime never leave the distro.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Do Pure Perl CPAN packages really need to use ExtUtils::Command::MM?
by ikegami (Patriarch) on Feb 25, 2011 at 01:34 UTC | |
by ELISHEVA (Prior) on Feb 25, 2011 at 10:12 UTC | |
by ikegami (Patriarch) on Feb 25, 2011 at 19:31 UTC |