On Tue, Mar 14, 2006 at 09:55:49AM -0600, Chris Dolan wrote:
> On Mar 14, 2006, at 8:52 AM, Steven Schubiger wrote:
> 
> >On Thu, Mar 09, 2006 at 11:44:11AM -0600, Chris Dolan wrote:
> >>  * Simply automatic translation of legacy Makefile.PL files into  
> >>Build.PL files
> >
> >This functionality has already been made available via the  
> >Module::Build::Convert
> >distro, so no need to make your hands dirty and redo it. Have a  
> >look at it and if
> >you like, tell us what's missing from your point of view.
> 
> There was a typo in that bullet.  I meant to say "Simplify" not  
> "Simply".

Your corrected definition resembles the way it'll work much better, 
than all we can do is to *approximate* a solution; I judge my implementation
to be far from complete.

> The difference is that Module::Build::Convert uses the *results* of  
> Build.PL to compute Makefile.PL, not the source code.

There are two misconceptions here:

a) Module::Build::Convert transforms Makefile.PLs -> Build.PLs, so it's 
   exactly the other way round you thought it was supposed to work.
   
b) The Makefile.PL is statically parsed, i.e. it picks up the source
   code as good as it gets; if it can't (imagine complex Makefile.PLs,
   for example) it reverts to 'execute' the Makefile.PL via a 
   'do Makefile.PL' and the overriden WriteMakefile() via a custom
   typeglob will return the processed output.
   
   So it certainly _doesn't_ do only dynamically execute code, it's
   more like a last resort. 

> Consider File-Extract as an example:
> 
>   http://search.cpan.org/src/DMAKI/File-Extract-0.06/Build.PL
> 
> That Build.PL changes its prereq list dynamically after prompting the  
> user.  Setting aside whether File-Extract's approach is wise or not,  
> one can easily see that Module::Build::Convert would lose information  
> about that prompting and would produce a naive Makefile.PL.

I see the difficulties you're talking about, but I'd like to refer to 
misconceptions a) & b) again.

> My proposed module would conceivably enable Module::Build::Convert to  
> easily test whether the Build.PL is non-trivial, and thereby suggest  
> to the author that he hand-edit his Makefile.PL instead.  

Could we see it vice-versa integrated to Module::Build::Convert?
That'd certainly be nice.

> Of course, I do not propose adding PPI to the M::B prereq list at this point. 
>   
> I'm using this just as an example of where my proposed module would  
> offer novel functionality.

I'd be interested in having some of the outlined functionality in MBC.
I welcome any lending hand in the quest to extend MBC, because it still 
could be better and less error-prone.

-- 
He was the sort of person who stood on mountaintops
during thunderstorms in wet copper armour shouting
"All the Gods are bastards."
    -- Terry Pratchett

Reply via email to