You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Doug MacEachern <do...@covalent.net> on 2002/07/01 00:54:09 UTC

Re: Apache::Test: changing the order of loading extra things at httpd.conf

+1

On Thu, 27 Jun 2002, Stas Bekman wrote:

> 
> Currently we have the following order in the autogenerated httpd.conf:
> 
> Include "t/conf/extra.conf"
> [ response config sections come here]
> PerlSwitches -Mlib=t
> PerlRequire t/conf/modperl_startup.pl
> 
> so if extra.conf is trying to preloading some Perl module, it won't do 
> the right thing because @INC is not adjusted at this point yet to point 
> to the dev libs. which in the best case fail, and the worse case it'll 
> use the wrong previously installed system-wide module.
> 
> I suggest the following order:
> 
> PerlSwitches -Mlib=t
> PerlRequire t/conf/modperl_startup.pl
> Include "t/conf/extra.conf"
> [ response config sections come here]
> 
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Apache::Test: changing the order of loading extra things at httpd.conf

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> 
>>
>> and 2.0 doesn't have perl sections yet :(
>>
>>> any thoughts on using the blib pragma over the various use lib stuff 
>>> in modperl_inc.pl?
>>
>>
>>
>> I think we need to rethink the whole concept of how Apache::Test and 
>> its elements manipulate @INC. What are the demands from you Geoff, as 
>> its user?
> 
> 
> 
> ok, the only thing I've seen that Apache::Test doesn't handle gracefully 
> in 1.3-land is the blib thing - I have lots of modules that use XS 
> (either by choice or via the directive handler API) and they all need 
> extra tweaking in order to run.
> 
> the problem is that the typical 1.3 way to handle this doesn't work - I 
> can't rely on startup.pl to set @INC because it comes after 
> extra.conf.in is loaded.
> 
> personally, I think the right way to handle this is to require no 
> tweaking by the end-user at all - if I can
> 
> # make install
> 
> and then
> 
> PerlModule My::Module
> 
> works using a standard mod_perl build, then Apache::Test should work 
> with only the PerlModule directive as well.

Yes, yes, I'm getting burned on the exact problem with 2.0 and modules 
in sub-dirs (which are like external modules, if I build from inside them).

> it seems to be that this is exactly what the blib pragma is for, but I 
> haven't tried taking out the stuff that Apache::Test writes in and only 
> using blib.
> 
> (I know, patches welcome, etc :)

Once Doug commits the new Apache2 magic, I'll try to resolve this 
problem. But I still need to know what should we do about @INC mungling, 
and Include ordering, because that's where the problem comes from.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Apache::Test: changing the order of loading extra things at httpd.conf

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> 
> and 2.0 doesn't have perl sections yet :(
> 
>> any thoughts on using the blib pragma over the various use lib stuff 
>> in modperl_inc.pl?
> 
> 
> I think we need to rethink the whole concept of how Apache::Test and its 
> elements manipulate @INC. What are the demands from you Geoff, as its user?


ok, the only thing I've seen that Apache::Test doesn't handle 
gracefully in 1.3-land is the blib thing - I have lots of modules that 
use XS (either by choice or via the directive handler API) and they 
all need extra tweaking in order to run.

the problem is that the typical 1.3 way to handle this doesn't work - 
I can't rely on startup.pl to set @INC because it comes after 
extra.conf.in is loaded.

personally, I think the right way to handle this is to require no 
tweaking by the end-user at all - if I can

# make install

and then

PerlModule My::Module

works using a standard mod_perl build, then Apache::Test should work 
with only the PerlModule directive as well.

it seems to be that this is exactly what the blib pragma is for, but I 
haven't tried taking out the stuff that Apache::Test writes in and 
only using blib.

(I know, patches welcome, etc :)

--Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Apache::Test: changing the order of loading extra things at httpd.conf

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> 
>>
>> This is not possible with the current way Apache::Test configures 
>> things. Since mod_perl's config hooks are run after the rest of the 
>> configuration is done,
>>
>> Include "t/conf/extra.conf"
>>
>> will always come up before mod_perl startup and other perl files. 
>> Perhaps we need to find a way for mod_perl or any other subproject to 
>> be able to supply a set of perl and conf files in a way that they will 
>> be grouped together?
>>
>> For example, during the SUPER::configure, don't configure files which 
>> start with a magic prefix or any prefix such that there is an '_' in 
>> it. And then mod_perl's configure will pickup the '_' files or files 
>> starting with the magic prefix. e.g. modperl_extra.conf.in
> 
> 
> 
> I ran (and still run) into this problem some time ago
> 
> http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=99010804314607&w=2
> 
> I've since been able to work around my particular problem by using
> 
> <Perl>
>   # stuff to get Apache::Test to recognize shared object files
>   use blib;
> </Perl>
> 
> in my extra.conf.in, though I think this runs in to trouble as well with 
> XS-based modules, which throw subroutine redefined warnings.

and 2.0 doesn't have perl sections yet :(

> any thoughts on using the blib pragma over the various use lib stuff in 
> modperl_inc.pl?

I think we need to rethink the whole concept of how Apache::Test and its 
elements manipulate @INC. What are the demands from you Geoff, as its user?

Now that you mention this my recent patch suggestion seems to be bogus 
since blindly adding Apache2/ to @INC will break testing of modules with 
mod_perl 1.0 if both 1.0 and 2.0 are installed.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Apache::Test: changing the order of loading extra things at httpd.conf

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> 
> This is not possible with the current way Apache::Test configures 
> things. Since mod_perl's config hooks are run after the rest of the 
> configuration is done,
> 
> Include "t/conf/extra.conf"
> 
> will always come up before mod_perl startup and other perl files. 
> Perhaps we need to find a way for mod_perl or any other subproject to be 
> able to supply a set of perl and conf files in a way that they will be 
> grouped together?
> 
> For example, during the SUPER::configure, don't configure files which 
> start with a magic prefix or any prefix such that there is an '_' in it. 
> And then mod_perl's configure will pickup the '_' files or files 
> starting with the magic prefix. e.g. modperl_extra.conf.in


I ran (and still run) into this problem some time ago

http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=99010804314607&w=2

I've since been able to work around my particular problem by using

<Perl>
   # stuff to get Apache::Test to recognize shared object files
   use blib;
</Perl>

in my extra.conf.in, though I think this runs in to trouble as well 
with XS-based modules, which throw subroutine redefined warnings.

any thoughts on using the blib pragma over the various use lib stuff 
in modperl_inc.pl?

HTH

--Geoff




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Apache::Test: changing the order of loading extra things at httpd.conf

Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:
> +1
> 
> On Thu, 27 Jun 2002, Stas Bekman wrote:
> 
> 
>>Currently we have the following order in the autogenerated httpd.conf:
>>
>>Include "t/conf/extra.conf"
>>[ response config sections come here]
>>PerlSwitches -Mlib=t
>>PerlRequire t/conf/modperl_startup.pl
>>
>>so if extra.conf is trying to preloading some Perl module, it won't do 
>>the right thing because @INC is not adjusted at this point yet to point 
>>to the dev libs. which in the best case fail, and the worse case it'll 
>>use the wrong previously installed system-wide module.
>>
>>I suggest the following order:
>>
>>PerlSwitches -Mlib=t
>>PerlRequire t/conf/modperl_startup.pl
>>Include "t/conf/extra.conf"
>>[ response config sections come here]

This is not possible with the current way Apache::Test configures 
things. Since mod_perl's config hooks are run after the rest of the 
configuration is done,

Include "t/conf/extra.conf"

will always come up before mod_perl startup and other perl files. 
Perhaps we need to find a way for mod_perl or any other subproject to be 
able to supply a set of perl and conf files in a way that they will be 
grouped together?

For example, during the SUPER::configure, don't configure files which 
start with a magic prefix or any prefix such that there is an '_' in it. 
And then mod_perl's configure will pickup the '_' files or files 
starting with the magic prefix. e.g. modperl_extra.conf.in




-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org