You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by Jim Gallacher <jp...@jgassociates.ca> on 2006/04/19 16:39:45 UTC

Re: svn commit: r394455 - in /httpd/mod_python/trunk: Doc/appendixc.tex src/hlist.c src/include/hlist.h src/include/mod_python.h src/include/mod_python.h.in src/mod_python.c src/requestobject.c test/htdocs/tests.py test/httpdconf.py test/test.py

grahamd@apache.org wrote:
> Author: grahamd
> Date: Sun Apr 16 03:49:39 2006
> New Revision: 394455
 > URL: http://svn.apache.org/viewcvs?rev=394455&view=rev

+1 Debian Sid, apache 2.2.0, python 2.4.2

-1 Debian Sid, apache 2.0.55, python 2.3.5

Compilation fails with this output:

make[1]: Entering directory `/tmp/mod_python/src'

Compiling for DSO.

/usr/bin/apxs2 -I/tmp/mod_python/src/include -I/usr/include/apache2 
-I/usr/include/python2.3 -c mod_python.c _apachemodule.c requestobject.c 
tableobject.c util.c serverobject.c connobject.c filterobject.c hlist.c 
hlistobject.c -L/usr/lib/python2.3/config  -Xlinker -export-dynamic 
  -lm  -lpython2.3   -lpthread -ldl  -lutil   -lm
/usr/bin/libtool --silent --mode=compile gcc -prefer-pic -pipe 
-I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 
-DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT 
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -pipe 
-I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 -pthread 
-I/usr/include/apache2  -I/usr/include/apr-0   -I/usr/include/apr-0 
-I/usr/include -I/tmp/mod_python/src/include -I/usr/include/apache2 
-I/usr/include/python2.3  -c -o mod_python.lo mod_python.c && touch 
mod_python.slo
In file included from mod_python.c:28:
/tmp/mod_python/src/include/mod_python.h:65: error: syntax error before 
'ap_regex_t'
/tmp/mod_python/src/include/mod_python.h:65: warning: useless type name 
in empty declaration
In file included from mod_python.c:28:
/tmp/mod_python/src/include/mod_python.h:66:1: warning: 
"AP_REG_EXTENDED" redefined
In file included from /usr/include/apache2/httpd.h:44,
                  from /tmp/mod_python/src/include/mod_python.h:42,
                  from mod_python.c:28:
/usr/include/apache2/ap_regex.h:44:1: warning: this is the location of 
the previous definition
In file included from mod_python.c:28:
/tmp/mod_python/src/include/mod_python.h:67:1: warning: "AP_REG_ICASE" 
redefined
In file included from /usr/include/apache2/httpd.h:44,
                  from /tmp/mod_python/src/include/mod_python.h:42,
                  from mod_python.c:28:
/usr/include/apache2/ap_regex.h:32:1: warning: this is the location of 
the previous definition
In file included from /usr/include/python2.3/Python.h:8,
                  from /tmp/mod_python/src/include/mod_python.h:75,
                  from mod_python.c:28:
/usr/include/python2.3/pyconfig.h:853:1: warning: "_POSIX_C_SOURCE" 
redefined
In file included from /usr/include/sys/types.h:27,
                  from /usr/include/apr-0/apr.h:113,
                  from /usr/include/apache2/ap_config.h:20,
                  from /usr/include/apache2/httpd.h:30,
                  from /tmp/mod_python/src/include/mod_python.h:42,
                  from mod_python.c:28:
/usr/include/features.h:150:1: warning: this is the location of the 
previous definition

<snip>

mod_python.c: In function 'determine_context':
mod_python.c:938: error: 'REG_EXTENDED' undeclared (first use in this 
function)
mod_python.c:938: error: (Each undeclared identifier is reported only once
mod_python.c:938: error: for each function it appears in.)
mod_python.c: In function 'directive_PythonHandlerModule':
mod_python.c:2264: warning: unused variable 'srv_conf'
mod_python.c: In function 'PythonChildInitHandler':
mod_python.c:2504: warning: unused variable 'ppath'
apxs:Error: Command failed with rc=65536

No time to dig in to this right now. Will investigate later.

Jim

Re: svn commit: r394455 - in /httpd/mod_python/trunk: Doc/appendixc.tex src/hlist.c src/include/hlist.h src/include/mod_python.h src/include/mod_python.h.in src/mod_python.c src/requestobject.c test/htdocs/tests.py test/httpdconf.py test/test.py

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 4/19/06, Jim Gallacher <jp...@jgassociates.ca> wrote:
> I don't know to what extent Debian-derived distributions such as Ubuntu
> use the stock Debian patches, but I wouldn't be suprised if we had
> compilation problems there as well. It's not too much of a stretch to
> think a similar patch may be applied in other distributions such as
> Redhat either.

I don't believe Ubuntu has any noticable diffs for Debian for apache2.
 (So, yes, the regex issue is on Debian as well.)  -- justin

Re: svn commit: r394455 - in /httpd/mod_python/trunk: Doc/appendixc.tex src/hlist.c src/include/hlist.h src/include/mod_python.h src/include/mod_python.h.in src/mod_python.c src/requestobject.c test/htdocs/tests.py test/httpdconf.py test/test.py

Posted by Jim Gallacher <jp...@jgassociates.ca>.
Jim Gallacher wrote:

> 
> I'm not sure about the most elegant way to handle this situation. 
> Perhaps something like:
> 
> #if !AP_MODULE_MAGIC_AT_LEAST(20050127,0)
> #ifndef(AP_REG_EXTENDED)
> typedef regex_t ap_regex_t;
> #define AP_REG_EXTENDED REG_EXTENDED
> #define AP_REG_ICASE REG_ICASE
> #endif
> #endif

And of course I really meant to type:
#ifndef AP_REG_EXTENDED

Patching src/include/mod_python.h.in accordingly fixes my compilation 
problem.

Jim

Re: svn commit: r394455 - in /httpd/mod_python/trunk: Doc/appendixc.tex src/hlist.c src/include/hlist.h src/include/mod_python.h src/include/mod_python.h.in src/mod_python.c src/requestobject.c test/htdocs/tests.py test/httpdconf.py test/test.py

Posted by Jim Gallacher <jp...@jgassociates.ca>.
Graham Dumpleton wrote:
> 
> On 20/04/2006, at 12:39 AM, Jim Gallacher wrote:
> 
>> grahamd@apache.org wrote:
>>
>>> Author: grahamd
>>> Date: Sun Apr 16 03:49:39 2006
>>> New Revision: 394455
>>
>> > URL: http://svn.apache.org/viewcvs?rev=394455&view=rev
>>
>> +1 Debian Sid, apache 2.2.0, python 2.4.2
>>
>> -1 Debian Sid, apache 2.0.55, python 2.3.5
>>
>> Compilation fails with this output:
>>
>> make[1]: Entering directory `/tmp/mod_python/src'
>>
>> Compiling for DSO.
>>
>> /usr/bin/apxs2 -I/tmp/mod_python/src/include -I/usr/include/apache2 
>> -I/usr/include/python2.3 -c mod_python.c _apachemodule.c 
>> requestobject.c tableobject.c util.c serverobject.c connobject.c 
>> filterobject.c hlist.c hlistobject.c -L/usr/lib/python2.3/config  
>> -Xlinker -export-dynamic  -lm  -lpython2.3   -lpthread -ldl  -lutil   -lm
>> /usr/bin/libtool --silent --mode=compile gcc -prefer-pic -pipe 
>> -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 
>> -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT 
>> -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -pipe 
>> -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 -pthread 
>> -I/usr/include/apache2  -I/usr/include/apr-0   -I/usr/include/apr-0 
>> -I/usr/include -I/tmp/mod_python/src/include -I/usr/include/apache2 
>> -I/usr/include/python2.3  -c -o mod_python.lo mod_python.c && touch 
>> mod_python.slo
>> In file included from mod_python.c:28:
>> /tmp/mod_python/src/include/mod_python.h:65: error: syntax error 
>> before 'ap_regex_t'
>> /tmp/mod_python/src/include/mod_python.h:65: warning: useless type 
>> name in empty declaration
>> In file included from mod_python.c:28:
>> /tmp/mod_python/src/include/mod_python.h:66:1: warning: 
>> "AP_REG_EXTENDED" redefined
> 
> 
> The AP_REG_EXTENDED macro shouldn't exist in Apache 2.0.55. It, along
> with ap_regex_t only came along in Apache 2.1.? sometime.
> 
> The code in mod_python.h which tries to accommodate the change is:
> 
> #if !AP_MODULE_MAGIC_AT_LEAST(20050127,0)
> typedef regex_t ap_regex_t;
> #define AP_REG_EXTENDED REG_EXTENDED
> #define AP_REG_ICASE REG_ICASE
> #endif
> 
> The regex_t type comes from pcreposix.h which is include by httpd.h
> which is included in mod_python.h prior to this point.
> 
> Either how I am using AP_MODULE_MAGIC_AT_LEAST is wrong, of you must be
> picking up a wrong header file somehow.
> 
> Bar ensuring you did a make distclean between builds, not sure what
> else to suggest.
> 
> Strange.

It's not strange, it's Debian!

The apache shipped with debian is heavily patched, including a backport 
of apache/include/ap_regex.h and removal of apache/include/pcreposix.h. 
As a result ap_regex_t, AP_REG_EXTENDED and AP_REG_ICASE are all 
defined, while regex_t, REG_EXTENDED and REG_ICASE are all missing. 
Hence my compilation error.

I don't know to what extent Debian-derived distributions such as Ubuntu 
use the stock Debian patches, but I wouldn't be suprised if we had 
compilation problems there as well. It's not too much of a stretch to 
think a similar patch may be applied in other distributions such as 
Redhat either.

If Nick (or should I say Ubuntu Nick to distiguish him from the other 
Nicks hanging around here?) has a free minute perhaps he could try 
compiling svn trunk to see what happens.

I'm not sure about the most elegant way to handle this situation. 
Perhaps something like:

#if !AP_MODULE_MAGIC_AT_LEAST(20050127,0)
#ifndef(AP_REG_EXTENDED)
typedef regex_t ap_regex_t;
#define AP_REG_EXTENDED REG_EXTENDED
#define AP_REG_ICASE REG_ICASE
#endif
#endif

Or maybe just skip the use of AP_MODULE_MAGIC_AT_LEAST entirely in this 
case and depend on the #ifndef?

Jim

Re: svn commit: r394455 - in /httpd/mod_python/trunk: Doc/appendixc.tex src/hlist.c src/include/hlist.h src/include/mod_python.h src/include/mod_python.h.in src/mod_python.c src/requestobject.c test/htdocs/tests.py test/httpdconf.py test/test.py

Posted by Graham Dumpleton <gr...@dscpl.com.au>.
On 20/04/2006, at 12:39 AM, Jim Gallacher wrote:

> grahamd@apache.org wrote:
>> Author: grahamd
>> Date: Sun Apr 16 03:49:39 2006
>> New Revision: 394455
> > URL: http://svn.apache.org/viewcvs?rev=394455&view=rev
>
> +1 Debian Sid, apache 2.2.0, python 2.4.2
>
> -1 Debian Sid, apache 2.0.55, python 2.3.5
>
> Compilation fails with this output:
>
> make[1]: Entering directory `/tmp/mod_python/src'
>
> Compiling for DSO.
>
> /usr/bin/apxs2 -I/tmp/mod_python/src/include -I/usr/include/apache2 
> -I/usr/include/python2.3 -c mod_python.c _apachemodule.c 
> requestobject.c tableobject.c util.c serverobject.c connobject.c 
> filterobject.c hlist.c hlistobject.c -L/usr/lib/python2.3/config  
> -Xlinker -export-dynamic  -lm  -lpython2.3   -lpthread -ldl  -lutil   
> -lm
> /usr/bin/libtool --silent --mode=compile gcc -prefer-pic -pipe 
> -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 
> -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT 
> -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -pipe 
> -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 -pthread 
> -I/usr/include/apache2  -I/usr/include/apr-0   -I/usr/include/apr-0 
> -I/usr/include -I/tmp/mod_python/src/include -I/usr/include/apache2 
> -I/usr/include/python2.3  -c -o mod_python.lo mod_python.c && touch 
> mod_python.slo
> In file included from mod_python.c:28:
> /tmp/mod_python/src/include/mod_python.h:65: error: syntax error 
> before 'ap_regex_t'
> /tmp/mod_python/src/include/mod_python.h:65: warning: useless type 
> name in empty declaration
> In file included from mod_python.c:28:
> /tmp/mod_python/src/include/mod_python.h:66:1: warning: 
> "AP_REG_EXTENDED" redefined

The AP_REG_EXTENDED macro shouldn't exist in Apache 2.0.55. It, along
with ap_regex_t only came along in Apache 2.1.? sometime.

The code in mod_python.h which tries to accommodate the change is:

#if !AP_MODULE_MAGIC_AT_LEAST(20050127,0)
typedef regex_t ap_regex_t;
#define AP_REG_EXTENDED REG_EXTENDED
#define AP_REG_ICASE REG_ICASE
#endif

The regex_t type comes from pcreposix.h which is include by httpd.h
which is included in mod_python.h prior to this point.

Either how I am using AP_MODULE_MAGIC_AT_LEAST is wrong, of you must be
picking up a wrong header file somehow.

Bar ensuring you did a make distclean between builds, not sure what
else to suggest.

Strange.

Graham

> In file included from /usr/include/apache2/httpd.h:44,
>                  from /tmp/mod_python/src/include/mod_python.h:42,
>                  from mod_python.c:28:
> /usr/include/apache2/ap_regex.h:44:1: warning: this is the location of 
> the previous definition
> In file included from mod_python.c:28:
> /tmp/mod_python/src/include/mod_python.h:67:1: warning: "AP_REG_ICASE" 
> redefined
> In file included from /usr/include/apache2/httpd.h:44,
>                  from /tmp/mod_python/src/include/mod_python.h:42,
>                  from mod_python.c:28:
> /usr/include/apache2/ap_regex.h:32:1: warning: this is the location of 
> the previous definition
> In file included from /usr/include/python2.3/Python.h:8,
>                  from /tmp/mod_python/src/include/mod_python.h:75,
>                  from mod_python.c:28:
> /usr/include/python2.3/pyconfig.h:853:1: warning: "_POSIX_C_SOURCE" 
> redefined
> In file included from /usr/include/sys/types.h:27,
>                  from /usr/include/apr-0/apr.h:113,
>                  from /usr/include/apache2/ap_config.h:20,
>                  from /usr/include/apache2/httpd.h:30,
>                  from /tmp/mod_python/src/include/mod_python.h:42,
>                  from mod_python.c:28:
> /usr/include/features.h:150:1: warning: this is the location of the 
> previous definition
>
> <snip>
>
> mod_python.c: In function 'determine_context':
> mod_python.c:938: error: 'REG_EXTENDED' undeclared (first use in this 
> function)
> mod_python.c:938: error: (Each undeclared identifier is reported only 
> once
> mod_python.c:938: error: for each function it appears in.)
> mod_python.c: In function 'directive_PythonHandlerModule':
> mod_python.c:2264: warning: unused variable 'srv_conf'
> mod_python.c: In function 'PythonChildInitHandler':
> mod_python.c:2504: warning: unused variable 'ppath'
> apxs:Error: Command failed with rc=65536
>
> No time to dig in to this right now. Will investigate later.
>
> Jim