(Hi, I posted this
to the regular list a few days ago, and didn't get any response, so maybe it was
more suited to this audience... )
Ok, this is pretty
long, but I was trying to make sure I included everything relevant to the
problem.
Is there a simple
answer to getting 'make test' for mod_perl to work when all extra perl modules
are in a custom location? Simply having PERL5LIB=/appl/perl/lib exported
when running the builds doesn't seem to suffice. It works fine for everything
else perlish, just not the mod_perl 'make test'.
I'm building apache
1.3.23 and mod_perl 1.26 (with latest mod_ssl - but that doesn't seem to be part
of the problem). I have all the modules not included with perl installed
in /appl/perl/lib. This is a Solaris 8 64-bit system. perl was built
with 'sh Configure -des -Duseshrplib' (useshrplib was for postgres, I'm building
modperl statically). I used gcc 3.0.3 for everything (installed latest
binutils first then gcc - both from sunfreeware).
mod_perl:
<<file:makepl_args.mod_perl>>
APACHE_SRC=/data/build/WEB/apache
SSL_BASE=/usr/local/ssl
EVERYTHING=1
DO_HTTPD=1
PREP_HTTPD=1
USE_APACI=1
PERL_SSI=1
APACHE_SRC=/data/build/WEB/apache
SSL_BASE=/usr/local/ssl
EVERYTHING=1
DO_HTTPD=1
PREP_HTTPD=1
USE_APACI=1
PERL_SSI=1
#perl Makefile.PL
PERL5LIB=/appl/perl/lib && make
apache:
#SSL_BASE=/usr/local/ssl \
./configure \
--with-layout=Apache \
--server-uid=web \
--server-gid=web \
--disable-rule=EXPAT \
--disable-module=asis \
--disable-module=imap \
--disable-module=negotiation \
--disable-module=userdir \
--enable-module=proxy \
--enable-module=rewrite \
--enable-module=define \
--activate-module=src/modules/perl/libperl.a \
--enable-module=perl \
--enable-module=ssl
#make
./configure \
--with-layout=Apache \
--server-uid=web \
--server-gid=web \
--disable-rule=EXPAT \
--disable-module=asis \
--disable-module=imap \
--disable-module=negotiation \
--disable-module=userdir \
--enable-module=proxy \
--enable-module=rewrite \
--enable-module=define \
--activate-module=src/modules/perl/libperl.a \
--enable-module=perl \
--enable-module=ssl
#make
mod_perl:
#PERL_HTTP_URI_CLASS=URI::URL make test
Now that you have
all the background, some deatils on the problem:
My symptoms are that
the httpd process (and the module/cgi and module/include subtests once the httpd
issue was fixed) complains that the CGI modules can't be found. At the end I've
included a capture of the make test output, both unmodified, and modified
(that's coming) - I ignored the Net::HTTP errors since they just looked like
warnings, rather than errors - please let me know if that's really a
problem.
I added a few
BEGIN{print $ENV{PERL5LIB},"\n"} lines here and there in various places and
found that my PERL5LIB wasn't getting picked up by either the httpd/mod_perl
process, or the scripts run via cgi.
I finally got it to
work by modifying Makefile.PL and httpd.conf-dist, as well as creating a
t/docs/local.pl.
In Makefile.PL I
noticed that at line 1273 it reads:
PERL5LIB => "PERL5LIB=$ENV{PERL5LIB}",
Shouldn't this be like this instead?
PERL5LIB => "$ENV{PERL5LIB}",
Maybe I don't understand the purpose, but it seems wrong, especially given the errors below where ../PERL5LIB=/data/web/xxx is actually shown in @INC for t/TEST. I can't see an immediate reason to have ../VAR=/path in the @INC. Anyway... I made that change and in that same file I modified line 99 so instead of
$ENV{PERL5LIB} = "$PWD/lib";
it reads
$ENV{PERL5LIB} = "$PWD/lib" . ($ENV{PERL5LIB} ? ":$ENV{PERL5LIB}" : "");
This way it preserves any local PERL5LIB settings while adding the mod_perl build location. I'm not sure if the $PWD/lib is even needed since it didn't seem to be right in the first place. Maybe the $PWD/lib part could just be dropped altogether.
In httpd.conf-dist (or httpd.conf if I wasn't rerunning the whole build
again but just the 'make run-tests') I had to add
PassEnv PERL5LIB
or the tests run through normal cgi instead of mod_perl don't work. I placed it in the #mod_perl section, right before 'PerlPassEnv PERl5LIB'.
Finally, I created a local.pl, since that's looked for by the startup.pl in t/docs:
use lib '/appl/perl/lib';
1;
So, I got all the tests to work, but I was wondering if there was a build option I was missing, or something that wasn't documented yet? I did spend 2 days researching this before posting, so I really hope I didn't miss something in the docs, the FAQ or the mod_perl guide. In making the changes, I tried to change things in as few places as possible. If there's a better way to do this, please, show me how!
Also, since mod_perl and LWP still don't seem to play well together in
their current versions, I used the PERL_HTTP_URI_CLASS=URI::URL "hack" to things
to work. (I found that in the mod_perl list archives...)
Thanks for anything you can help with on this.
Jim
<<<< PERL_HTTP_URI_CLASS=URI::URL make test
>>>>
<<<< cut out make dir recursion/iterations >>>>
<<<< cut out make dir recursion/iterations >>>>
<<<< unmodified mod_perl-1.26 >>>>
cp t/conf/mod_perl_srm.conf t/conf/srm.conf
../apache/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t &
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...[Wed Mar 27 16:19:06 2002] [error] Can't locate CGI.pm in @INC (@INC contains: /v01/data/build/WEB/mod_perl-1.26/blib/lib /v01/data/build/WEB/mod_perl-1.26/blib/arch /v01/data/build/WEB/mod_perl-1.26/t/docs blib/arch blib/lib /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl /v01/data/build/WEB/mod_perl-1.26/t/ /v01/data/build/WEB/mod_perl-1.26/t/lib/perl) at /v01/data/build/WEB/mod_perl-1.26/t/net/perl/qredirect.pl line 2.
BEGIN failed--compilation aborted at /v01/data/build/WEB/mod_perl-1.26/t/net/perl/qredirect.pl line 2.
Compilation failed in require at /v01/data/build/WEB/mod_perl-1.26/t//docs/startup.pl line 101.
Compilation failed in require at (eval 1) line 1.
cp t/conf/mod_perl_srm.conf t/conf/srm.conf
../apache/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t &
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...[Wed Mar 27 16:19:06 2002] [error] Can't locate CGI.pm in @INC (@INC contains: /v01/data/build/WEB/mod_perl-1.26/blib/lib /v01/data/build/WEB/mod_perl-1.26/blib/arch /v01/data/build/WEB/mod_perl-1.26/t/docs blib/arch blib/lib /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl /v01/data/build/WEB/mod_perl-1.26/t/ /v01/data/build/WEB/mod_perl-1.26/t/lib/perl) at /v01/data/build/WEB/mod_perl-1.26/t/net/perl/qredirect.pl line 2.
BEGIN failed--compilation aborted at /v01/data/build/WEB/mod_perl-1.26/t/net/perl/qredirect.pl line 2.
Compilation failed in require at /v01/data/build/WEB/mod_perl-1.26/t//docs/startup.pl line 101.
Compilation failed in require at (eval 1) line 1.
Syntax error on line 62 of
/v01/data/build/WEB/mod_perl-1.26/t/conf/httpd.conf:
Can't locate CGI.pm in @INC (@INC contains: /v01/data/build/WEB/mod_perl-1.26/blib/lib /v01/data/build/WEB/mod_perl-1.26/blib/arch /v01/data/build/WEB/mod_perl-1.26/t/docs blib/arch blib/lib /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl /v01/data/build/WEB/mod_perl-1.26/t/ /v01/data/build/WEB/mod_perl-1.26/t/lib/perl) at /v01/data/build/WEB/mod_perl-1.26/t/net/perl/qredirect.pl line 2.
BEGIN failed--compilation aborted at /v01/data/build/WEB/mod_perl-1.26/t/net/perl/qredirect.pl line 2.
Compilation failed in require at /v01/data/build/WEB/mod_perl-1.26/t//docs/startup.pl line 101.
Compilation failed in require at (eval 1) line 1.
Can't locate CGI.pm in @INC (@INC contains: /v01/data/build/WEB/mod_perl-1.26/blib/lib /v01/data/build/WEB/mod_perl-1.26/blib/arch /v01/data/build/WEB/mod_perl-1.26/t/docs blib/arch blib/lib /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl /v01/data/build/WEB/mod_perl-1.26/t/ /v01/data/build/WEB/mod_perl-1.26/t/lib/perl) at /v01/data/build/WEB/mod_perl-1.26/t/net/perl/qredirect.pl line 2.
BEGIN failed--compilation aborted at /v01/data/build/WEB/mod_perl-1.26/t/net/perl/qredirect.pl line 2.
Compilation failed in require at /v01/data/build/WEB/mod_perl-1.26/t//docs/startup.pl line 101.
Compilation failed in require at (eval 1) line 1.
done
/bin/perl t/TEST 0
Can't locate LWP/UserAgent.pm in @INC (@INC contains: ../blib/lib ../blib/arch ../PERL5LIB=/v01/data/build/WEB/mod_perl-1.26/lib /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl ../.) at t/TEST line 48.
/bin/perl t/TEST 0
Can't locate LWP/UserAgent.pm in @INC (@INC contains: ../blib/lib ../blib/arch ../PERL5LIB=/v01/data/build/WEB/mod_perl-1.26/lib /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl ../.) at t/TEST line 48.
I still can't find LWP::UserAgent, try:
/bin/perl -MCPAN -e install LWP
/bin/perl -MCPAN -e install LWP
or
Must skip important tests without LWP...
kill `cat t/logs/httpd.pid`
cat: cannot open t/logs/httpd.pid
/bin/sh: usage: kill [ [ -sig ] id ... | -l ]
make: *** [kill_httpd] Error 1
cat: cannot open t/logs/httpd.pid
/bin/sh: usage: kill [ [ -sig ] id ... | -l ]
make: *** [kill_httpd] Error 1
<<<< modified as per above - make test output>>>
cp t/conf/mod_perl_srm.conf t/conf/srm.conf
../apache/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t &
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...done
/bin/perl t/TEST 0
still waiting for server to warm up......ok
ok
ok
modules/actions.....ok
modules/cgi.........ok
modules/constants...ok
modules/cookie......skipped test on this platform
modules/file........ok
modules/httpdconf...ok
modules/include.....ok
modules/log.........ok
modules/module......skipped test on this platform
modules/perlrun.....ok
modules/psections...skipped test on this platform
modules/request.....skipped test on this platform
modules/src.........ok
modules/ssi.........ok
modules/stage.......skipped test on this platform
modules/status......ok
modules/symbol......skipped test on this platform
modules/uri.........ok
modules/util........ok
internal/api........ok
internal/auth.......ok
internal/croak......ok
internal/dirmagic...ok
internal/error......ok
internal/headers....ok
internal/hooks......ok
internal/http-get...Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 425.
Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 426.
Use of uninitialized value in hex at /appl/perl/lib/Net/HTTP/Methods.pm line 427.
internal/http-get...ok 7/16Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 425.
Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 426.
Use of uninitialized value in hex at /appl/perl/lib/Net/HTTP/Methods.pm line 427.
Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 425.
Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 426.
Use of uninitialized value in hex at /appl/perl/lib/Net/HTTP/Methods.pm line 427.
Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 425.
Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 426.
Use of uninitialized value in hex at /appl/perl/lib/Net/HTTP/Methods.pm line 427.
Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 425.
Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 426.
Use of uninitialized value in hex at /appl/perl/lib/Net/HTTP/Methods.pm line 427.
Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 425.
Use of uninitialized value in substitution (s///) at /appl/perl/lib/Net/HTTP/Methods.pm line 426.
Use of uninitialized value in hex at /appl/perl/lib/Net/HTTP/Methods.pm line 427.
internal/http-get...ok
internal/http-post..ok
internal/proxy......ok
internal/redirect...ok
internal/rwrite.....ok
internal/stacked....ok
internal/table......ok
internal/taint......ok
All tests successful, 6 tests skipped.
Files=34, Tests=390, 32 wallclock secs (25.09 cusr + 3.92 csys = 29.01 CPU)
kill `cat t/logs/httpd.pid`
rm -f t/logs/httpd.pid
rm -f t/logs/error_log
