coppit has asked for the wisdom of the Perl Monks concerning the following question:

This is a question for Module::Install gurus.

I've created a Module::Install extension called Module::Install::CustomInstallationPath. This module requires the non-standard module File::HomeDir.

Now let's say that in module FOO I use my M::I::CustomInstallationPath extension. Module::Install correctly determines that I use the extension and puts the necessary files in inc/. However, it doesn't put the files for the dependent File::HomeDir module in inc/ as well.

Shouldn't Module::Install recursively scan extensions and include any non-standard modules into the inc/ directory?

This seems like a bug to me. I've emailed the authors and am waiting for a response. In the meantime, is there a way to figure out which Module::Install extensions are needed by the FOO module, so I can run include_deps on them? Unfortunately it looks like Module::Install deletes the loaded module from %INC.

  • Comment on How to get Module::Install to follow dependencies in extensions?

Replies are listed 'Best First'.
Re: How to get Module::Install to follow dependencies in extensions?
by PodMaster (Abbot) on Sep 16, 2004 at 06:09 UTC
    How? In pod I see
    auto_include_deps(); # same as above, plus recursive dependencies
    is that not working for you (is that what you're using)?

    BTW - I don't use Module::Install and AFAIK, there is only one "guru" (the author).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      auto_include_deps requires me to use build_requires. This means I have to know which Module::Install extensions my Makefile.PL uses. This breaks the philosophy of Module::Install. Instead, I'm doing this:
      requires ( 'perl' => 5.00503 ); # For some reason, Module::Install doesn't detect dependent modules of # extensions. :( Include_Dependencies_Of_Extensions(); ... sub Include_Dependencies_Of_Extensions { # These don't have non-core dependencies (presumably) my @module_install_modules = qw( Module::Install::AutoInstall Module::Install::Base Module::Install +::Build Module::Install::Bundle Module::Install::Can Module::Install::Fetc +h Module::Install::Include Module::Install::Inline Module::Install:: +InstallDirs Module::Install::Makefile Module::Install::Makefile::Name Module::Install::Makefile::Version Module::Install::MakeMaker Module::Install::Metadata Module::Install::PAR Module::Install::Ru +n Module::Install::Scripts Module::Install::Skip Module::Install::Wi +n32 Module::Install::WriteAll ); foreach my $included_file (<inc/Module/Install/*.pm>, <inc/Module/Install/PRIVATE/*.pm>,<inc/Module/Install/PRIVATE.*pm> +) { my $module = $included_file; $module =~ s#^inc/(.*)\.pm$#$1#; $module =~ s#/#::#g; next if grep { $_ eq $module } @module_install_modules; print "--> Including dependent modules for non-standard Module::In +stall extension $module\n"; include_deps($module); } }
      Actually, now that I think about it, it might be better to just fix the bug and submit a patch. Until it's accepted, I can store the patched module in Module::Install::PRIVATE. (Although it would be nice if the author would confirm that it's a bug... sigh)
        I was cruising through the other modules in Module::Install, and I noticed "$self->include_deps('Foo')" in an extension. So, in every method in an Module::Install::Bar extension, call include_deps explicitly to tell Module::Install that the dependency must be in inc/ in order for that method to work.

        Cool!