You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Kermit Tensmeyer <kl...@eml.cc> on 2003/03/21 05:12:57 UTC

(mp2) Apache::Build

I did a grep on the use of apxs in the modperl pm files and
found that it is used to extract 4 different variables (includedir,
prefix, cflags, libexecdir).

if $build->apxs (Apache::Build::apxs) was not used, the same
functionality could be achieved that storing those values in the $build
hash.
 The apxs script in the apache bin directory, works by reading the file
 "config_vers.mk"
and converting the variables into a hash, and extracting the targeted
parameter value.

 when modperl is built the Makefile.PL asks if the "../httpd-2.0" or
 similar path should
be used to configure ModPerl. I think the intent is to use that specfic
instance of apache to extract these specfic variables. As near as I can
tell, only the apxs function (these 4 variables) are the only use of this
configuration path.

  so either we change the Makefile.PL functionality to point to an
  "installed apache" directory _or_  we change the build::apxs function
  to not use the non-functional apxs script.
   In the current build::apxs code the function tries to guess where a
   functioning apxs script resides.   the array @trys contains the list
   of potiential target directories
 my @trys = ($Apache::Build::APXS,
                $self->{MP_APXS},
                $ENV{MP_APXS});
 and
      push @trys,
        Apache::TestConfig::which('apxs'),
        '/usr/local/apache/bin/apxs';

  as nears as I can tell, the last option is a hard-code hack that will
  fail for most sites
  None of these options will include $build->dir path that was set by
  Makefile.PL

  so we can add the source tree for Apache2 to this list of directories
  to try and keep
 some part of the apxs function, or we replace the apxs function with a
 function that
  extracts the variables from the equivalent config file.

  (source tree:  apxs exists in the support sub directory )
  (installed tree   apxs exists in the bin directory)   in both cases
  apxs trys to read
    get_config_vars("$installbuilddir'config_vers.mk")

  ---
    Summary:  current instance of $build->apxs is used for only four
    variables, but attempts to guess a location for apxs. Current design
    ignores the explict path of the preinstalled apache source tree to
    determine which config_variable file to read.    
   under some circumstances this would cause  mp2 configuration to read
   apache1.0 parameters, even when there exists target apache2
   configuration data. further it does not allow for multiple apache2
   installs.

   and no I don't know enough context ...yet.. to know the right way to
   solve this
      but TMTOWTDI.

    
-- 
  Kermit  Tensmeyer
  klt_7940@emil.cc

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


Re: (mp2) Apache::Build

Posted by Stas Bekman <st...@stason.org>.
Kermit Tensmeyer wrote:
> On Sat, 22 Mar 2003 16:14:08 +1100, "Stas Bekman" <st...@stason.org> said:
> 
>>Kermit Tensmeyer wrote:
>>
>>>On Fri, 21 Mar 2003 15:23:42 +1100, "Stas Bekman" <st...@stason.org> said:
>>>
>>
> 
>>OK, so I still don't understand why it doesn't work for you. It doesn't
>>find 
>>apxs at all? It finds the wrong apxs? What's the current problem, that
>>makes 
>>$build->apxs(q => ...) fail?
> 
> 
> 
>    now that it works (7 more attempts and rtfm), I think it works where
>    MP_AP_PREFIX is specified and otherwise it does not work. The code set
>    (which guesses where the httpd source tree resides) doesn't find a
>    working apxs and thus the essential values doesn't get specfied.

Hmm, so it does work when you specify MP_AP_PREFIX, right?

And it doesn't work if you specify MP_APXS, right?


>      (I think that the current code does in fact cache prior results.
>      After it finds a working 'apxs', it saves that location in
>      $build->APXS.  so my 'suggestions' have already been implemented :-)
>       )

Cool


__________________________________________________________________
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: (mp2) Apache::Build

Posted by Kermit Tensmeyer <kl...@eml.cc>.
On Sat, 22 Mar 2003 16:14:08 +1100, "Stas Bekman" <st...@stason.org> said:
> Kermit Tensmeyer wrote:
> > On Fri, 21 Mar 2003 15:23:42 +1100, "Stas Bekman" <st...@stason.org> said:
> > 

> 
> OK, so I still don't understand why it doesn't work for you. It doesn't
> find 
> apxs at all? It finds the wrong apxs? What's the current problem, that
> makes 
> $build->apxs(q => ...) fail?


   now that it works (7 more attempts and rtfm), I think it works where
   MP_AP_PREFIX is specified and otherwise it does not work. The code set
   (which guesses where the httpd source tree resides) doesn't find a
   working apxs and thus the essential values doesn't get specfied.
     (I think that the current code does in fact cache prior results.
     After it finds a working 'apxs', it saves that location in
     $build->APXS.  so my 'suggestions' have already been implemented :-)
      )
-- 
  Kermit  Tensmeyer
  klt_7940@emil.cc

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


Re: (mp2) Apache::Build

Posted by Stas Bekman <st...@stason.org>.
Kermit Tensmeyer wrote:
> On Fri, 21 Mar 2003 15:23:42 +1100, "Stas Bekman" <st...@stason.org> said:
> 
>>Kermit Tensmeyer wrote:
>>[...]
>>
>>>        '/usr/local/apache/bin/apxs';
>>>
>>>  as nears as I can tell, the last option is a hard-code hack that will
>>>  fail for most sites
>>
>>Sorry if I've snipped too much, but am I correct that this is the gist of
>>the 
>>problem? mp2's build picks the wrong /usr/local/apache/bin/apxs and this
>>is 
>>the root of the problem?
> 
> 
>  that's part of the problem  mp2's build picks `a` apxs, but modperl
>  Makefile.PL explictly asks to use a specfic apache source tree to
>  'configure' mp2  with. I think it ought to use the apxs the resides in
> that specfic source tree. 

OK, so I still don't understand why it doesn't work for you. It doesn't find 
apxs at all? It finds the wrong apxs? What's the current problem, that makes 
$build->apxs(q => ...) fail?

>>mod_perl already supplies the mechanics to perform the functinality of
>>apxs, 
>>because apxs simply doesn't work on platforms like win32.
> 
> 
>   If that supplies a general solution (I'll check tonight)(i don't use
>   win32)
> then it could be a better solution.
>    I had another thought. As it stands every single invocation of
>    $build->apxs
>  goes thru the process of guessing which external script to execute and
>  each time
> parses the config variable file to extract one and only one value, but
> apxs builds
> out a hash of all the variables.
>    What if the build->apxs would extract out the four values and save
>    those values 
> in the build hash, and then serve those value on subsequent calls to the
> function.
>    hmm.. One parse of the file.  One or less external invoking of perl
>    script.

That's not a critical issue. Sure we can make it more efficient, but this is 
just a build process. Rather spend time first improving other things.

That's certainly after we make it working for you. If in the process things 
get improved, that's cool. But first I need to understand why it doesn't work 
for you.

>>So if you remove that hardcoded path, do things start to work?
> 
> 
>    Nope..
> 
>  but before I think about rewriting the apache::build module, i think
>  this other discussion about the weakness of  apache::MM should get
>  resolved.  I'll look at the M::B stuff this weekend
>    no sense working of stuff that will be replaced soon.

replaced? Are you talking about ModPerl::MM? it won't be replaced, but moved 
into ModPerl::BuildMM and ModPerl::MM will be design explicitly for use with 
3rd party modules.


__________________________________________________________________
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: (mp2) Apache::Build

Posted by Kermit Tensmeyer <kl...@eml.cc>.
On Fri, 21 Mar 2003 15:23:42 +1100, "Stas Bekman" <st...@stason.org> said:
> Kermit Tensmeyer wrote:
> [...]
> >         '/usr/local/apache/bin/apxs';
> > 
> >   as nears as I can tell, the last option is a hard-code hack that will
> >   fail for most sites
> 
> Sorry if I've snipped too much, but am I correct that this is the gist of
> the 
> problem? mp2's build picks the wrong /usr/local/apache/bin/apxs and this
> is 
> the root of the problem?

 that's part of the problem  mp2's build picks `a` apxs, but modperl
 Makefile.PL explictly asks to use a specfic apache source tree to
 'configure' mp2  with. I think it ought to use the apxs the resides in
that specfic source tree. 

> 
> mod_perl already supplies the mechanics to perform the functinality of
> apxs, 
> because apxs simply doesn't work on platforms like win32.

  If that supplies a general solution (I'll check tonight)(i don't use
  win32)
then it could be a better solution.
   I had another thought. As it stands every single invocation of
   $build->apxs
 goes thru the process of guessing which external script to execute and
 each time
parses the config variable file to extract one and only one value, but
apxs builds
out a hash of all the variables.
   What if the build->apxs would extract out the four values and save
   those values 
in the build hash, and then serve those value on subsequent calls to the
function.
   hmm.. One parse of the file.  One or less external invoking of perl
   script.

> 
> So if you remove that hardcoded path, do things start to work?

   Nope..

 but before I think about rewriting the apache::build module, i think
 this other discussion about the weakness of  apache::MM should get
 resolved.  I'll look at the M::B stuff this weekend
   no sense working of stuff that will be replaced soon.
-- 
  Kermit  Tensmeyer
  klt_7940@emil.cc

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


Re: (mp2) Apache::Build

Posted by Stas Bekman <st...@stason.org>.
Kermit Tensmeyer wrote:
[...]
>         '/usr/local/apache/bin/apxs';
> 
>   as nears as I can tell, the last option is a hard-code hack that will
>   fail for most sites

Sorry if I've snipped too much, but am I correct that this is the gist of the 
problem? mp2's build picks the wrong /usr/local/apache/bin/apxs and this is 
the root of the problem?

mod_perl already supplies the mechanics to perform the functinality of apxs, 
because apxs simply doesn't work on platforms like win32.

So if you remove that hardcoded path, do things start to work?

__________________________________________________________________
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