Re: mod_perl build with perlbrew

Bill Moseley <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAKhN_m4q_hpPVASFM4iA5zBgjNHsHPcsNtF=2fVeZ05bdWoRGQ@mail.gmail.com>
On Wed, Sep 19, 2012 at 12:43 PM, bluedome <[email protected]> wrote:

>
>
> I'm building mod_perl with a perl built using perlbrew.
>
> The build succeeds but make test fails because @INC is not correct.
>
> @INC for the perlbrew-built perl is:
>
>   @INC:
>
>
> /opt/comms/be/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/x86_64-linux
>     /opt/comms/be/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0
>     /opt/comms/be/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/x86_64-linux
>     /opt/comms/be/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0
>
> I built mod_perl with this perl, so it seems like it should keep this in
> INC, but it doesn't.  When I run
> apache the INC is:
>
> /usr/sbin/httpd  -d /opt/comms/be/code/apache_extensions/mod_perl-2.0.7/t
> -f
> /opt/comms/be/code/apache_extensions/mod_perl-2.0.7/t/conf/httpd.conf -D
> APACHE2
> using Apache/2.2.15 (prefork MPM)
>

I'm not sure I had the same problem, but it was kind of a pain to make
mod_perl work with Perlbrew.  I wanted to be able to simply run "cpanm
mod_perl2" and have it installed from CPAN.   But, that means not
installing modules in the default location.

So, I added this to a local copy of mod_perl's Makefile.PL and then saved
the new mod_perl tarball in our local repo.


+if ( $ENV{PERLBREW_ROOT} ) {
+    my $root = "$ENV{PERLBREW_ROOT}/perls/$ENV{PERLBREW_PERL}";
+    die "$root directory not found" unless -d $root;
+    push @ARGV, "MP_AP_DESTDIR=$root";
+}
+else {
+    die "Must be in PERLBREW environment";
+}

I also have to set DESTDIR, although that might be for libapreq2.

The other odd thing is tests failed because the tests were somehow loading
the exiting httpd.conf files in /etc/httpd.   Shouldn't do that, right?



-- 
Bill Moseley
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.