How can I create a Perl distribution with DIst :: Zilla and use Carton for dependencies?

I have a perl distribution that I built with Dist :: Zilla , and therefore I do not need to infect the Perl lib installed with the dependencies, I used Carton to manage them.

Everything works fine in development, but when I run dzil test or dzil release and the tests run, the dependencies are not detected and the tests fail because the modules cannot be loaded.

I tried carton exec -- dzil test and PERL5LIB=local/lib/perl5 dzil test , but I think it means that I need to put all Dist :: Zilla divisions in a cpanfile, which seems wrong (I have Dist :: Zilla and the depots that I need installed in my perl lib path).

Is there a better way?

+6
source share
2 answers

I solved this with:

 export PERL5LIB=$PERL5LIB:/absolute/path/to/project/local/lib/perl5; dzil release 
+2
source

You can use dzil build && perl Makefile.PL to make your MYMETA.* Files (if you don’t already have them) so you can file Module :: CPANfile mymeta-cpanfile to make a cpanfile :

 $ dzil build && perl Makefile.PL $ mymeta-cpanfile --no-configure > cpanfile 

You can then launch the Box and put cpanfile{,.snapshot} in your version control and possibly add more of your necessary modules to the cpanfile , which may <skip mymeta-cpanfile (for example, dependencies on Moose, etc., which are indirectly drawn in by Dist :: Zilla.)

+1
source

Source: https://habr.com/ru/post/971607/


All Articles