You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Kevin A. McGrail" <KM...@PCCC.com> on 2013/02/08 16:39:25 UTC

MP and 2.4 Compilation Woes

Hi All,

So picking back up on the thread from the httpd list, I am interested in 
helping with mod_perl.  And I've written some patches for AuthenDBI and 
can work on those again as well.

However, at the moment I can't compile 2.4 and the make source_scan 
stuff is not something I even understand nor can I find much documented 
about it.

I've worked through Jan's patches downloaded 9/25 and the info on 
http://qteajs.org/howto/apache?_size=1920x1086 looked promising.

And even though I'm also using my own custom built perl 5.14 instead of 
the RH/CentOS builds I've tried so far, I've had no luck.

Following Jan's advice, I had to add this to ParseSource.pm

+     'APACHE_HTTP_VHOST_H', #c-scan chokes on http_host.h
+     'H_PERL', #""

That got me this far...

/usr/local/perl-5.14/bin/perl build/source_scan.pl
Expecting parenth after identifier in `const XML_Memory_Handling_Suite 
*memsuite'
after `const XML_Memory_Handling_Suite ' at lib/ModPerl/CScan.pm line 895.
  at lib/ModPerl/CScan.pm line 895
         ModPerl::CScan::do_declaration1('const 
XML_Memory_Handling_Suite *memsuite', 'HASH(0x1c321b8)', 
'HASH(0x1c0dcf0)', 1) called at lib/ModPerl/CScan.pm line 846
ModPerl::CScan::do_declaration('XML_Parser\x{a}XML_ParserCreate_MM(const 
XML_Char *encoding,\x{a}    ...', 'HASH(0x1c321b8)', 'HASH(0x1c0dcf0)') 
called at lib/ModPerl/CScan.pm line 764
         ModPerl::CScan::do_declarations('ARRAY(0x1c27780)', 
'HASH(0x1c321b8)', 'HASH(0x1c0dcf0)') called at 
/usr/local/perl-5.14/lib/site_perl/5.14.2/Data/Flow.pm line 93
Data::Flow::request('Apache2::ParseSource::Scan=ARRAY(0x1c46958)', 
'parsed_fdecls') called at 
/usr/local/perl-5.14/lib/site_perl/5.14.2/Data/Flow.pm line 46
Data::Flow::get('Apache2::ParseSource::Scan=ARRAY(0x1c46958)', 
'parsed_fdecls') called at lib/Apache2/ParseSource.pm line 68
Apache2::ParseSource::Scan::get('Apache2::ParseSource::Scan=ARRAY(0x1c46958)', 
'parsed_fdecls') called at lib/Apache2/ParseSource.pm line 410
Apache2::ParseSource::get_functions('Apache2::ParseSource=HASH(0x1bc6df0)') 
called at lib/Apache2/ParseSource.pm line 508
Apache2::ParseSource::write_functions_pm('Apache2::ParseSource=HASH(0x1bc6df0)') 
called at build/source_scan.pl line 18
make: *** [source_scan] Error 255

Overall, I think the concept that things should be forked to a new 2.4 
mod_perl is best because if it's backwards compatibility that's holding 
things back, I'd rather lose that.  I'm currently building on a devel 
box running on CentOS 6.2.

Regards,
KAM

Re: MP and 2.4 Compilation Woes

Posted by Jie Gao <J....@sydney.edu.au>.
* Kevin A. McGrail <KM...@PCCC.com> wrote:

>...
> Overall, I think the concept that things should be forked to a new
> 2.4 mod_perl is best because if it's backwards compatibility that's
> holding things back, I'd rather lose that.  I'm currently building
> on a devel box running on CentOS 6.2.

There was a similar discussion when apach2 came along, and the outcome
was that Stas started another version of mod_perl for it. There are enough
backward compatibility issues for us to start a new apache24 mod_perl.

-Jie

Re: MP and 2.4 Compilation Woes

Posted by Andy Colson <an...@squeakycode.net>.
On 2/8/2013 11:01 AM, Kevin A. McGrail wrote:
> On 2/8/2013 11:33 AM, Andy Colson wrote:
>> XML_Memory_Handling_Suite is from expat.  I have 2.0.1 installed.  Do
>> you have the expat-dev package installed?
> I did not, I do now, no apparent change.
>
> Regards,
> KAM

Maybe there are other dev packages?  apr-dev?  perl-dev?  I use 
slackware so I don't know what packages you need.

-Andy

Re: MP and 2.4 Compilation Woes

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
On 2/8/2013 11:33 AM, Andy Colson wrote:
> XML_Memory_Handling_Suite is from expat.  I have 2.0.1 installed.  Do 
> you have the expat-dev package installed?
I did not, I do now, no apparent change.

Regards,
KAM

Re: MP and 2.4 Compilation Woes

Posted by Andy Colson <an...@squeakycode.net>.
On 2/8/2013 10:30 AM, Andy Colson wrote:
> On 2/8/2013 10:09 AM, Kevin A. McGrail wrote:
>> On 2/8/2013 11:04 AM, Kevin A. McGrail wrote:
>>> On 2/8/2013 11:01 AM, Andy Colson wrote:
>>>> thought you had typed:
>>>>
>>>> >> > /usr/local/perl-5.14/bin/perl build/source_scan.pl
>>>>
>>>> Do you have multiple perl's installed?  /usr/local/perl-5.14 seems
>>>> unusual.
>>> I custom compiled a version of perl in /usr/local/perl-5.14
>>>> Any chance your picking up headers or libs from a different version
>>>> of perl?
>>> Always feasible but I only added that version of perl because things
>>> were worse with perl 5.10.1 from the RH/CentOS RPMs.
>> I should be cleared. I don't know if it's picking up other headers/libs,
>> etc.  I'm happy to look if you can give me a pointer in the right
>> direction and/or post output logs, etc.  At this point, I've been trying
>> to compile mp 2.4 and reading source for several few months with about 4
>> hours a week on this.  I've tried a LOT of different things and I can
>> try more including different boxes, reloading fresh OSes, etc.
>
> Here's how I did it.
>
> tar xf mod_perl-2.0-current.tar.gz
> cp all.tgz mod_perl-2.0.7/
> cd mod_perl-2.0.7/
> tar xf all.tgz
> for i in *.patch; do patch -p1 < $i; done
> perl Makefile.PL MP_APR_CONFIG=/usr/bin/apr-1-config
> make source_scan
>
> Some output from make source_scan:
> $ make source_scan
> /usr/bin/perl build/source_scan.pl
> In file included from .apache_includes:161:0,
>                   from <stdin>:1:
> /pub/apps/mod_perl-2.0.7/xs/modperl_xs_sv_convert.h:146:0: warning:
> "mp_xs_sv2_APR__Table" redefined [enabled by default]
> In file included from .apache_includes:160:0,
>                   from <stdin>:1:
> ... bunch more like this ...
> ... finishes ok ..
>
> Your error "Expecting parenth after identifier" looks like an h2xs
> error.  I'll look around a little more.
>
> -Andy
>
>
>
>
>

XML_Memory_Handling_Suite is from expat.  I have 2.0.1 installed.  Do 
you have the expat-dev package installed?

-Andy

Re: MP and 2.4 Compilation Woes

Posted by Andy Colson <an...@squeakycode.net>.
On 2/8/2013 10:09 AM, Kevin A. McGrail wrote:
> On 2/8/2013 11:04 AM, Kevin A. McGrail wrote:
>> On 2/8/2013 11:01 AM, Andy Colson wrote:
>>> thought you had typed:
>>>
>>> >> > /usr/local/perl-5.14/bin/perl build/source_scan.pl
>>>
>>> Do you have multiple perl's installed?  /usr/local/perl-5.14 seems
>>> unusual.
>> I custom compiled a version of perl in /usr/local/perl-5.14
>>> Any chance your picking up headers or libs from a different version
>>> of perl?
>> Always feasible but I only added that version of perl because things
>> were worse with perl 5.10.1 from the RH/CentOS RPMs.
> I should be cleared. I don't know if it's picking up other headers/libs,
> etc.  I'm happy to look if you can give me a pointer in the right
> direction and/or post output logs, etc.  At this point, I've been trying
> to compile mp 2.4 and reading source for several few months with about 4
> hours a week on this.  I've tried a LOT of different things and I can
> try more including different boxes, reloading fresh OSes, etc.

Here's how I did it.

tar xf mod_perl-2.0-current.tar.gz
cp all.tgz mod_perl-2.0.7/
cd mod_perl-2.0.7/
tar xf all.tgz
for i in *.patch; do patch -p1 < $i; done
perl Makefile.PL MP_APR_CONFIG=/usr/bin/apr-1-config
make source_scan

Some output from make source_scan:
$ make source_scan
/usr/bin/perl build/source_scan.pl
In file included from .apache_includes:161:0,
                  from <stdin>:1:
/pub/apps/mod_perl-2.0.7/xs/modperl_xs_sv_convert.h:146:0: warning: 
"mp_xs_sv2_APR__Table" redefined [enabled by default]
In file included from .apache_includes:160:0,
                  from <stdin>:1:
... bunch more like this ...
... finishes ok ..

Your error "Expecting parenth after identifier" looks like an h2xs 
error.  I'll look around a little more.

-Andy






Re: MP and 2.4 Compilation Woes

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
On 2/8/2013 11:04 AM, Kevin A. McGrail wrote:
> On 2/8/2013 11:01 AM, Andy Colson wrote:
>> thought you had typed:
>>
>> >> > /usr/local/perl-5.14/bin/perl build/source_scan.pl
>>
>> Do you have multiple perl's installed?  /usr/local/perl-5.14 seems 
>> unusual. 
> I custom compiled a version of perl in /usr/local/perl-5.14
>> Any chance your picking up headers or libs from a different version 
>> of perl?
> Always feasible but I only added that version of perl because things 
> were worse with perl 5.10.1 from the RH/CentOS RPMs.
I should be cleared. I don't know if it's picking up other headers/libs, 
etc.  I'm happy to look if you can give me a pointer in the right 
direction and/or post output logs, etc.  At this point, I've been trying 
to compile mp 2.4 and reading source for several few months with about 4 
hours a week on this.  I've tried a LOT of different things and I can 
try more including different boxes, reloading fresh OSes, etc.

Re: MP and 2.4 Compilation Woes

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
On 2/8/2013 11:01 AM, Andy Colson wrote:
> thought you had typed:
>
> >> > /usr/local/perl-5.14/bin/perl build/source_scan.pl
>
> Do you have multiple perl's installed?  /usr/local/perl-5.14 seems 
> unusual. 
I custom compiled a version of perl in /usr/local/perl-5.14
> Any chance your picking up headers or libs from a different version of 
> perl?
Always feasible but I only added that version of perl because things 
were worse with perl 5.10.1 from the RH/CentOS RPMs.

Regards,
KAM

Re: MP and 2.4 Compilation Woes

Posted by Andy Colson <an...@squeakycode.net>.
On 2/8/2013 9:55 AM, Kevin A. McGrail wrote:
> On 2/8/2013 10:48 AM, Andy Colson wrote:
>> On 2/8/2013 9:39 AM, Kevin A. McGrail wrote:
>>> Hi All,
>>>
>>
>>
>> > /usr/local/perl-5.14/bin/perl build/source_scan.pl
>>
>> Have you tried:
>>
>> make source_scan
> Yes.  That info above is the output from the end of make source_scan
> with Jan's patches, the extra patch I did similar to the 0027 patch of
> his and I think some minor patches from the qteajs.  I am stuck at this
> step.
>
>> make xs_generate
>>
>> -Andy
>

ah, sorry.  I thought you had typed:

 >> > /usr/local/perl-5.14/bin/perl build/source_scan.pl

Do you have multiple perl's installed?  /usr/local/perl-5.14 seems 
unusual.  Any chance your picking up headers or libs from a different 
version of perl?

-Andy


Re: MP and 2.4 Compilation Woes

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
On 2/8/2013 10:48 AM, Andy Colson wrote:
> On 2/8/2013 9:39 AM, Kevin A. McGrail wrote:
>> Hi All,
>>
>> So picking back up on the thread from the httpd list, I am interested in
>> helping with mod_perl.  And I've written some patches for AuthenDBI and
>> can work on those again as well.
>>
>> However, at the moment I can't compile 2.4 and the make source_scan
>> stuff is not something I even understand nor can I find much documented
>> about it.
>>
>> I've worked through Jan's patches downloaded 9/25 and the info on
>> http://qteajs.org/howto/apache?_size=1920x1086 looked promising.
>>
>> And even though I'm also using my own custom built perl 5.14 instead of
>> the RH/CentOS builds I've tried so far, I've had no luck.
>>
>> Following Jan's advice, I had to add this to ParseSource.pm
>>
>> +     'APACHE_HTTP_VHOST_H', #c-scan chokes on http_host.h
>> +     'H_PERL', #""
>>
>> That got me this far...
>>
>> /usr/local/perl-5.14/bin/perl build/source_scan.pl
>> Expecting parenth after identifier in `const XML_Memory_Handling_Suite
>> *memsuite'
>> after `const XML_Memory_Handling_Suite ' at lib/ModPerl/CScan.pm line 
>> 895.
>> make: *** [source_scan] Error 255
>>
>> Overall, I think the concept that things should be forked to a new 2.4
>> mod_perl is best because if it's backwards compatibility that's holding
>> things back, I'd rather lose that.  I'm currently building on a devel
>> box running on CentOS 6.2.
>>
>> Regards,
>> KAM
>
>
> > /usr/local/perl-5.14/bin/perl build/source_scan.pl
>
> Have you tried:
>
> make source_scan
Yes.  That info above is the output from the end of make source_scan 
with Jan's patches, the extra patch I did similar to the 0027 patch of 
his and I think some minor patches from the qteajs.  I am stuck at this 
step.

> make xs_generate
>
> -Andy


Re: MP and 2.4 Compilation Woes

Posted by Andy Colson <an...@squeakycode.net>.
On 2/8/2013 9:39 AM, Kevin A. McGrail wrote:
> Hi All,
>
> So picking back up on the thread from the httpd list, I am interested in
> helping with mod_perl.  And I've written some patches for AuthenDBI and
> can work on those again as well.
>
> However, at the moment I can't compile 2.4 and the make source_scan
> stuff is not something I even understand nor can I find much documented
> about it.
>
> I've worked through Jan's patches downloaded 9/25 and the info on
> http://qteajs.org/howto/apache?_size=1920x1086 looked promising.
>
> And even though I'm also using my own custom built perl 5.14 instead of
> the RH/CentOS builds I've tried so far, I've had no luck.
>
> Following Jan's advice, I had to add this to ParseSource.pm
>
> +     'APACHE_HTTP_VHOST_H', #c-scan chokes on http_host.h
> +     'H_PERL', #""
>
> That got me this far...
>
> /usr/local/perl-5.14/bin/perl build/source_scan.pl
> Expecting parenth after identifier in `const XML_Memory_Handling_Suite
> *memsuite'
> after `const XML_Memory_Handling_Suite ' at lib/ModPerl/CScan.pm line 895.
> make: *** [source_scan] Error 255
>
> Overall, I think the concept that things should be forked to a new 2.4
> mod_perl is best because if it's backwards compatibility that's holding
> things back, I'd rather lose that.  I'm currently building on a devel
> box running on CentOS 6.2.
>
> Regards,
> KAM


 > /usr/local/perl-5.14/bin/perl build/source_scan.pl

Have you tried:

make source_scan
make xs_generate

-Andy


Re: MP and 2.4 Compilation Woes

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
On 2/11/2013 4:54 AM, Jan Kaluža wrote:
> On 02/08/2013 04:39 PM, Kevin A. McGrail wrote:
>> Following Jan's advice, I had to add this to ParseSource.pm
>>
>> +     'APACHE_HTTP_VHOST_H', #c-scan chokes on http_host.h
>> +     'H_PERL', #""
>>
>> That got me this far...
>
> Have you applied all my patches? This particular problem looks like 
> the one I've fixed in this patch:
>
> http://jkaluza.fedorapeople.org/mod_perl/0027-Do-no-cscan-expat-and-byteswap.patch 
>
Definitely.  I've intimately studied your patches and my notes above for 
ParseSource.pm are in addition to your patch based on feedback you've 
given previously.
> If you have applied this patch and the problem is still there, you 
> have to grep /usr/include to find out which header declares 
> "XML_ParserCreate_MM", check the #ifdef guard in that file and add it 
> to ParseSource.pm as it's done for Expat in path 0027, so 
> source_scan.pl won't try to parse that header file.
Unfortunately, the header for XML_ParserCreate_MM is expat.h which 
Expat_INCLUDED is already the purpose of your 0027 patch.



So that's leaves me at this error:

make source_scan
/usr/local/perl-5.14/bin/perl build/source_scan.pl
Expecting parenth after identifier in `const XML_Memory_Handling_Suite 
*memsuite'
after `const XML_Memory_Handling_Suite ' at lib/ModPerl/CScan.pm line 895.
  at lib/ModPerl/CScan.pm line 895
         ModPerl::CScan::do_declaration1('const 
XML_Memory_Handling_Suite *memsuite', 'HASH(0x35082e8)', 
'HASH(0x34e3e20)', 1) called at lib/ModPerl/CScan.pm line 846
ModPerl::CScan::do_declaration('XML_Parser\x{a}XML_ParserCreate_MM(const 
XML_Char *encoding,\x{a}    ...', 'HASH(0x35082e8)', 'HASH(0x34e3e20)') 
called at lib/ModPerl/CScan.pm line 764
         ModPerl::CScan::do_declarations('ARRAY(0x34cdba0)', 
'HASH(0x35082e8)', 'HASH(0x34e3e20)') called at 
/usr/local/perl-5.14/lib/site_perl/5.14.2/Data/Flow.pm line 93
Data::Flow::request('Apache2::ParseSource::Scan=ARRAY(0x34d8de0)', 
'parsed_fdecls') called at 
/usr/local/perl-5.14/lib/site_perl/5.14.2/Data/Flow.pm line 46
Data::Flow::get('Apache2::ParseSource::Scan=ARRAY(0x34d8de0)', 
'parsed_fdecls') called at lib/Apache2/ParseSource.pm line 68
Apache2::ParseSource::Scan::get('Apache2::ParseSource::Scan=ARRAY(0x34d8de0)', 
'parsed_fdecls') called at lib/Apache2/ParseSource.pm line 410
Apache2::ParseSource::get_functions('Apache2::ParseSource=HASH(0x349cf00)') 
called at lib/Apache2/ParseSource.pm line 508
Apache2::ParseSource::write_functions_pm('Apache2::ParseSource=HASH(0x349cf00)') 
called at build/source_scan.pl line 18
make: *** [source_scan] Error 255

If I go further, I start to spiral a lot of exclusions that seemed to be 
modperl includes themselves which just seems messed up...  I'm guessing 
perhaps there is a hard-coded exclusion somewhere by path or something 
because all of these MOD_PERL exclusions seem ridiculous...


make source_scan
/usr/local/perl-5.14/bin/perl build/source_scan.pl
Expecting parenth after identifier in `pTHX_ request_rec *r'
after `pTHX_ ' at lib/ModPerl/CScan.pm line 895.
  at lib/ModPerl/CScan.pm line 895
         ModPerl::CScan::do_declaration1('pTHX_ request_rec *r', 
'HASH(0x258c420)', 'HASH(0x2567f28)', 0) called at lib/ModPerl/CScan.pm 
line 846
         ModPerl::CScan::do_declaration('apr_status_t 
modperl_config_request_cleanup(pTHX_ request_rec...', 'HASH(0x258c420)', 
'HASH(0x2567f28)') called at lib/ModPerl/CScan.pm line 764
         ModPerl::CScan::do_declarations('ARRAY(0x2551e88)', 
'HASH(0x258c420)', 'HASH(0x2567f28)') called at 
/usr/local/perl-5.14/lib/site_perl/5.14.2/Data/Flow.pm line 93
Data::Flow::request('Apache2::ParseSource::Scan=ARRAY(0x255ce48)', 
'parsed_fdecls') called at 
/usr/local/perl-5.14/lib/site_perl/5.14.2/Data/Flow.pm line 46
Data::Flow::get('Apache2::ParseSource::Scan=ARRAY(0x255ce48)', 
'parsed_fdecls') called at lib/Apache2/ParseSource.pm line 68
Apache2::ParseSource::Scan::get('Apache2::ParseSource::Scan=ARRAY(0x255ce48)', 
'parsed_fdecls') called at lib/Apache2/ParseSource.pm line 421
Apache2::ParseSource::get_functions('Apache2::ParseSource=HASH(0x25211d8)') 
called at lib/Apache2/ParseSource.pm line 519
Apache2::ParseSource::write_functions_pm('Apache2::ParseSource=HASH(0x25211d8)') 
called at build/source_scan.pl line 18
make: *** [source_scan] Error 255

Index: lib/Apache2/ParseSource.pm
===================================================================
--- lib/Apache2/ParseSource.pm  (revision 1)
+++ lib/Apache2/ParseSource.pm  (working copy)
@@ -75,8 +75,27 @@
      '_NETINET_TCP_H', #c-scan chokes on netinet/tcp.h
      '_BYTESWAP_H', #c-scan chokes on byteswap.h
      '_BITS_BYTESWAP_H', #c-scan chokes on byteswap.h
-    'Expat_INCLUDED', #c-scan chokes on expath.h
+    'Expat_INCLUDED', #c-scan chokes on expat.h
+    'XmlParse_INCLUDED', #c-scan chokes on 
/usr/local/apache2/include/expat.h
+    'APACHE_HTTP_VHOST_H', #c-scan chokes on http_vhost.h
+    'H_PERL', #c-scan chokes on perl.h
   #   'APR_OPTIONAL_H', #c-scan chokes on apr_optional.h
+    'MODPERL_ERROR_H', #c-scan chokes on modperl_error.h
+    'MODPERL_FLAGS_H', #c-scan chokes on modperl_flags.h
+    'MODPERL_PERL_GLOBAL_H', #c-scan chokes on modperl_perl_global.h
+    'MODPERL_SYS_H',
+    'MODPERL_CONSTANTS_H',
+    'MODPERL_COMMON_UTIL_H',
+    'MODPERL_PERL_H',
+    'MODPERL_CONST_H',
+    'MODPERL_UTIL_H',
+    'MODPERL_IO_H',
+    'MODPERL_CONFIG_H',
+    'MODPERL_HANDLER_H',
+    'MODPERL_CALLBACK_H',
+    'USE_ITHREADS',
+    'MODPERL_INTERP_H',
+    'MODPERL_IO_APACHE_H',
      'apr_table_do_callback_fn_t=void', #c-scan chokes on function pointers
  );




> This way of building is not right, because it really depends on all 
> headers you have installed in your system and in the order in which 
> they are included.
>
> For the proper fix, see below.
It makes sense to me both to create a 2.4 version and the idea re: 
source_scan.pl
>
>> Overall, I think the concept that things should be forked to a new 2.4
>> mod_perl is best because if it's backwards compatibility that's holding
>> things back, I'd rather lose that.  I'm currently building on a devel
>> box running on CentOS 6.2.
>
> This is what we should do I think. If we decide to have two branches 
> (one for 2.2 and one for 2.4), we can run source_scan.pl on properly 
> configured system and commit the code generated by that script. I 
> think this is how 2.2 mod_perl was initially created by 
> source_scan.pl. After that, users who want to compile mod_perl don't 
> have to run source_scan.pl themselves and lot of compilation problems 
> like the one you have will go away.
Based on previous mod_perl 2's fork that was needed for apache httpd 
2.X, I think we need to do this.  Anything else is likely to hold up the 
process.

And yes, I think this is what was done because until I started working 
with 2.4, I had never run source_scan.pl.  The files are also tagged 
that distributions don't need them as they are for mp developers.

I'll keep working on 2.4 support and getting AuthenDBI working!

Regards,
KAM