Stas Bekman wrote:
Haroon Rafique wrote:

On Today at 9:46am, SB=>Stas Bekman <[EMAIL PROTECTED]> wrote:

SB> SB> Actually it was Sunday (future!) and it's winter (past?) here in
SB> Melbourne ;)

I figured we were a few continents away.

SB> SB> Then, if it's indeed your globally installed Apache::Filter and not
SB> the local one, dump @INC (in the same place) to see whether the global
SB> path comes before the local one.
SB>
Apache::Filter is indeed the globally installed one as evidenced by:


Apache::Filter /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/Apache/Filter.pm at /home/haroon/src/build/modperl-2.0/t/filter/TestFilter/in_init_basic.pm line 15.

Here's what @INC looks like:

/home/haroon/src/build/modperl-2.0/Apache-Test/lib
/home/haroon/src/build/modperl-2.0/lib
/home/haroon/src/build/modperl-2.0/t/response
/home/haroon/src/build/modperl-2.0/t/protocol
/home/haroon/src/build/modperl-2.0/t/preconnection
/home/haroon/src/build/modperl-2.0/t/hooks
/home/haroon/src/build/modperl-2.0/t/filter
/home/haroon/src/build/modperl-2.0/t
/home/haroon/src/build/modperl-2.0/t/htdocs/testdirective/perlmodule-vh
/home/haroon/src/build/modperl-2.0/t/htdocs/testdirective/main
/home/haroon/src/build/modperl-2.0/t/
/home/haroon/src/build/modperl-2.0/t/lib/perl
/home/haroon/src/build/modperl-2.0/blib/lib
/home/haroon/src/build/modperl-2.0/blib/arch
Apache-Test/lib
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl at /home/haroon/src/build/modperl-2.0/t/filter/TestFilter/in_init_basic.pm line 16.


I used the following diff to gather this diagnostic output:
===================================================================
--- t/filter/TestFilter/in_init_basic.pm 9 May 2003 03:33:37 -0000 1.2
+++ t/filter/TestFilter/in_init_basic.pm 10 Jun 2003 14:46:33 -0000
@@ -11,6 +11,11 @@
use base qw(Apache::Filter);
+BEGIN {
+ warn "Apache::Filter $INC{'Apache/Filter.pm'}";
+ warn join "\n", @INC;
+}
+
use Apache::Const -compile => qw(OK M_POST);
use constant READ_SIZE => 1024;



What's next to try?


That now explains everything:

 > *** using lib/Apache/BuildConfig.pm
 > *** Makefile.PL options:
 >   MP_AP_PREFIX   => /servers/httpd-2.0.44-pl
 >   MP_COMPAT_1X   => 1
 >   MP_GENERATE_XS => 1
 >   MP_LIBNAME     => mod_perl
 >   MP_USE_DSO     => 1
 >   MP_USE_STATIC  => 1

previously you have built mod_perl with MP_INST_APACHE2=1, this time you did without, so the Apache2/ from the old install was getting into @INC first. Hence the local blib was going after the global .../i386-linux-thread-multi/Apache2/.

How do we prevent this problem from re-curring is a question. Perhaps we should autogenerate Apache2.pm and make it:

package Apache2;

1;

in case, MP_INST_APACHE2=1 wasn't used.

please try this patch against the current cvs. I did some testing and it seems to work. Test it on your old setup where you still have this problem.


Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
retrieving revision 1.104
diff -u -r1.104 Makefile.PL
--- Makefile.PL 23 Apr 2003 04:46:07 -0000      1.104
+++ Makefile.PL 12 Jun 2003 08:57:15 -0000
@@ -111,6 +111,8 @@
         }
     }

+    $build->generate_apache2_pm;
+
     if (WIN32()) {
         #Makefile.PL's in WrapXS/ just need to pass the -e mod_perl.lib test
         #the real mod_perl.lib will be in place when WrapXS/ dll's are
Index: lib/Apache/Build.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.125
diff -u -r1.125 Build.pm
--- lib/Apache/Build.pm 20 May 2003 23:52:42 -0000      1.125
+++ lib/Apache/Build.pm 12 Jun 2003 08:57:15 -0000
@@ -1366,6 +1366,37 @@
     return "";
 }

+# in case MP_INST_APACHE2=0 we shouldn't try to adjust @INC
+# because it may pick older Apache2 from the previous install
+sub generate_apache2_pm {
+    my $self = shift;
+
+    my $fixup = !$self->{MP_INST_APACHE2}
+        ? '# MP_INST_APACHE2=0, do nothing'
+        : <<'EOF';
+BEGIN {
+    my @dirs = ();
+
+    for my $path (@INC) {
+        my $dir = "$path/Apache2";
+        next unless -d $dir;
+        push @dirs, $dir;
+    }
+
+    if (@dirs) {
+        unshift @INC, @dirs;
+    }
+}
+EOF
+
+    my $content = join "\n\n", 'package Apache2;', $fixup, "1;";
+    my $file = catfile qw(lib Apache2.pm);
+    open my $fh, '>', $file or die "Can't open $file: $!";
+    print $fh $content;
+    close $fh;
+
+}
+
 1;

__END__


__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com



Reply via email to