develooper Front page | perl.module-authors | Postings from November 2018

Re: tools and work flows for developing collections of distributions

Thread Previous
David Christensen
November 23, 2018 08:22
Re: tools and work flows for developing collections of distributions
Message ID:
On 11/21/18 10:49 PM, Konstantin S. Uvarin wrote:
> Oh, so Makefile.PL is capable of recursion. I should've checked it first.
> But! I couldn't bring it to `make dist` recursively; instead, it just lumps
> all the directories into a huge tarball. Is that OK for CPAN? 

My first idea, demonstrated by, was to put the 
distribution source trees inside the collection source tree for 
development purposes.  When everything is good, each distribution would 
get its own tarball and the top-level collection would get its own 
tarball without the nested stuff (the way works today).

But, perhaps a flat directory layout would be better -- e.g. the 
collection and distribution source trees all rooted in the same 
directory.  Then it becomes a question of finding or reworking the tools 
to understand relationships and recursion traversal order.

> Or should I really upload separate tarballs for each module? 

If the collection and all of the distributions track head revisions, 
that would be the conventional approach.  But, I have read about putting 
specific versions of modules and/or distributions into collection 
distributions due to forward compatibility, platform support, and/or 
other concerns.

> Or is there a way to tweak Makefile.PL into recursing for make dist, too?

I spent some time reading the ExtUtils::MakeMaker, ExtUtils::MM_Unix, 
and ExtUtils::MM_Any source files, and experimenting with the Makefile 
generated by

The top-level Makefile appears to implement recursion for 'make' and 
'make test' explicitly via prerequisites:

     307 all :: pure_all manifypods
     308         $(NOECHO) $(NOOP)
     311 pure_all :: config pm_to_blib subdirs linkext
     312         $(NOECHO) $(NOOP)
     314 subdirs :: $(MYEXTLIB)
     315         $(NOECHO) $(NOOP)

     434 subdirs ::
     435         $(NOECHO) cd DistA && $(MAKE) $(USEMAKEFILE) 

     808 test :: $(TEST_TYPE) subdirs-test
     810 subdirs-test ::
     811         $(NOECHO) $(NOOP)
     813 subdirs-test ::
     814         $(NOECHO) cd DistA && $(MAKE) test $(PASTHRU)

For the target 'pure_all', if I put the prerequisite 'subdirs' first, 
then 'make' will build DistA before Bundle::MyBundle:

2018-11-22 23:48:41 dpchrist@tinkywinky ~/sandbox/perl
$ bash 2&>1 > /dev/null

2018-11-22 23:48:45 dpchrist@tinkywinky ~/sandbox/perl
$ cd

2018-11-22 23:48:54 dpchrist@tinkywinky 
$ cp Makefile Makefile-orig

2018-11-22 23:49:04 dpchrist@tinkywinky 
$ vi Makefile

2018-11-22 23:49:25 dpchrist@tinkywinky 
$ diff Makefile-orig Makefile
< pure_all :: config pm_to_blib subdirs linkext
 > pure_all :: subdirs config pm_to_blib linkext

2018-11-22 23:49:31 dpchrist@tinkywinky 
$ make
make[1]: Entering directory 
Manifying 1 pod document
make[1]: Leaving directory 
Skip blib/lib/Bundle/ (unchanged)
Manifying 1 pod document

Similarly so for the target 'test'.

The target 'dist' does not include a target for DistA (subdirs-dist), 
which explains the lack of recursion.

I have written MY overrides in the past, and could probably do so for 
the targets I am interested in:

But somewhere in my reading, I saw a statement that the EUMM team is 
trying to get away from overrides and instead implement data-driven 
solutions.  I interpret this to mean revising EUMM and related so that I 
can achieve the above results via arguments to WriteMakefile() in 

     recurse_order		=> 'depth-first',
     recurse_target_dist		=> 1,
     recurse_target_disttest	=> 1,

with built-ins:

     recurse_Makefile_PL		=> 1,
     recurse_target_all		=> 1,
     recurse_target_test		=> 1,

Implementing such a solution would be non-trivial for me.

Then, there's Module::Build, Dist::Zilla, CPAN, CPAN Testers, and likely 
many more tools and systems I am oblivious to.  The above proposals 
would need to be consider for each of them.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About