Brian Ingerson writes:
 > Kwindla Hultman Kramer wrote:
 > > 
 > > I settled on the following, as very nearly like a "site-install" (as
 > > long as the tmp_directory is set properly and 'make test' is run as
 > > root):
 > > 
 > >   use Inline C => $code,
 > >     DIRECTORY => XML::Comma->tmp_directory();
 > 
 > Kwindla,
 > 
 > I hope you don't mind me replying to the mailing list, but I feel all
 > should hear about this. I am not sure of exactly what you're doing here,
 > but I'm going to take a guess and offer you (all) some helpful advice.
 > 
 > 1) The " 'make test' is run as root" thing sets off some alarms. Let me
 > clarify this now: The Inline extension gets compiled at 'make' time, not
 > during 'make test'. This is an important distinction. Inline used to
 > build during 'make test' when you used SITE_INSTALL. This was a
 > quick-hack-solution on my part. I've felt for a long time that compiling
 > during 'make test' has a bad decision. If Inline is to replace XS, it
 > must do the right thing at the right time. 0.40 fixes all that. The
 > Inline::MakeMaker grabs control from ExtUtils::MakeMaker long enough to
 > insert a rule for building your extension at 'make' time.

I think it's great to talk about this stuff on the list, as long as
other people don't mind!

I'm actually doing something that Inline can't support as
"site-installable" (which you helped me understand in a previous
exchange). My modules 'use' other modules that may or may not have
Inline code in them from within an eval'ed string. This means that
they can't use Inline::MakeMaker.

So my work-around is to give Inline within this application a
DIRECTORY to always use, and to run 'make test' in such a way that
everyone will be sure to be able to read Inline's compiled output from
that standard directory. (That's the important part -- "run as root"
was just sloppy shorthand.)

This works really well for my application. There's no way for
Inline::MakeMaker to know how to install all the pieces that I could
be calling from inside the eval. But I know what all those pieces are,
for a given install, so I use ExtUtils::MakeMaker as in a normal
module, but write my tests such that, relying on the very nice
DIRECTORY parameter, everything that will be used gets pre-compiled
and put in a standard place.

Let me know if I'm still barking up the wrong tree,
Kwindla

Reply via email to