Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Dev

[patch] http://rt.cpan.org/Public/Bug/Display.html?id=21554

 

 

ModPerl dev RSS feed   Index | Next | Previous | View Threaded


fred at redhotpenguin

Apr 19, 2009, 1:53 AM

Post #1 of 5 (2920 views)
Permalink
[patch] http://rt.cpan.org/Public/Bug/Display.html?id=21554

This seems like a reasonable request. I know there are a few times
that I had to put the apreq module load in extra.conf.in, and it would
have been nice to have things magically 'just work'. I only have one
modperl application that does not use libapreq, and I think that I
wouldn't mind the extra module loaded during testing.

OTOH I don't think this qualifies as a 'critical' bug. But any
thoughts or issues with this patch?

Index: lib/Apache/TestRunPerl.pm
===================================================================
--- lib/Apache/TestRunPerl.pm (revision 766433)
+++ lib/Apache/TestRunPerl.pm (working copy)
@@ -73,6 +73,22 @@
Apache::TestRun::exit_perl(0);
}

+ if ($rev == 2) {
+ # load apreq2 if it is present
+ # do things a bit differently that find_and_load_module()
+ # because apreq2 can't be loaded that way (the 2 causes a problem)
+ my $name = 'mod_apreq2.so';
+ my $mod_path = $test_config->find_apache_module($name) or return;
+
+ # don't match the 2 here
+ my ($sym) = $name =~ m/mod_(\w+)2\./;
+
+ if ($mod_path && -e $mod_path) {
+ $test_config->preamble(IfModule => "!mod_$sym.c",
+ qq{LoadModule ${sym}_module "$mod_path"\n});
+ }
+ }
+
$test_config->preamble_register(qw(configure_libmodperl
configure_env));

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe [at] perl
For additional commands, e-mail: dev-help [at] perl


adam.prime at utoronto

Apr 19, 2009, 6:57 AM

Post #2 of 5 (2740 views)
Permalink
Re: [patch] http://rt.cpan.org/Public/Bug/Display.html?id=21554 [In reply to]

Fred Moyer wrote:
> This seems like a reasonable request. I know there are a few times
> that I had to put the apreq module load in extra.conf.in, and it would
> have been nice to have things magically 'just work'. I only have one
> modperl application that does not use libapreq, and I think that I
> wouldn't mind the extra module loaded during testing.
>
> OTOH I don't think this qualifies as a 'critical' bug. But any
> thoughts or issues with this patch?

It sounds to me like the httpd.conf that A::T is parsing isn't actually
the httpd.conf that they use in production, and doesn't have the
LoadModule for apreq2 in it. According to the documentation you can
override the conf parsed by A::T using this:

perl Makefile.PL -httpd_conf /path/to/httpd.conf

I don't really think that this patch is strictly required (assuming that
running Makefile.PL as describe above works), but I also doubt that it's
going to cause more problems than it fixes for people that don't know
about, or haven't read the documentation.

I bet a lot of people installing modules from the cpan shell run into
problems like this. I know i have since i often put my real httpd.conf
/www/conf, while the default is in /usr/local/prefork/conf.

Adam

>
> Index: lib/Apache/TestRunPerl.pm
> ===================================================================
> --- lib/Apache/TestRunPerl.pm (revision 766433)
> +++ lib/Apache/TestRunPerl.pm (working copy)
> @@ -73,6 +73,22 @@
> Apache::TestRun::exit_perl(0);
> }
>
> + if ($rev == 2) {
> + # load apreq2 if it is present
> + # do things a bit differently that find_and_load_module()
> + # because apreq2 can't be loaded that way (the 2 causes a problem)
> + my $name = 'mod_apreq2.so';
> + my $mod_path = $test_config->find_apache_module($name) or return;
> +
> + # don't match the 2 here
> + my ($sym) = $name =~ m/mod_(\w+)2\./;
> +
> + if ($mod_path && -e $mod_path) {
> + $test_config->preamble(IfModule => "!mod_$sym.c",
> + qq{LoadModule ${sym}_module "$mod_path"\n});
> + }
> + }
> +
> $test_config->preamble_register(qw(configure_libmodperl
> configure_env));
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe [at] perl
> For additional commands, e-mail: dev-help [at] perl
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe [at] perl
For additional commands, e-mail: dev-help [at] perl


fred at redhotpenguin

Apr 19, 2009, 12:12 PM

Post #3 of 5 (2732 views)
Permalink
Re: [patch] http://rt.cpan.org/Public/Bug/Display.html?id=21554 [In reply to]

On Sun, Apr 19, 2009 at 6:57 AM, Adam Prime <adam.prime [at] utoronto> wrote:
> Fred Moyer wrote:
>>
>> This seems like a reasonable request.  I know there are a few times
>> that I had to put the apreq module load in extra.conf.in, and it would
>> have been nice to have things magically 'just work'.  I only have one
>> modperl application that does not use libapreq, and I think that I
>> wouldn't mind the extra module loaded during testing.
>>
>> OTOH I don't think this qualifies as a 'critical' bug.  But any
>> thoughts or issues with this patch?
>
> It sounds to me like the httpd.conf that A::T is parsing isn't actually the
> httpd.conf that they use in production, and doesn't have the LoadModule for
> apreq2 in it.  According to the documentation you can override the conf
> parsed by A::T using this:
>
> perl Makefile.PL -httpd_conf /path/to/httpd.conf
>
> I don't really think that this patch is strictly required (assuming that
> running Makefile.PL as describe above works), but I also doubt that it's
> going to cause more problems than it fixes for people that don't know about,
> or haven't read the documentation.
>
> I bet a lot of people installing modules from the cpan shell run into
> problems like this.  I know i have since i often put my real httpd.conf
> /www/conf, while the default is in /usr/local/prefork/conf.


Configuring Apache::Test is not easy (drawing from my own personal
experiences and comments on RT tickets, etc), so I think that making
some changes like this so that it 'just works' in more situations is a
prudent move. We don't want A::T to become bloated, but I think we
are very much on the lean side, and could use some changes to make it
easier to use. I think people recognize the cool factor of
Apache::Test, but have a hard time figuring out all the nuances.






>
> Adam
>
>>
>> Index: lib/Apache/TestRunPerl.pm
>> ===================================================================
>> --- lib/Apache/TestRunPerl.pm   (revision 766433)
>> +++ lib/Apache/TestRunPerl.pm   (working copy)
>> @@ -73,6 +73,22 @@
>>         Apache::TestRun::exit_perl(0);
>>     }
>>
>> +    if ($rev == 2) {
>> +        # load apreq2 if it is present
>> +        # do things a bit differently that find_and_load_module()
>> +        # because apreq2 can't be loaded that way (the 2 causes a
>> problem)
>> +        my $name = 'mod_apreq2.so';
>> +        my $mod_path = $test_config->find_apache_module($name) or return;
>> +
>> +        # don't match the 2 here
>> +        my ($sym) = $name =~ m/mod_(\w+)2\./;
>> +
>> +        if ($mod_path && -e $mod_path) {
>> +            $test_config->preamble(IfModule => "!mod_$sym.c",
>> +                        qq{LoadModule ${sym}_module "$mod_path"\n});
>> +        }
>> +    }
>> +
>>     $test_config->preamble_register(qw(configure_libmodperl
>>                                        configure_env));
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe [at] perl
>> For additional commands, e-mail: dev-help [at] perl
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe [at] perl
> For additional commands, e-mail: dev-help [at] perl
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe [at] perl
For additional commands, e-mail: dev-help [at] perl


adam.prime at utoronto

Apr 20, 2009, 10:15 AM

Post #4 of 5 (2747 views)
Permalink
Re: [patch] http://rt.cpan.org/Public/Bug/Display.html?id=21554 [In reply to]

Fred Moyer wrote:
>> Fred Moyer wrote:
>
>
> Configuring Apache::Test is not easy (drawing from my own personal
> experiences and comments on RT tickets, etc), so I think that making
> some changes like this so that it 'just works' in more situations is a
> prudent move. We don't want A::T to become bloated, but I think we
> are very much on the lean side, and could use some changes to make it
> easier to use. I think people recognize the cool factor of
> Apache::Test, but have a hard time figuring out all the nuances.

Agreed.

Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe [at] perl
For additional commands, e-mail: dev-help [at] perl


fred at redhotpenguin

Apr 21, 2009, 7:16 PM

Post #5 of 5 (2728 views)
Permalink
Re: [patch] http://rt.cpan.org/Public/Bug/Display.html?id=21554 [In reply to]

Any other thoughts on this from the dev list (Adam commented on this
thread already)? Here's a copy of the diff again. This was marked as
a critical bug for Apache::Test, but I moved it to wishlist (since it
is an enhancement).

There are currently 4 open RT tickets for Apache::Test, this is one of
them. The other three probably need to cook longer before the
version.pm issues are ironed out. This is down from 9 open tickets a
week ago, I've managed to resolve a lot of them.

Index: lib/Apache/TestRunPerl.pm
===================================================================
--- lib/Apache/TestRunPerl.pm (revision 766433)
+++ lib/Apache/TestRunPerl.pm (working copy)
@@ -73,6 +73,22 @@
Apache::TestRun::exit_perl(0);
}

+ if ($rev == 2) {
+ # load apreq2 if it is present
+ # do things a bit differently that find_and_load_module()
+ # because apreq2 can't be loaded that way (the 2 causes a problem)
+ my $name = 'mod_apreq2.so';
+ my $mod_path = $test_config->find_apache_module($name) or return;
+
+ # don't match the 2 here
+ my ($sym) = $name =~ m/mod_(\w+)2\./;
+
+ if ($mod_path && -e $mod_path) {
+ $test_config->preamble(IfModule => "!mod_$sym.c",
+ qq{LoadModule ${sym}_module "$mod_path"\n});
+ }
+ }
+
$test_config->preamble_register(qw(configure_libmodperl
configure_env));

On Mon, Apr 20, 2009 at 10:15 AM, Adam Prime <adam.prime [at] utoronto> wrote:
> Fred Moyer wrote:
>>>
>>> Fred Moyer wrote:
>>
>>
>> Configuring Apache::Test is not easy (drawing from my own personal
>> experiences and comments on RT tickets, etc), so I think that making
>> some changes like this so that it 'just works' in more situations is a
>> prudent move.  We don't want A::T to become bloated, but I think we
>> are very much on the lean side, and could use some changes to make it
>> easier to use.  I think people recognize the cool factor of
>> Apache::Test, but have a hard time figuring out all the nuances.
>
> Agreed.
>
> Adam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe [at] perl
> For additional commands, e-mail: dev-help [at] perl
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe [at] perl
For additional commands, e-mail: dev-help [at] perl

ModPerl dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.