2021-02-21 Perl dependencies for Phoebe

Every now and then I’m getting reports from the CPAN testers that my modules fail tests because they don’t declare all their dependencies in the “Makefile.PL” file. The problem is that on those systems where the modules happen to be installed – such as mine – these problems don’t surface.

The first step to solve this is to write a test that uses “Test::Prereq” to check whether all the modules used are declared as a dependencies in the “Makefile.PL”. So far so good. I added many dependencies I considered unnecessary – I felt they were part of the Perl core since 5.26.0, the starting point I picked for Phoebe. But now I want to make sure, and I want a test to make sure I’m not slipping.

So what I did now is to use “perlbrew”, using a new Perl version without any modules installed (more or less?), rerunning “perl Makefile.PL” to regenerate a Makefile for the new Perl I’m using, running “perlbrew install_cpanm” to get a new “cpanm”, and then using “cpanm .” to attempt an install with all the dependencies.

The result? It’s still building the list of dependencies. 😴💤

Time passes.

OK, I can reproduce the problem!

Building and testing App-phoebe-2.1 ... FAIL
! Installing . failed. See /home/alex/.cpanm/work/1613930095.24976/build.log for details. Retry with --force to force install it.
56 distributions installed

Whaaaat! 😠

Well, it seems that somewhere, somehow, “DateTime::Format::ISO8601” is being used, so I added that as a dependency, and that in turn pulls in a ton of other modules… Oh well.

I’ve been chatting with @AFresh1 and he says that dependencies for optional code is a sign that perhaps that optional code should go into a separate distribution. Hm. I guess that makes sense. I’m currently just wondering about the architecture of the thing.

@AFresh1

Extensions right now: there is a directory you can create and any Perl source file you put there is getting loaded on startup. Where do these files come from? From my repo. That is, if you install Phoebe using CPAN, these files are unpacked and tested, but then they aren’t being installed anywhere.

Extensions could instead be: there is a module you can install, such as App::phoebe::gopher, which installs a Perl module. In your config file, you’d write: “use App::phoebe::gopher”. Done?

​#Perl ​#Phoebe