You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Geoffrey Young <ge...@modperlcookbook.org> on 2003/04/02 22:41:04 UTC
[patch] ModPerl::BuildMM and Apache2
(this is kinda verbose. jumping to the patch at the end is probably just as
clear :)
ok, while trying to track down the filter remove problem I removed all
traces of mod_perl 2.0 from perl's @INC - everything under Apache2/ as well
as Apache2.pm and all the Apache::Test stuff.
it seems that if I do that I can't run make test due Apache2 not being
found. Apache2 is now included by default in the various t/TEST scripts due
to recent changes in modperl_2_inc_fixup().
/src/bleedperl/bin/perl -Iblib/arch/Apache2 -Iblib/lib/Apache2 \
t/TEST -clean
Can't locate Apache2.pm in @INC
so, I added blib to two targets in Makefile.PL. that fixes it for the first
invocation, but the ulimit workaround now fails
/src/bleedperl/bin/perl -Iblib/arch/Apache2 -Iblib/lib/Apache2 -Mblib \
t/TEST -clean
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -clean
Can't locate Apache2.pm in @INC
basically, the workaround of reissuing t/TEST via the shell doesn't take
into account additional arguments that make may supply. skipping the ulimit
with APACHE_TEST_ULIMIT_SET=1 fixes this and the tests now run. however,
$ t/TEST t/filter/out_str_remove.t -v
Can't locate Apache2.pm in @INC
even though we've found a way to work around it for the installation, you
still can't run t/TEST by itself.
so, I'd say that including 'use Apache2;' by default via
modperl_2_inc_fixup() is a bad idea from a mod_perl build standpoint
however, back to my point from yesterday, for third party module support I
would want it included by default, especially via
Apache::TestRun::generate_script(). so, I propose the below patch, which
overrides modperl_2_inc_fixup() just for the mod_perl build process. the
patch depends on Makefile.PL including Apache::TestConfig before it includes
ModPerl::BuildMM, so I guess there could be some other things to work out.
but in the meanwhile, we're back to a fresh install working.
also included are some TEST.PL cleanups - the shebang line is generated so
we don't need to include it in the template as well.
oh, and sorry for the long post :)
--Geoff
Index: lib/ModPerl/BuildMM.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/lib/ModPerl/BuildMM.pm,v
retrieving revision 1.7
diff -u -r1.7 BuildMM.pm
--- lib/ModPerl/BuildMM.pm 27 Mar 2003 01:17:33 -0000 1.7
+++ lib/ModPerl/BuildMM.pm 2 Apr 2003 18:58:00 -0000
@@ -269,4 +269,7 @@
$path;
}
+# override Apache2 inclusion with a no-op
+*Apache::TestConfig::modperl_2_inc_fixup = sub {};
+
1;
Index: Apache-Test/t/TEST.PL
===================================================================
RCS file: /home/cvspublic/httpd-test/perl-framework/Apache-Test/t/TEST.PL,v
retrieving revision 1.2
diff -u -r1.2 TEST.PL
--- Apache-Test/t/TEST.PL 31 May 2002 15:45:28 -0000 1.2
+++ Apache-Test/t/TEST.PL 2 Apr 2003 18:58:00 -0000
@@ -1,5 +1,3 @@
-#!perl
-
use strict;
use warnings FATAL => 'all';
Index: ModPerl-Registry/t/TEST.PL
===================================================================
RCS file: /home/cvspublic/modperl-2.0/ModPerl-Registry/t/TEST.PL,v
retrieving revision 1.6
diff -u -r1.6 TEST.PL
--- ModPerl-Registry/t/TEST.PL 8 Mar 2003 19:08:41 -0000 1.6
+++ ModPerl-Registry/t/TEST.PL 2 Apr 2003 18:58:00 -0000
@@ -1,5 +1,3 @@
-#!perl
-
use strict;
use warnings FATAL => 'all';
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [patch] ModPerl::BuildMM and Apache2
Posted by Stas Bekman <st...@stason.org>.
[...]
>> is this related?
>
>
> no. from my last post (it was easy to miss)
>
> "also included are some TEST.PL cleanups - the shebang line is generated
> so we don't need to include it in the template as well."
>
> if you take a look at the generated TEST files they look like
>
> #!/src/bleedperl/bin/perl
> # WARNING: this file is generated, do not edit
> [snip]
>
> #!perl
Of course, thanks Geoff! Now committed.
__________________________________________________________________
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: [patch] ModPerl::BuildMM and Apache2
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> Thanks Geoff, I've applied this patch instead:
[snip]
> seems to work for me.
me too. nice.
>
>> Index: Apache-Test/t/TEST.PL
>> ===================================================================
>> RCS file:
>> /home/cvspublic/httpd-test/perl-framework/Apache-Test/t/TEST.PL,v
>> retrieving revision 1.2
>> diff -u -r1.2 TEST.PL
>> --- Apache-Test/t/TEST.PL 31 May 2002 15:45:28 -0000 1.2
>> +++ Apache-Test/t/TEST.PL 2 Apr 2003 18:58:00 -0000
>> @@ -1,5 +1,3 @@
>> -#!perl
>> -
>> use strict;
>> use warnings FATAL => 'all';
>>
>> Index: ModPerl-Registry/t/TEST.PL
>> ===================================================================
>> RCS file: /home/cvspublic/modperl-2.0/ModPerl-Registry/t/TEST.PL,v
>> retrieving revision 1.6
>> diff -u -r1.6 TEST.PL
>> --- ModPerl-Registry/t/TEST.PL 8 Mar 2003 19:08:41 -0000 1.6
>> +++ ModPerl-Registry/t/TEST.PL 2 Apr 2003 18:58:00 -0000
>> @@ -1,5 +1,3 @@
>> -#!perl
>> -
>> use strict;
>> use warnings FATAL => 'all';
>
>
> is this related?
no. from my last post (it was easy to miss)
"also included are some TEST.PL cleanups - the shebang line is generated so
we don't need to include it in the template as well."
if you take a look at the generated TEST files they look like
#!/src/bleedperl/bin/perl
# WARNING: this file is generated, do not edit
[snip]
#!perl
--Geoff
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [patch] ModPerl::BuildMM and Apache2
Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> (this is kinda verbose. jumping to the patch at the end is probably
> just as clear :)
>
> ok, while trying to track down the filter remove problem I removed all
> traces of mod_perl 2.0 from perl's @INC - everything under Apache2/ as
> well as Apache2.pm and all the Apache::Test stuff.
>
> it seems that if I do that I can't run make test due Apache2 not being
> found. Apache2 is now included by default in the various t/TEST scripts
> due to recent changes in modperl_2_inc_fixup().
>
> /src/bleedperl/bin/perl -Iblib/arch/Apache2 -Iblib/lib/Apache2 \
> t/TEST -clean
> Can't locate Apache2.pm in @INC
Thanks Geoff, I've applied this patch instead:
--- Apache-Test/lib/Apache/TestConfig.pm 27 Mar 2003 07:57:06 -0000
1.148
+++ Apache-Test/lib/Apache/TestConfig.pm 4 Apr 2003 00:27:47 -0000
@@ -113,7 +113,9 @@
sub server { shift->{server} }
sub modperl_2_inc_fixup {
- (eval { require mod_perl } && $mod_perl::VERSION >= 1.99)
+
+ (eval { require mod_perl } && $mod_perl::VERSION >= 1.99 &&
+ eval { require Apache::Build } && !Apache::Build::IS_MOD_PERL_BUILD())
? "use Apache2;\n"
: '';
}
seems to work for me.
> Index: Apache-Test/t/TEST.PL
> ===================================================================
> RCS file: /home/cvspublic/httpd-test/perl-framework/Apache-Test/t/TEST.PL,v
> retrieving revision 1.2
> diff -u -r1.2 TEST.PL
> --- Apache-Test/t/TEST.PL 31 May 2002 15:45:28 -0000 1.2
> +++ Apache-Test/t/TEST.PL 2 Apr 2003 18:58:00 -0000
> @@ -1,5 +1,3 @@
> -#!perl
> -
> use strict;
> use warnings FATAL => 'all';
>
> Index: ModPerl-Registry/t/TEST.PL
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/ModPerl-Registry/t/TEST.PL,v
> retrieving revision 1.6
> diff -u -r1.6 TEST.PL
> --- ModPerl-Registry/t/TEST.PL 8 Mar 2003 19:08:41 -0000 1.6
> +++ ModPerl-Registry/t/TEST.PL 2 Apr 2003 18:58:00 -0000
> @@ -1,5 +1,3 @@
> -#!perl
> -
> use strict;
> use warnings FATAL => 'all';
is this related?
__________________________________________________________________
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