in reply to Clean smoke-test install for Inline based modules using Inline::MakeMaker

I think you might be the only one using Inline::MakeMaker for a cpan distribution :)

"Inline::MakeMaker" site:search.cpan.org

I think the solution might be to simply inline Inline::MakeMaker into Makefile.PL, and maybe add

use ExtUtils::MakeMaker 6.49_01 ();

Or, switch to http://search.cpan.org/perldoc/Module::Install#Module::Install::Inline

  • Comment on Re: Clean smoke-test install for Inline based modules using Inline::MakeMaker
  • Download Code

Replies are listed 'Best First'.
Re^2: Clean smoke-test install for Inline based modules using Inline::MakeMaker
by Anonymous Monk on Dec 14, 2011 at 19:36 UTC

    Yup, unless you have Inline::MakeMaker, none of

    $ pmvers CPANPLUS CPAN CPANPLUS: 0.9111 CPAN: 1.9800

    will try to install Inline::MakeMaker after Makefile.PL dies. I doubt they consult META.json (cpanm might).

    So yeah, I think the inline approach is definitely the ticket :)

      I doubt they consult META.json

      What davido has presented here is a specific example of a more general problem.

      If a Makefile.PL contains:
      use Foo;
      how is the cpan shell then supposed to know (*before* executing that Makefile.PL) that it needs to check whether Foo.pm is installed (and immediately run off and install Foo.pm if it's not).
      I would expect that there should be *some* way of effecting this.

      Otherwise, any distro that use's a non-core module in its Makefile.PL runs the risk of being hammered in exactly the same way as davido's module.

      Cheers,
      Rob

        The purpose of CONFIGURE_REQUIRES (ExtUtils::MakeMaker and Inline::MakeMaker) seems to be to get a dependency listed in the META.json and META.yml files when the author executes make dist such that the dependency is pulled in by cpan before the target system executes Makefile.PL

        At least that's what I gather by reading the docs for cpan.pm and ExtUtils::MakeMaker. As has been pointed out elsewhere in this thread earlier versions of ExtUtils::MakeMaker (and probably Inline::MakeMaker) didn't support the CONFIGURE_REQUIRES directive. But my theory is that if the distribution is built with a modern version, and if the CONFIGURE_REQUIRES specifies a more modern version of *::MakeMaker, those dependencies will be pulled in ahead of the target system actually running Makefile.PL.

        I believe the other mistake I was making was listing 'Inline' as the BUILD_REQUIRES dependency. I believe BUILD_REQUIRES is "too late", whereas CONFIGURE_REQURIES directs an earlier stage in the process. By re-reading the MakeMaker docs I also see that the dependency should list modules (such as Inline::MakeMaker), not distributions (such as Inline, which includes the Inline::MakeMaker module). I had thought that Inline would pull in Inline::MakeMaker. But the docs are pretty clear that the module should be listed.

        I've made a new attempt for Math::Prime::FastSieve wherein I'm specifying Inline::MakeMaker 0.45 and ExtUtils::MakeMaker 6.62 as CONFIGURE_REQUIRES modules. I believe that by specifying CONFIGURE_REQUIRES when creating the distribution, and by specifying modern versions of those required modules, the cpan shell should pick up on this and upgrade those modules. The docs for cpan.pm do mention that cpan reads the META.yml file to detect dependencies.

        Within a couple of days enough smoke tests should trickle in that I'll have a better idea if this fixes the issue. If not, I may have to shift gears to Module::Install, or inline Inline::MakeMaker's code into Makefile.PL. Neither of those approaches seem anywhere near optimal; Module::Install adds yet another dependency that is outside of the Inline realm, and inlining additional code into Makefile.PL is going to become a kludge.

        I'll report back once I see how the smoke tests turn out. As I mentioned on the Inline mailing list, once we determine what steps are needed we'll want to get Inline's documentation updated to assist the next guy to come along.


        Dave

        Hammered? Its much ado about nothing

        SmokeTesters Complain of Missing Dependencies Which a Module's Makefile.PL Requires

        http://wiki.cpantesters.org/wiki/CPANAuthorNotes

        #!/usr/bin/perl -- BEGIN { unless( eval { require Inline::MakeMaker; 1; } ){ warn "Warning: prerequisite Inline::MakeMaker 0 not found.\n"; exit 0; } }

        #!/usr/bin/perl -- use ExtUtils::MakeMaker(); if( eval { require Inline::MakeMaker; 1; } ) { *WriteMakefile = \Inline::MakeMaker::WriteMakefile; } else { *WriteMakefile = \&ExtUtils::MakeMaker::WriteMakefile; } WriteMakefile( ... PREREQ_PM => { 'Inline::CPP' => 0.33, 'Inline::MakeMaker' => 0, ... }, )

        But its a whole bunch of effort to avoid some Makefile.PL boilerplate (the essence of Inline::MakeMaker), or switching to Module::Install