Marvin Humphrey | 23 Jan 2010 23:46

State of Module::Build::Compat

Greets,

I've offered passthrough Makefile.PLs on my Module::Build-based distros for
the last few years, and they seem to have done what I needed them to do: stop
Makefile.PL loyalists from taking up my time with complaints.

However, I recently saw this on cpan-testers-discuss from David Golden:

    http://markmail.org/message/jzzobzsrgc6vi7tr

    Module::Build::Compat must die. 

I've got a distro that requires Perl 5.8.3 or greater that's currently got a
passthrough Makefile.PL.  Should I zap it?  Would that help anyone out, at the
cost of possibly bringing up the noise floor by some unknown amount on my
support lists?

Marvin Humphrey

David Golden | 24 Jan 2010 00:11
Picon
Gravatar

Re: State of Module::Build::Compat

To clarify - the real issue with M::B::Compat in passthrough mode is that we
have to emulate the api perfectly and that's a big source of bugs.

David

On Jan 23, 2010 5:46 PM, "Marvin Humphrey" <marvin <at> rectangular.com> wrote:

Greets,

I've offered passthrough Makefile.PLs on my Module::Build-based distros for
the last few years, and they seem to have done what I needed them to do:
stop
Makefile.PL loyalists from taking up my time with complaints.

However, I recently saw this on cpan-testers-discuss from David Golden:

   http://markmail.org/message/jzzobzsrgc6vi7tr

   Module::Build::Compat must die.

I've got a distro that requires Perl 5.8.3 or greater that's currently got a
passthrough Makefile.PL.  Should I zap it?  Would that help anyone out, at
the
cost of possibly bringing up the noise floor by some unknown amount on my
support lists?

Marvin Humphrey
Eric Wilhelm | 24 Jan 2010 05:26
Picon

Re: State of Module::Build::Compat

# from David Golden
# on Saturday 23 January 2010 15:11:

># from Marvin Humphrey
>>I've got ... a passthrough Makefile.PL.  Should I zap it?

>To clarify - the real issue with M::B::Compat in passthrough mode is
> that we have to emulate the api perfectly and that's a big source of
> bugs.

Passthrough was always buggy in some case or another (and the bugs drift 
around a lot), but it gave you a compatibility layer for the case where 
you're using M::B features that can't be handled in a "traditional" 
Makefile.PL.

A lot of the problems are caused by old CPAN clients, or old defaults 
which have gone stale in the config file.  The rock and the hard place 
are:

  rock:        prefer_installer is set to old default (EUMM)
  hard place:  old client invents Makefile.PL from thin air

Because upgrading CPAN.pm won't change the configs (because it can't 
know if you meant it or took its earlier bad advice), there are a lot 
of rocks to bump into.

If you want to encourage these users to upgrade their CPAN.pm and/or fix 
their configs, deleting the Makefile.PL may be the best route.  (I've 
released a few dists with a die in the Makefile.PL explaining how to 
run Build.PL -- but I think rocks far outnumber hard places by now, so 
(Continue reading)

Marvin Humphrey | 24 Jan 2010 15:15

Re: State of Module::Build::Compatg

On Sat, Jan 23, 2010 at 08:26:06PM -0800, Eric Wilhelm wrote:
>   hard place:  old client invents Makefile.PL from thin air

Probably the fact that we require Perl 5.8.3 or above spares us from some of
those.

> If you want to encourage these users to upgrade their CPAN.pm and/or fix 
> their configs, deleting the Makefile.PL may be the best route.  

It's more the by-hand installers that have been a PITA, of which there are a
couple types. There are the simpletons who have learned the "perl Makefile.PL
make make test make install" incantation once upon a time, get confused and
upset when their routine gets disrupted, and can't be bothered to open a
README and follow simple instructions.  Then there are people who learned to
dislike M::B back when it was more buggy or "didn't support" their favorite
EUMM feature (e.g. PREFIX), and who think it's really important to argue with
me about switching to EUMM.

A passthrough Makefile.PL keeps all of them out of my hair.

Since Module::Build has moved to core and become more reliable these
conversations end quicker, but I'd still rather not have the conversations at
all.

> If you're not using any M::B-only features and the "traditional" 
> Makefile.PL generation works for you, just do that and you won't get 
> complaints even in 1999.

Heh.  We've got a 600-line M::B subclass, which makes heavy use of
ExtUtils::CBuilder and ExtUtils::ParseXS.  It works like a charm, and
(Continue reading)

David Golden | 24 Jan 2010 16:39
Picon
Gravatar

Re: State of Module::Build::Compatg

I think we now say "deprecated" but because there are people in your
situation, I don't see actually removing it for a while -- like around the
time that 5.10 is "standard" and 5.8 is rare.

David

On Jan 24, 2010 9:15 AM, "Marvin Humphrey" <marvin <at> rectangular.com> wrote:

On Sat, Jan 23, 2010 at 08:26:06PM -0800, Eric Wilhelm wrote:
>   hard place:  old client invents Makefile.PL from thin air

Probably the fact that we require Perl 5.8.3 or above spares us from some of
those.

> If you want to encourage these users to upgrade their CPAN.pm and/or fix
> their configs, deleting the Makefile.PL may be the best route.

It's more the by-hand installers that have been a PITA, of which there are a
couple types. There are the simpletons who have learned the "perl
Makefile.PL
make make test make install" incantation once upon a time, get confused and
upset when their routine gets disrupted, and can't be bothered to open a
README and follow simple instructions.  Then there are people who learned to
dislike M::B back when it was more buggy or "didn't support" their favorite
EUMM feature (e.g. PREFIX), and who think it's really important to argue
with
me about switching to EUMM.

A passthrough Makefile.PL keeps all of them out of my hair.

(Continue reading)

Eric Wilhelm | 24 Jan 2010 18:40
Picon

Re: State of Module::Build::Compatg

# from Marvin Humphrey
# on Sunday 24 January 2010 06:15:

>>   hard place:  old client invents Makefile.PL from thin air
>
>Probably the fact that we require Perl 5.8.3 or above spares us from
> some of those.

Only if the super-retro users know that you require 5.8.3, which they 
don't unless the Makefile.PL blocks them from installing.  Maybe not a 
big deal, but users who don't read instructions and live in 1999 get 
some really puzzling error messages.

--Eric
--

-- 
"It is impossible to make anything foolproof because fools are so 
ingenious."
--Murphy's Second Corollary
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Curtis Jewell | 24 Jan 2010 23:00
Picon
Favicon

Re: State of Module::Build::Compat


On Sat, 23 Jan 2010 14:46 -0800, "Marvin Humphrey"
<marvin <at> rectangular.com> wrote:
> Greets,
> 
> I've offered passthrough Makefile.PLs on my Module::Build-based distros
> for
> the last few years, and they seem to have done what I needed them to do:
> stop
> Makefile.PL loyalists from taking up my time with complaints.
> 
> However, I recently saw this on cpan-testers-discuss from David Golden:
> 
>     http://markmail.org/message/jzzobzsrgc6vi7tr
> 
>     Module::Build::Compat must die. 
> 
> I've got a distro that requires Perl 5.8.3 or greater that's currently
> got a
> passthrough Makefile.PL.  Should I zap it?  Would that help anyone out,
> at the
> cost of possibly bringing up the noise floor by some unknown amount on my
> support lists?

One idea that I had to use instead of 'passthrough', now that we have an
ability to bundle Module::Build, is to make an additional option to
Module::Build::Compat that is an extension of 'small' that uses a
bundled Module::Build.

I've put up an initial patch (I don't have commit on svn.perl.org -
(Continue reading)

Scott Renner | 27 Jan 2010 02:27
Picon

Bug Tracker #53478 and HTML documentation

Hello,

 

I recently encountered a problem with the tarballs generated by Module::Build reported a bug a few weeks ago.  I got a mail the next  morning that it had recently been fixed.   Thanks!!!

 

I noticed bug #53478 “Diffs with Active State HTML generation and PPM compatibility” because  I am working on a utility to fix broken links in the HTML documentation that are caused by a variety of reasons (mostly due to pod2html inability to figure out links correctly.)   Anyway,  I have become very familiar with ActiveState HTML generation routines (and pod2html) and have come up with fixes for Module::Build that will address all of the HTML generation issues, including the generation of the Table of Contents on  ActivePerl installations.  

 

The fixes are pretty simple and I’ve attached Module::Build::Base.pm with my the changes.  The changes are based on build 0.3603, with a new version of 0.36031.

 

I’ve tested quite a bit (doing a variety builds, install, ppminstall, dist, ppmdist, etc.) and everything works as it should, but I am limited to Windows for testing.   I’ve tested on Perl 5.8 and 5.10 (both AS and standard). 

 

With these updates, there is no need to make changes to EU:Install  to get the html documentation working properly on any type of installation. 

 

Here is a summary of the changes….

 

In the section setting default properties… (line 929)

 

Deleted the property “html_css”, it is no longer needed or used.

 

sub _is_ActivePerl (line 3034)

 

New method that returns true if running on an ActivePerl installation.  Is set using the same eval (require ActivePerl::DocTools) that was used to set the property “html_css”.    This is not a property because its value needs to be determined when the installation is run, not the value on the  system that built the package. 

 

sub ACTION_manpages (line 3039)

 

I removed the check to see if there are any files to process, because this is performed in both the ‘manify’ subs.  No point in doing the check twice.

 

sub ACTION_html (line 3133)

 

I also optimized this sub as well.   ‘htmlify_pods’ checks if there are no files to process, so there really isn’t any point in doing the check here too.

 

Sub htmlify_pods (line 3172)

               

I saw the comment that says “Links to other modules are not being generated” and saw the problem.  The original code uses “$self->blib” as the “podroot” and “podpath” only points to directories in “blib”.   “podroot” must be the absolute path to the directory where the installed pod files are stored, and “podpath” can be relative directories off of podroot, plus an absolute path to the “blib” directory.    With this code,  all links are generated properly. 

 

If $self->_is_ActivePerl is true, we use ActivePerl::DocTools::Pod::pod2html to generate the HTML documentation, otherwise we use Pod::Html:pod2html to create it.  The ActivePerl version also uses Pod::Html::pod2html, but then does some post processing on the HTML files to format them in the ActivePerl style.

 

I also added code to do some cleanup on the html files after they are generated by pod2html.    The generated HTML is NOT XHMTL, so the DOCTYPE is wrong.  IE6+ will not display the page if it does not pass validation based on the DOCTYPE.  Local pages also need this statement in the <HEAD> “<!-- saved from url=(0017)http://localhost/ -->” for IE6+ to load local html pages (file://) if certain security settings on the user’s PC are strict.  Lastly anchor references to html pages within the package point to the “blib” directory.  These are fixed up so they point to where they will be after they are installed.

 

sub ACTION_install (line 3357)

 

Added logic to check if ‘$self->is_ActivePerl’ is true, and run ActivePerl::DocTools::WriteTOC().  WriteTOC() is the ActivePerl routine that updates the ActivePerl Table of Contents page and must be run AFTER the all the html files have been installed.

 

sub ACTION_ppmdist (line 3515)

 

You don’t need to generate HTML documentation when creating a PPM distribution, because it is generated automatically by the ppm client at install.   This is noted in the fact that “libdoc” and “bindoc” are set to “undef”.   I commented out the lines that generate the HTML. 

 

sub install_map (line 4830)

 

Added some logic so that man pages are not installed unless you are running on a Unix like operating system. 

 

Feel free to use these changes and to contact me if you have any questions or comments.  I’m glad to help in any way I can.

 

Scott Renner

 

Attachment (Base.36031.pm): application/octet-stream, 149 KiB
David Golden | 28 Jan 2010 15:05
Picon
Gravatar

Re: Bug Tracker #53478 and HTML documentation

Scott -- that sounds like a great analysis and bit of work.  I'm not
doing any non-critical M::B patching at the moment, so could you
please add your comments and patch to the RT#53478 ticket so it
doesn't get lost?

Thanks,
David

On Tue, Jan 26, 2010 at 8:27 PM, Scott Renner <srenner <at> comcast.net> wrote:
> Hello,
>
>
>
> I recently encountered a problem with the tarballs generated by
> Module::Build reported a bug a few weeks ago.  I got a mail the next
>  morning that it had recently been fixed.   Thanks!!!
>
>
>
> I noticed bug #53478 “Diffs with Active State HTML generation and PPM
> compatibility” because  I am working on a utility to fix broken links in the
> HTML documentation that are caused by a variety of reasons (mostly due to
> pod2html inability to figure out links correctly.)   Anyway,  I have become
> very familiar with ActiveState HTML generation routines (and pod2html) and
> have come up with fixes for Module::Build that will address all of the HTML
> generation issues, including the generation of the Table of Contents on
>  ActivePerl installations.
>
>
>
> The fixes are pretty simple and I’ve attached Module::Build::Base.pm with my
> the changes.  The changes are based on build 0.3603, with a new version of
> 0.36031.
>
>
>
> I’ve tested quite a bit (doing a variety builds, install, ppminstall, dist,
> ppmdist, etc.) and everything works as it should, but I am limited to
> Windows for testing.   I’ve tested on Perl 5.8 and 5.10 (both AS and
> standard).
>
>
>
> With these updates, there is no need to make changes to EU:Install  to get
> the html documentation working properly on any type of installation.
>
>
>
> Here is a summary of the changes….
>
>
>
> In the section setting default properties… (line 929)
>
>
>
> Deleted the property “html_css”, it is no longer needed or used.
>
>
>
> sub _is_ActivePerl (line 3034)
>
>
>
> New method that returns true if running on an ActivePerl installation.  Is
> set using the same eval (require ActivePerl::DocTools) that was used to set
> the property “html_css”.    This is not a property because its value needs
> to be determined when the installation is run, not the value on the  system
> that built the package.
>
>
>
> sub ACTION_manpages (line 3039)
>
>
>
> I removed the check to see if there are any files to process, because this
> is performed in both the ‘manify’ subs.  No point in doing the check twice.
>
>
>
> sub ACTION_html (line 3133)
>
>
>
> I also optimized this sub as well.   ‘htmlify_pods’ checks if there are no
> files to process, so there really isn’t any point in doing the check here
> too.
>
>
>
> Sub htmlify_pods (line 3172)
>
>
>
> I saw the comment that says “Links to other modules are not being generated”
> and saw the problem.  The original code uses “$self->blib” as the “podroot”
> and “podpath” only points to directories in “blib”.   “podroot” must be the
> absolute path to the directory where the installed pod files are stored, and
> “podpath” can be relative directories off of podroot, plus an absolute path
> to the “blib” directory.    With this code,  all links are generated
> properly.
>
>
>
> If $self->_is_ActivePerl is true, we use ActivePerl::DocTools::Pod::pod2html
> to generate the HTML documentation, otherwise we use Pod::Html:pod2html to
> create it.  The ActivePerl version also uses Pod::Html::pod2html, but then
> does some post processing on the HTML files to format them in the ActivePerl
> style.
>
>
>
> I also added code to do some cleanup on the html files after they are
> generated by pod2html.    The generated HTML is NOT XHMTL, so the DOCTYPE is
> wrong.  IE6+ will not display the page if it does not pass validation based
> on the DOCTYPE.  Local pages also need this statement in the <HEAD> “<!--
> saved from url=(0017)http://localhost/ -->” for IE6+ to load local html
> pages (file://) if certain security settings on the user’s PC are strict.
> Lastly anchor references to html pages within the package point to the
> “blib” directory.  These are fixed up so they point to where they will be
> after they are installed.
>
>
>
> sub ACTION_install (line 3357)
>
>
>
> Added logic to check if ‘$self->is_ActivePerl’ is true, and run
> ActivePerl::DocTools::WriteTOC().  WriteTOC() is the ActivePerl routine that
> updates the ActivePerl Table of Contents page and must be run AFTER the all
> the html files have been installed.
>
>
>
> sub ACTION_ppmdist (line 3515)
>
>
>
> You don’t need to generate HTML documentation when creating a PPM
> distribution, because it is generated automatically by the ppm client at
> install.   This is noted in the fact that “libdoc” and “bindoc” are set to
> “undef”.   I commented out the lines that generate the HTML.
>
>
>
> sub install_map (line 4830)
>
>
>
> Added some logic so that man pages are not installed unless you are running
> on a Unix like operating system.
>
>
>
> Feel free to use these changes and to contact me if you have any questions
> or comments.  I’m glad to help in any way I can.
>
>
>
> Scott Renner
>
>


Gmane