Re: minor bugfix for Apache::Test

[prev] [thread] [next] [Date index for 2005/01/26]

From: Geoffrey Young
Subject: Re: minor bugfix for Apache::Test
Date: 14:28 on 26 Jan 2005

Torsten Foertsch wrote:
> On Wednesday 26 January 2005 13:42, Geoffrey Young wrote:
> 
>>Torsten Foertsch wrote:
>>
>>>Hi,
>>>
>>>while trying out Apache-IncludeHook-2.00_02
>>
>>I haven't touched that in a while, so if you see it failing to work on
>>newish apache just holler.  other than that, I hope you like it :)
> 
> 
> Yes, since 10 May 2004. So, I was expecting some problems.

:)

> 
>>>I stumbled across the lack of
>>>Apache::Test::have().
>>
>>hmm... is have() really required?
> 
> 
> No, it isn't. Here is a patch to Apache-IncludeHook-2.00_02. BTW, what does 
> need { 'subrequests under construction' => 0 } mean?

it means that when I wrote it could couldn't

  $r->lookup_uri($uri)->run;

from within an SSI handler.  I spent days trying to track down the cause of
the issue but wasn't able to ever figure it out.

anyway, that way of writing skip messages isn't needed anymore - it looks like

  skip_reason('subrequests under construction')

in my local repository at the moment, but skip_reason() didn't exist at the
time of the last release :)

> 
> Another question, where should the include files reside? On my system they are installed at
> /usr/include/apache2/modules/perl/mod_perl.h and /usr/include/apache2/mod_include.h. 
> Is that correct?

I don't think so.  I have both under my local apache install tree

  /apache/2.0/worker/perl-5.8.6/include/mod_perl.h
  /apache/2.0/worker/perl-5.8.6/include/mod_include.h

which matches the results of an apxs query:

  $ /apache/2.0/worker/perl-5.8.6/bin/apxs -q includedir
  /apache/2.0/worker/perl-5.8.6/include

> 
> Torsten
> 
> diff -Naur Apache-IncludeHook-2.00_02/IncludeHook.xs Apache-IncludeHook-2.00_02.new/IncludeHook.xs
> --- Apache-IncludeHook-2.00_02/IncludeHook.xs	2004-05-10 20:37:26.000000000 +0200
> +++ Apache-IncludeHook-2.00_02.new/IncludeHook.xs	2005-01-25 20:50:37.000000000 +0100
> @@ -2,8 +2,8 @@
>  #include "perl.h"
>  #include "XSUB.h"
>  
> -#include "mod_perl.h"
> -#include "mod_include.h"
> +#include <modules/perl/mod_perl.h>
> +#include <mod_include.h>

that shouldn't be required at all.  if it is then something is broken someplace.

the resulting Makefile from my Apache-IncludeHook build includes this

  INC => q[-I/apache/2.0/worker/perl-5.8.6/include]

which matches this entry in Apache/BuildConfig.pm in my installed site_lib

  'APXS_INCLUDEDIR' => '/apache/2.0/prefork/perl-5.8.6/include

basically what happens is that when you install mod_perl it retains the
memory of where things were when it was built, what header files it used,
and so on.  the third-party hook into all this information is
ModPerl::MM::WriteMakefile(), which is called from Makefile.PL - it is very
important to use ModPerl::MM::WriteMakefile() for mp2 CPAN modules.  world,
are you listening?  :)

anyway... if INC and APXS_INCLUDEDIR don't match eachother or don't properly
reflect which apache you used to build mod_perl something went wrong
someplace.  but keep in mind that all these are helpers for the majority of
users, but will get seriously mucked up if you use multiple mod_perl
versions, shuffle things around post-install, or do other hacking.  for
example, I can't use the same perl for mp1 and mp2 if I want this approach
to work, since ModPerl::MM::WriteMakefile() will choose the one I installed
last to build against.

hope that all makes sense.

>  
>  #define REFCNT_AND_ERROR(buffer,obj,av,hv,rv) \
>    MP_TRACE_f(MP_FUNC, "final reference counts: buffer=%d, obj=%d, av=%d, hv=%d\n", \
> @@ -46,7 +46,7 @@
>    server_rec  *s     = r->server;
>    apr_pool_t  *p     = r->pool;
>  
> -  modperl_handler_t  *handler;
> +  modperl_handler_t  *handler=0;

hmm, what's that about?

> -plan tests => 5, (have_lwp &&
> -                  have_module('mod_perl.c') &&
> -                  have_module('include') &&
> -                  have { 'subrequests under construction' => 0 } );
> +plan tests => 5, (need_lwp &&
> +                  need_module('mod_perl.c') &&
> +                  need_module('include') &&
> +                  need { 'subrequests under construction' => 0 } );

yes, that's right.  I actually have that in my local repository already.
I'll look into making a new release soon.

thanks for the feedback.

--Geoff

minor bugfix for Apache::Test
Torsten Foertsch 10:13 on 26 Jan 2005

Re: minor bugfix for Apache::Test
Geoffrey Young 12:42 on 26 Jan 2005

Re: minor bugfix for Apache::Test
Torsten Foertsch 13:22 on 26 Jan 2005

Re: minor bugfix for Apache::Test
Geoffrey Young 14:28 on 26 Jan 2005

Re: minor bugfix for Apache::Test
Geoffrey Young 14:30 on 26 Jan 2005

Re: minor bugfix for Apache::Test
Torsten Foertsch 15:06 on 26 Jan 2005

Re: minor bugfix for Apache::Test
Geoffrey Young 18:00 on 26 Jan 2005

Generated at 17:42 on 27 Jan 2005 by mariachi v0.52