You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Matt Sergeant <ma...@sergeant.org> on 2003/07/16 16:36:34 UTC

Bug in Apache::Test - extra.conf included before modperl_inc.pl

The subject really says it all. The httpd.conf generated by Apache::Test
is broken because it has the Include extra.conf before the PerlRequire
modperl_startup.pl (which loads modperl_inc.pl).

This means that the currently installed module gets loaded (although for
some reason the right .pm file gets loaded). This breaks AxKit's use of
Apache::Test, because AxKit has XS code, so the XS code contains an older
version when it is installed than the .pm file in the local directory.

Simple fix is to make sure the Include comes last. I've hacked around this
now with a "fixup" routine which re-writes httpd.conf, because I spent
over an hour trying to dig around the Apache::Test sources to see if I
could locate where all this happens, but it's all a bit complex in there
(sorry!).

-- 
<!-- Matt -->
<:->get a SMart net</:->
Spam trap - do not mail: spam-sig@spamtrap.messagelabs.com

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


Re: Bug in Apache::Test - extra.conf included before modperl_inc.pl

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> On Saturday, July 19, 2003, at 10:21  AM, Matt Sergeant wrote:
> 
>> I would go with the latter. The situation of working with >1 httpd on 
>> the same system is reserved for guys like you and I, not the majority 
>> of people installing Apache::Test because it was a pre-requisite for 
>> things like Apache::Request. So just allow it to be overridden with a 
>> Makefile.PL argument.
> 
> 
> matt++ This makes al lot of sense to me.

it's not necessarily right that most people will have one httpd server. I 
think quite many people will have httpd 1.3 and httpd 2.0 installed on the 
same machine.

Otherwise I'm +1 on your idea, Matt. Though we will need to add some trickery 
so that Apache::Test will store this info when installed separately and when 
installed as part of mod_perl 2.0.

Another idea that I had is that Apache::Test will store the default on the 
first time it's used, rather than during the build time.

>> As for your earlier question, the docs for Apache::Test should be in 
>> the Apache::Test distribution, in the .pm file preferably. I would 
>> never think to look anywhere else, especially not the mod_perl guide 
>> for module docs.
> 
> 
> I'm in complete agreement on this, which is why I took it upon myself to 
> document Apache::TestRequest. You'll see the docs for that module in 
> CVS. Stas has also added some docs for Apache::TestMM, which will be 
> crucial for those of us upgrading from Apache::test. I think the 
> documentation of Apache::Test will happen slowly as motivated (or 
> annoyed) folks send in patches after struggling through it on their own.

Meanwhile we can add a pointer to the Apache::Test tutorial from Apache/Test.pm.

__________________________________________________________________
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: Bug in Apache::Test - extra.conf included before modperl_inc.pl

Posted by David Wheeler <da...@kineticode.com>.
On Saturday, July 19, 2003, at 10:21  AM, Matt Sergeant wrote:

> I would go with the latter. The situation of working with >1 httpd on 
> the same system is reserved for guys like you and I, not the majority 
> of people installing Apache::Test because it was a pre-requisite for 
> things like Apache::Request. So just allow it to be overridden with a 
> Makefile.PL argument.

matt++ This makes al lot of sense to me.

> As for your earlier question, the docs for Apache::Test should be in 
> the Apache::Test distribution, in the .pm file preferably. I would 
> never think to look anywhere else, especially not the mod_perl guide 
> for module docs.

I'm in complete agreement on this, which is why I took it upon myself 
to document Apache::TestRequest. You'll see the docs for that module in 
CVS. Stas has also added some docs for Apache::TestMM, which will be 
crucial for those of us upgrading from Apache::test. I think the 
documentation of Apache::Test will happen slowly as motivated (or 
annoyed) folks send in patches after struggling through it on their own.

Regards,

David

-- 
David Wheeler                                     AIM: dwTheory
david@kineticode.com                              ICQ: 15726394
http://kineticode.com/                         Yahoo!: dew7e
                                                Jabber: Theory@jabber.org
Kineticode. Setting knowledge in motion.[sm]


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


Re: Bug in Apache::Test - extra.conf included before modperl_inc.pl

Posted by Matt Sergeant <ma...@sergeant.org>.
On Friday, Jul 18, 2003, at 19:04 Europe/London, Stas Bekman wrote:

> Matt Sergeant wrote:
>> On Fri, 18 Jul 2003, Stas Bekman wrote:
>>> As for the prompt, it's probably only useful from within CPAN shell. 
>>> From the
>>> command line it's much better to have people pass this argument to
>>> Makefile.PL. Again if everybody sets their APXS env var in ~/.login, 
>>> then all
>>> the future testing using Apache::Test just works. Do you think it's 
>>> not worth
>>> to make people do this instead having an annoying prompt on each 
>>> module build?
>> Can't you store the value prompted for when you install Apache::Test,
>> rather than every time you generate a new t/TEST? That way you get
>> prompted *once* and never again (of course you have to provide a way 
>> to
>> change it if you move your httpd).
>
> If I have httpd-1.3 and httpd-2.0 on the same system, which one should 
> be chosen? Or do you suggest to just let the user to make a single 
> choice assuming that they will use only one most of the time and can 
> still override the default if they want to change it?
>
> Let's say that we store that value. Should this value be used as a 
> default suggestion in the prompt, when a user hasn't supplied an 
> explicit argument or should it be used without any prompt?

I would go with the latter. The situation of working with >1 httpd on 
the same system is reserved for guys like you and I, not the majority 
of people installing Apache::Test because it was a pre-requisite for 
things like Apache::Request. So just allow it to be overridden with a 
Makefile.PL argument.

As for your earlier question, the docs for Apache::Test should be in 
the Apache::Test distribution, in the .pm file preferably. I would 
never think to look anywhere else, especially not the mod_perl guide 
for module docs.

Matt.


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


Re: Bug in Apache::Test - extra.conf included before modperl_inc.pl

Posted by Stas Bekman <st...@stason.org>.
Matt Sergeant wrote:
> On Fri, 18 Jul 2003, Stas Bekman wrote:
> 
> 
>>As for the prompt, it's probably only useful from within CPAN shell. From the
>>command line it's much better to have people pass this argument to
>>Makefile.PL. Again if everybody sets their APXS env var in ~/.login, then all
>>the future testing using Apache::Test just works. Do you think it's not worth
>>to make people do this instead having an annoying prompt on each module build?
> 
> 
> Can't you store the value prompted for when you install Apache::Test,
> rather than every time you generate a new t/TEST? That way you get
> prompted *once* and never again (of course you have to provide a way to
> change it if you move your httpd).

If I have httpd-1.3 and httpd-2.0 on the same system, which one should be 
chosen? Or do you suggest to just let the user to make a single choice 
assuming that they will use only one most of the time and can still override 
the default if they want to change it?

Let's say that we store that value. Should this value be used as a default 
suggestion in the prompt, when a user hasn't supplied an explicit argument or 
should it be used without any prompt?



__________________________________________________________________
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: Bug in Apache::Test - extra.conf included before modperl_inc.pl

Posted by Matt Sergeant <ma...@sergeant.org>.
On Fri, 18 Jul 2003, Stas Bekman wrote:

> As for the prompt, it's probably only useful from within CPAN shell. From the
> command line it's much better to have people pass this argument to
> Makefile.PL. Again if everybody sets their APXS env var in ~/.login, then all
> the future testing using Apache::Test just works. Do you think it's not worth
> to make people do this instead having an annoying prompt on each module build?

Can't you store the value prompted for when you install Apache::Test,
rather than every time you generate a new t/TEST? That way you get
prompted *once* and never again (of course you have to provide a way to
change it if you move your httpd).

Matt.

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


Re: Bug in Apache::Test - extra.conf included before modperl_inc.pl

Posted by David Wheeler <da...@kineticode.com>.
On Friday, July 18, 2003, at 12:45  AM, Stas Bekman wrote:

> Agreed, that at this moment this is the weak side of Apache::Test. I 
> thought that once every Apache module will start using Apache::Test 
> people will set APACHE and/or APXS env vars in their ~/.login files 
> and everything will just work.

Personally, I would rather not pollute my environment with variables 
that will be meaningful only on those rare occasions when I'm 
installing an Apache module. An error message would be much more 
helpful.

Regards,

David

-- 
David Wheeler                                     AIM: dwTheory
david@kineticode.com                              ICQ: 15726394
http://kineticode.com/                         Yahoo!: dew7e
                                                Jabber: Theory@jabber.org
Kineticode. Setting knowledge in motion.[sm]


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


Re: Bug in Apache::Test - extra.conf included before modperl_inc.pl

Posted by Stas Bekman <st...@stason.org>.
Matt Sergeant wrote:
> On Thu, 17 Jul 2003, Stas Bekman wrote:
> 
> 
>>The problem is that it has to be first for the mod_perl test suite. Since
>>different projects have different needs, what I provided a way to have
>>includes to be added first or last. Geoff has given the answer, and it's
>>documented here:
>>
>>http://perl.apache.org/docs/general/testing/testing.html#Extending_Configuration_Setup
> 
> 
> Yes, that works. Is there any reason (besides tuits) that these docs
> aren't in the POD?

You mean it's not documented in the Apache::Test manpages? It's written in 
pod, see: modperl-docs/src/docs/general/testing/testing.pod.

> Also another gripe - wouldn't it be nicer to skip tests if httpd can't be
> found, rather than fail them? Or perhaps prompt to provide a path to
> httpd? And that value could be stored in t/TEST, so I don't have to set an
> environment variable every time I run the tests.
> 
> If this actually is available I couldn't find it documented in the POD,
> but more importantly, when httpd can't be found the error should say
> something about how you can fix the problem (setting env vars, or passing
> a flag, or just pointing to the right docs).

Agreed, that at this moment this is the weak side of Apache::Test. I thought 
that once every Apache module will start using Apache::Test people will set 
APACHE and/or APXS env vars in their ~/.login files and everything will just work.

The setting is already set in t/TEST if you autogenerate it. For example if 
you run:

Apache-Test> perl Makefile.PL -apxs /home/stas/httpd/prefork/bin/apxs
generating script t/TEST
Writing Makefile for Apache::Test

it adds to t/TEST:

%Apache::TestConfig::Argv = qw(apxs /home/stas/httpd/prefork/bin/apxs);

So you need to pass -apxs or to have:

APXS=foo perl Makefile.PL

only during the config phase.

As for the prompt, it's probably only useful from within CPAN shell. From the 
command line it's much better to have people pass this argument to 
Makefile.PL. Again if everybody sets their APXS env var in ~/.login, then all 
the future testing using Apache::Test just works. Do you think it's not worth 
to make people do this instead having an annoying prompt on each module build?

As for the making the error message more useful, you are correct. This needs 
to be improved.

> Again, sorry for no patch. I'll buy you a beer in Paris instead, Stas.

;)

__________________________________________________________________
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: Bug in Apache::Test - extra.conf included before modperl_inc.pl

Posted by Matt Sergeant <ma...@sergeant.org>.
On Thu, 17 Jul 2003, Stas Bekman wrote:

> The problem is that it has to be first for the mod_perl test suite. Since
> different projects have different needs, what I provided a way to have
> includes to be added first or last. Geoff has given the answer, and it's
> documented here:
>
> http://perl.apache.org/docs/general/testing/testing.html#Extending_Configuration_Setup

Yes, that works. Is there any reason (besides tuits) that these docs
aren't in the POD?

Also another gripe - wouldn't it be nicer to skip tests if httpd can't be
found, rather than fail them? Or perhaps prompt to provide a path to
httpd? And that value could be stored in t/TEST, so I don't have to set an
environment variable every time I run the tests.

If this actually is available I couldn't find it documented in the POD,
but more importantly, when httpd can't be found the error should say
something about how you can fix the problem (setting env vars, or passing
a flag, or just pointing to the right docs).

Again, sorry for no patch. I'll buy you a beer in Paris instead, Stas.

-- 
<!-- Matt -->
<:->get a SMart net</:->
Spam trap - do not mail: spam-sig@spamtrap.messagelabs.com

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


Re: Bug in Apache::Test - extra.conf included before modperl_inc.pl

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>>The subject really says it all. The httpd.conf generated by
>>Apache::Test is broken
> 
> because it has the Include extra.conf before the
> 
>>PerlRequire modperl_startup.pl
> 
> (which loads modperl_inc.pl).
> 
>>This means that the currently installed module gets
> 
> loaded (although
> 
>>for some reason the right .pm file gets loaded). This breaks AxKit's
>>
> 
> use of Apache::Test, because AxKit has XS code, so the XS code contains
> 
>>an older version
> 
> when it is installed than the .pm file in the local
> 
>>directory.
> 
> 
> I've been griping about
> this for as long as I can remember.
> 
> the short (or long) term solution is to use
> extra.last.conf.in instead of extra.conf.in.  the archives should have the
> details.

The problem is that it has to be first for the mod_perl test suite. Since 
different projects have different needs, what I provided a way to have 
includes to be added first or last. Geoff has given the answer, and it's 
documented here:

http://perl.apache.org/docs/general/testing/testing.html#Extending_Configuration_Setup


-- 


__________________________________________________________________
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: Bug in Apache::Test - extra.conf included before modperl_inc.pl

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> The subject really says it all. The httpd.conf generated by
> Apache::Test is broken
because it has the Include extra.conf before the
> PerlRequire modperl_startup.pl
(which loads modperl_inc.pl).
>
> This means that the currently installed module gets
loaded (although
> for some reason the right .pm file gets loaded). This breaks AxKit's
>
use of Apache::Test, because AxKit has XS code, so the XS code contains
> an older version
when it is installed than the .pm file in the local
> directory.

I've been griping about
this for as long as I can remember.

the short (or long) term solution is to use
extra.last.conf.in instead of extra.conf.in.  the archives should have the
details.

HTH

--Geoff



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