Tue May 27 10:16:00 2014: Request 95809 was acted upon. Transaction: Correspondence added by s...@parasite.cc Queue: Inline Subject: Re: [rt.cpan.org #95809] [PATCH] Using Inline in a distribution with multiple modules Broken in: (no value) Severity: (no value) Owner: Nobody Requestors: s...@parasite.cc Status: open Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=95809 >
On Mon, 26 May 2014 20:17:11 -0400 "sisyph...@optusnet.com.au via RT" <bug-inl...@rt.cpan.org> wrote: > <URL: https://rt.cpan.org/Ticket/Display.html?id=95809 > > > -----Original Message----- > From: Jason McCarver via RT > Incidentally, it only takes for Foo.pm to "use Foo::Bar;" and "use > Foo::Bar::Baz;" and the version *you* sent would also build and install as > desired. (Though in that case, every time I run 'dmake', 'dmake test' and > 'dmake install' the C code recompiles - but it results in a correct install > in the end.) Yes that makes sense since the XS gets built/compiled when the module is initially 'use'ed. > The distro you sent is tantalisingly close to working .... Please forgive the following rambling .. it's more of a stream of conscience and less than fully thought out :) I think the underlying problem here is how does Inline::MakeMaker know which modules need to be 'use'ed as part of the make process. The way it works without the patch is by relying on the fact that Inline::MakeMaker is being used in place of ExtUtils::MakeMaker. I believe I::MM currently makes the following assumptions: - There is one perl module per Makefile.PL (the layout you prefer I believe) - That module needs to be 'use'ed during 'make' For your layout these assumptions are fine. This basically means that the programmer is explicitly telling I::MM which modules to process by using I::MM instead of ExtUtils::MakeMaker But for the layout I'm using that doesn't work so then it's back to how does I::MM know which modules need to be 'use'ed. My attempt at a solution was to force the programmer to explicitly tell I::MM by way of the INLINE_MODULES argument. I do agree it would be better to not have to do that. However I believe that would mean one of the following would need to be done: - shotgun approach and 'use' all modules in the distribution (seems ugly, possibly error-prone) - scan all modules somehow to find the ones that are using 'Inline' and just 'use' them during the 'make' process. Also error-prone. It seems like the second of those might be doable but I'm not sure how ugly that would be :) And of course I could be way off here, still trying to learn as I go with Inline. Jason