You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Joe Schaefer <jo...@sunstarsys.com> on 2003/07/20 02:33:48 UTC

[apreq-2] Apache::Test preinstall issues

The Apache::Test tests are using prior installs
instead of the most-recent cvs builds.  Yesterday 
I did a full install of modperl-2.0+apreq-2, and the 
first problem I encountered with the tests appears 
in env/t:

  % head -20 env/t/conf/httpd.conf
  ...
  LoadModule apreq_module "/home/joe/apache2/modules/mod_apreq.so"
  LoadModule perl_module "/home/joe/apache2/modules/mod_perl.so"
  <IfModule !mod_apreq.c>
      LoadModule apreq_module "/path/to/httpd-apreq-2/env/.libs/mod_apreq.so"
  </IfModule>

This is obviously a bad config-  somehow we need the tests 
to ignore the "LoadModule apreq_module" directive coming from 
the installed httpd.conf.


The second problem is with the perl_tests:

  % tail glue/perl/t/conf/modperl_inc.pl
  ...
  use lib '/path/to/httpd-apreq-2/glue/perl/t/response';
  use lib '/path/to/httpd-apreq-2/glue/perl/blib/arch';
  use lib '/path/to/httpd-apreq-2/glue/perl/blib/lib';
  use Apache2;
  1;

The 'use Apache 2' directive needs to occur before
the 'use lib ...' directives to avoid using a previously-
installed Apache::Request.

Anybody know how to fix these two problems?

-- 
Joe Schaefer


Re: [apreq-2] Apache::Test preinstall issues

Posted by Stas Bekman <st...@stason.org>.
Joe Schaefer wrote:
> Jamie Krasnoo <kr...@socal.rr.com> writes:
> 
> 
> [...]
> 
> 
>>I just tested again and passed all tests. However both make test and
>>make perl_test cored. Is it set to do that? 
> 
> 
> No, it's not.  If the core dumps persists you'll need to supply
> a backtrace.  Otherwise I wouldn't worry about it, since the
> build system was pretty b0rked wrt prior installs.  The perl build+
> install is still doing weird things (still haven't figured out why
> WrapXS tries to build+install itself), but there's far less weirdness 
> now.

Most likely you had the core files because you may had older apreq.so 
installed system-wide. The new installation installs them into the Apache2/ 
subdir. So I'd suggest to hunt the old copies and nuke them. Future updates 
shouldn't have this problem.



__________________________________________________________________
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


Re: [apreq-2] Apache::Test preinstall issues

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Jamie Krasnoo <kr...@socal.rr.com> writes:


[...]

> I just tested again and passed all tests. However both make test and
> make perl_test cored. Is it set to do that? 

No, it's not.  If the core dumps persists you'll need to supply
a backtrace.  Otherwise I wouldn't worry about it, since the
build system was pretty b0rked wrt prior installs.  The perl build+
install is still doing weird things (still haven't figured out why
WrapXS tries to build+install itself), but there's far less weirdness 
now.

-- 
Joe Schaefer


Re: [apreq-2] Apache::Test preinstall issues

Posted by Jamie Krasnoo <kr...@socal.rr.com>.
On Sun, 2003-07-20 at 12:27, Joe Schaefer wrote:
> Joe Schaefer <jo...@sunstarsys.com> writes:
> 
> > Stas Bekman <st...@stason.org> writes:
> > 
> > [...]
> > 
> > > Actually, this is not a bug, I have done this on purpose, for 3rd
> > > party modules which install their modules into Apache2/. use
> > > Apache2; should come after local blib so it'll pick these subdirs.
> > 
> > I don't think so.  
> 
> Oh, never mind- I now see that you are correct.  After committing the 
> ModPerl::MM changes, which adjusts the local blib/lib as you suggested, 
> it appears that Apache::Test now sets @INC correctly without the 
> override.
> 
> I'll revert the prior commit which erroneously overrides 
> Apache::TestConfig::configure_startup_pl.

I just tested again and passed all tests. However both make test and
make perl_test cored. Is it set to do that? I ran the tests again after
removing the core files and the tests ran fine without producing a core.

Jamie


Re: [apreq-2] Apache::Test preinstall issues

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Joe Schaefer <jo...@sunstarsys.com> writes:

> Stas Bekman <st...@stason.org> writes:
> 
> [...]
> 
> > Actually, this is not a bug, I have done this on purpose, for 3rd
> > party modules which install their modules into Apache2/. use
> > Apache2; should come after local blib so it'll pick these subdirs.
> 
> I don't think so.  

Oh, never mind- I now see that you are correct.  After committing the 
ModPerl::MM changes, which adjusts the local blib/lib as you suggested, 
it appears that Apache::Test now sets @INC correctly without the 
override.

I'll revert the prior commit which erroneously overrides 
Apache::TestConfig::configure_startup_pl.

-- 
Joe Schaefer


Re: [apreq-2] Apache::Test preinstall issues

Posted by Stas Bekman <st...@stason.org>.
Joe Schaefer wrote:
> Stas Bekman <st...@stason.org> writes:
> 
> [...]
> 
> 
>>Actually, this is not a bug, I have done this on purpose, for 3rd
>>party modules which install their modules into Apache2/. use Apache2;
>>should come after local blib so it'll pick these subdirs.
> 
> 
> I don't think so.  Remember C<use lib 'foo'> is essentially
> 
>   BEGIN { unshift @INC, "foo"; }
> 
> so you want the C<use lib> directives in modperl_inc.pl to come *after* 
> the C<use Apache2> directive.  Otherwise the first item in @INC will 
> be something like
> 
>   /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2
> 
> which will completely *ignore* the local blib/lib if there's a prior
> install.

Not at all. Once you have blib/lib/Apache2 and blib/arch/Apache2, they will 
come in first in @INC and there is no problem.

>>On the contrary Apache::Request 2 build is broken in that respect. It
>>installs into @INC, and not into Apache2/ making it impossible to have
>>Apache::Request for mp1 and mp2 coexist under the same perl tree. 
> 
> 
> True- we need to fix that as well.

Fixing that will remove the need to provide the workaround you've committed. 
Which I can see you have done already. Now it's the time to revert the workaround.

__________________________________________________________________
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


Re: [apreq-2] Apache::Test preinstall issues

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Stas Bekman <st...@stason.org> writes:

[...]

> Actually, this is not a bug, I have done this on purpose, for 3rd
> party modules which install their modules into Apache2/. use Apache2;
> should come after local blib so it'll pick these subdirs.

I don't think so.  Remember C<use lib 'foo'> is essentially

  BEGIN { unshift @INC, "foo"; }

so you want the C<use lib> directives in modperl_inc.pl to come *after* 
the C<use Apache2> directive.  Otherwise the first item in @INC will 
be something like

  /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2

which will completely *ignore* the local blib/lib if there's a prior
install.

> On the contrary Apache::Request 2 build is broken in that respect. It
> installs into @INC, and not into Apache2/ making it impossible to have
> Apache::Request for mp1 and mp2 coexist under the same perl tree. 

True- we need to fix that as well.

-- 
Joe Schaefer


Re: [apreq-2] Apache::Test preinstall issues

Posted by Stas Bekman <st...@stason.org>.
>>>The second problem is with the perl_tests:
>>>
>>>  % tail glue/perl/t/conf/modperl_inc.pl
>>>  ...
>>>  use lib '/path/to/httpd-apreq-2/glue/perl/t/response';
>>>  use lib '/path/to/httpd-apreq-2/glue/perl/blib/arch';
>>>  use lib '/path/to/httpd-apreq-2/glue/perl/blib/lib';
>>>  use Apache2;
>>>  1;
>>>
>>>The 'use Apache 2' directive needs to occur before
>>>the 'use lib ...' directives to avoid using a previously-
>>>installed Apache::Request.
>>
>>This is being written from Apache::TestConfigPerl, in the
>>configure_startup_pl sub. The Apache2 entry comes from the call
>>to Apache::TestConfig->modperl_2_inc_fixup() - moving the
>>printing of $fixup to $fh to somewhere before the line
>>   print $fh "use lib '$_';\n";
>>would get the order you want, but I'm not sure how that
>>would affect, eg, the mod_perl tests.
> 
> 
> It certainly won't affect the modperl build tests, since 
> modperl_2_inc_fixup is a noop there.  I suspect that
> this misordering is a bug in configure_startup_pl,
> but for the time being we can simply override it.
> 
> I've applied the relevant patches to cvs- please give it
> a try (you need to % make clean to clear out the old test
> configs).

Actually, this is not a bug, I have done this on purpose, for 3rd party 
modules which install their modules into Apache2/. use Apache2; should come 
after local blib so it'll pick these subdirs.

On the contrary Apache::Request 2 build is broken in that respect. It installs 
into @INC, and not into Apache2/ making it impossible to have Apache::Request 
for mp1 and mp2 coexist under the same perl tree. For an example of how to 
make the library following the mod_perl 2.0 install scheme see Apache::Peek. 
the magic is done behind the scenes simply by using 
ModPerl::MM::WriteMakefile. Once you have this in place, the 
modperl_2_inc_fixup will make a lot more sense.


__________________________________________________________________
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


Re: [apreq-2] Apache::Test preinstall issues

Posted by Jamie Krasnoo <kr...@socal.rr.com>.
On Sun, 2003-07-20 at 01:59, Joe Schaefer wrote:
> Randy Kobes <ra...@theoryx5.uwinnipeg.ca> writes:
> 
> [...]
> 
> > Does the following work?
> > =================================================================
> > Index: TEST.PL
> > ================================================================
> > RCS file: /home/cvs/httpd-apreq-2/env/t/TEST.PL,v
> > retrieving revision 1.2
> > diff -u -r1.2 TEST.PL
> > --- TEST.PL	30 Jun 2003 20:42:14 -0000	1.2
> > +++ TEST.PL	20 Jul 2003 04:05:22 -0000
> > @@ -18,6 +18,12 @@
> >  $Apache::TestTrace::Level = 'debug';
> >  main::->new->run(@ARGV);
> > 
> > +sub pre_configure {
> > +    my $self = shift;
> > +    # Don't load an installed mod_apreq
> > +    Apache::TestConfig::autoconfig_skip_module_add('mod_apreq.c');
> > +}
> > +
> >  sub configure {
> >      my $self = shift;
> >      my $cfg = $self->{test_config};
> 
> Yes, it does.
> 
> > >
> > > The second problem is with the perl_tests:
> > >
> > >   % tail glue/perl/t/conf/modperl_inc.pl
> > >   ...
> > >   use lib '/path/to/httpd-apreq-2/glue/perl/t/response';
> > >   use lib '/path/to/httpd-apreq-2/glue/perl/blib/arch';
> > >   use lib '/path/to/httpd-apreq-2/glue/perl/blib/lib';
> > >   use Apache2;
> > >   1;
> > >
> > > The 'use Apache 2' directive needs to occur before
> > > the 'use lib ...' directives to avoid using a previously-
> > > installed Apache::Request.
> > 
> > This is being written from Apache::TestConfigPerl, in the
> > configure_startup_pl sub. The Apache2 entry comes from the call
> > to Apache::TestConfig->modperl_2_inc_fixup() - moving the
> > printing of $fixup to $fh to somewhere before the line
> >    print $fh "use lib '$_';\n";
> > would get the order you want, but I'm not sure how that
> > would affect, eg, the mod_perl tests.
> 
> It certainly won't affect the modperl build tests, since 
> modperl_2_inc_fixup is a noop there.  I suspect that
> this misordering is a bug in configure_startup_pl,
> but for the time being we can simply override it.
> 
> I've applied the relevant patches to cvs- please give it
> a try (you need to % make clean to clear out the old test
> configs).

I pulled down the changes and rebuilt it. All tests passed.

Jamie


Re: [apreq-2] Apache::Test preinstall issues

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Randy Kobes <ra...@theoryx5.uwinnipeg.ca> writes:

[...]

> Does the following work?
> =================================================================
> Index: TEST.PL
> ================================================================
> RCS file: /home/cvs/httpd-apreq-2/env/t/TEST.PL,v
> retrieving revision 1.2
> diff -u -r1.2 TEST.PL
> --- TEST.PL	30 Jun 2003 20:42:14 -0000	1.2
> +++ TEST.PL	20 Jul 2003 04:05:22 -0000
> @@ -18,6 +18,12 @@
>  $Apache::TestTrace::Level = 'debug';
>  main::->new->run(@ARGV);
> 
> +sub pre_configure {
> +    my $self = shift;
> +    # Don't load an installed mod_apreq
> +    Apache::TestConfig::autoconfig_skip_module_add('mod_apreq.c');
> +}
> +
>  sub configure {
>      my $self = shift;
>      my $cfg = $self->{test_config};

Yes, it does.

> >
> > The second problem is with the perl_tests:
> >
> >   % tail glue/perl/t/conf/modperl_inc.pl
> >   ...
> >   use lib '/path/to/httpd-apreq-2/glue/perl/t/response';
> >   use lib '/path/to/httpd-apreq-2/glue/perl/blib/arch';
> >   use lib '/path/to/httpd-apreq-2/glue/perl/blib/lib';
> >   use Apache2;
> >   1;
> >
> > The 'use Apache 2' directive needs to occur before
> > the 'use lib ...' directives to avoid using a previously-
> > installed Apache::Request.
> 
> This is being written from Apache::TestConfigPerl, in the
> configure_startup_pl sub. The Apache2 entry comes from the call
> to Apache::TestConfig->modperl_2_inc_fixup() - moving the
> printing of $fixup to $fh to somewhere before the line
>    print $fh "use lib '$_';\n";
> would get the order you want, but I'm not sure how that
> would affect, eg, the mod_perl tests.

It certainly won't affect the modperl build tests, since 
modperl_2_inc_fixup is a noop there.  I suspect that
this misordering is a bug in configure_startup_pl,
but for the time being we can simply override it.

I've applied the relevant patches to cvs- please give it
a try (you need to % make clean to clear out the old test
configs).

-- 
Joe Schaefer

Re: [apreq-2] Apache::Test preinstall issues

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Sat, 19 Jul 2003, Joe Schaefer wrote:

> The Apache::Test tests are using prior installs
> instead of the most-recent cvs builds.  Yesterday
> I did a full install of modperl-2.0+apreq-2, and the
> first problem I encountered with the tests appears
> in env/t:
>
>   % head -20 env/t/conf/httpd.conf
>   ...
>   LoadModule apreq_module "/home/joe/apache2/modules/mod_apreq.so"
>   LoadModule perl_module "/home/joe/apache2/modules/mod_perl.so"
>   <IfModule !mod_apreq.c>
>       LoadModule apreq_module "/path/to/httpd-apreq-2/env/.libs/mod_apreq.so"
>   </IfModule>
>
> This is obviously a bad config-  somehow we need the tests
> to ignore the "LoadModule apreq_module" directive coming from
> the installed httpd.conf.

Does the following work?
=================================================================
Index: TEST.PL
================================================================
RCS file: /home/cvs/httpd-apreq-2/env/t/TEST.PL,v
retrieving revision 1.2
diff -u -r1.2 TEST.PL
--- TEST.PL	30 Jun 2003 20:42:14 -0000	1.2
+++ TEST.PL	20 Jul 2003 04:05:22 -0000
@@ -18,6 +18,12 @@
 $Apache::TestTrace::Level = 'debug';
 main::->new->run(@ARGV);

+sub pre_configure {
+    my $self = shift;
+    # Don't load an installed mod_apreq
+    Apache::TestConfig::autoconfig_skip_module_add('mod_apreq.c');
+}
+
 sub configure {
     my $self = shift;
     my $cfg = $self->{test_config};
======================================================================
>
> The second problem is with the perl_tests:
>
>   % tail glue/perl/t/conf/modperl_inc.pl
>   ...
>   use lib '/path/to/httpd-apreq-2/glue/perl/t/response';
>   use lib '/path/to/httpd-apreq-2/glue/perl/blib/arch';
>   use lib '/path/to/httpd-apreq-2/glue/perl/blib/lib';
>   use Apache2;
>   1;
>
> The 'use Apache 2' directive needs to occur before
> the 'use lib ...' directives to avoid using a previously-
> installed Apache::Request.

This is being written from Apache::TestConfigPerl, in the
configure_startup_pl sub. The Apache2 entry comes from the call
to Apache::TestConfig->modperl_2_inc_fixup() - moving the
printing of $fixup to $fh to somewhere before the line
   print $fh "use lib '$_';\n";
would get the order you want, but I'm not sure how that
would affect, eg, the mod_perl tests.

-- 
best regards,
randy