dbTalk Databases Forums  

Re: plpython win32

comp.databases.postgresql.patches comp.databases.postgresql.patches


Discuss Re: plpython win32 in the comp.databases.postgresql.patches forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Lane
 
Posts: n/a

Default Re: plpython win32 - 09-24-2004 , 02:53 PM






"Magnus Hagander" <mha (AT) sollentuna (DOT) net> writes:
Quote:
This patch attempts to fix the build of plpython on win32.
How is python_includespec going to get set if we don't run the
autoconf test that finds it out? I'm quite unthrilled with hardwiring
the python version number, as well.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
  #2  
Old   
Magnus Hagander
 
Posts: n/a

Default Re: plpython win32 - 09-24-2004 , 03:31 PM






Quote:
This patch attempts to fix the build of plpython on win32.

How is python_includespec going to get set if we don't run the
autoconf test that finds it out? I'm quite unthrilled with hardwiring
the python version number, as well.
We run the first part of the autoconf test. The one that sets
python_includespec. (PGAC_PATH_PYTHON) We just skip the parts that tries
to read the Makefile.

If there is a good way, that subst command could/should be changed to
just strip the last part of the directory. PGAC_PATH_PYTHON appends te
python version, which is not correct on win32.

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
  #3  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: plpython win32 - 09-24-2004 , 04:20 PM



Magnus Hagander wrote:
Quote:
This patch attempts to fix the build of plpython on win32. Needs
autoconf of course - don't have mine working on win32, so that part
hasn't been 100% tested. My tests involved #:ing out all the code
that would be included by that rule, and that makes it work, so I
think we're safe....
Please do not use PORTNAME in external macros. I like to think that one
can take these macros and put them in some other project without
requiring the prior setup that the PostgreSQL configure.in does.
Instead, use AC_REQUIRE([AC_CANONICAL_HOST]) and resolve the issue
using $host_os.

Also, add some comments to the magic you add in the makefiles.

The hardcoded Python version number will of course not stand the test of
time.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
  #4  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: plpython win32 - 09-24-2004 , 04:22 PM



Magnus Hagander wrote:
Quote:
If there is a good way, that subst command could/should be changed to
just strip the last part of the directory. PGAC_PATH_PYTHON appends
te python version, which is not correct on win32.
I'm curious to know how the code

AC_PATH_PROG(PYTHON, python)

"appends the python version".

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Reply With Quote
  #5  
Old   
Magnus Hagander
 
Posts: n/a

Default Re: plpython win32 - 09-24-2004 , 04:29 PM



Quote:
If there is a good way, that subst command could/should be changed to
just strip the last part of the directory. PGAC_PATH_PYTHON appends
te python version, which is not correct on win32.

I'm curious to know how the code

AC_PATH_PROG(PYTHON, python)

"appends the python version".
No. Not that one. PGAC_PATH_PYTHON. That is a different line. It's
defined in config/python.m4. The line is:

python_includespec="-I${python_prefix}/include/python${python_version}"


//Magnus

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Reply With Quote
  #6  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: plpython win32 - 09-24-2004 , 04:38 PM



Magnus Hagander wrote:
Quote:
No. Not that one. PGAC_PATH_PYTHON. That is a different line. It's
defined in config/python.m4. The line is:

python_includespec="-I${python_prefix}/include/python${python_version
}"
Are we reading the same code?

# PGAC_PATH_PYTHON
# ----------------
# Look for Python and set the output variable 'PYTHON'
# to 'python' if found, empty otherwise.
AC_DEFUN([PGAC_PATH_PYTHON],
[AC_PATH_PROG(PYTHON, python)
if test x"$PYTHON" = x""; then
AC_MSG_ERROR([Python not found])
fi
])

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
  #7  
Old   
Magnus Hagander
 
Posts: n/a

Default Re: plpython win32 - 09-24-2004 , 05:00 PM



Quote:
No. Not that one. PGAC_PATH_PYTHON. That is a different line. It's
defined in config/python.m4. The line is:

python_includespec="-I${python_prefix}/include/python${python_version
}"

Are we reading the same code?

# PGAC_PATH_PYTHON
# ----------------
# Look for Python and set the output variable 'PYTHON'
# to 'python' if found, empty otherwise.
AC_DEFUN([PGAC_PATH_PYTHON],
[AC_PATH_PROG(PYTHON, python)
if test x"$PYTHON" = x""; then
AC_MSG_ERROR([Python not found])
fi
])
Not quite. Further down in that same file. Seems I mean
PGAC_CHECK_PYTHON_DIRS :-) Not used to these files... I guess that means
that I'm off on the wrong path. :-(

Anyway. The issue is that there is no Makefile in $python_configdir.
That's the part that we need to get rid of. Any pointers? Some kind of
if in python.m4 then probably?

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
  #8  
Old   
Tom Lane
 
Posts: n/a

Default Re: plpython win32 - 09-24-2004 , 05:42 PM



"Magnus Hagander" <mha (AT) sollentuna (DOT) net> writes:
Quote:
We run the first part of the autoconf test. The one that sets
python_includespec. (PGAC_PATH_PYTHON) We just skip the parts that tries
to read the Makefile.
It would be better to put an "if" in the PGAC_CHECK_PYTHON_EMBED_SETUP
macro, and have it use some other technique for obtaining the info it
needs when on Windows.

If they don't have a Makefile, one would hope they have some other kind
of file that has the needed info. Or doesn't Python support embedding
on Windows?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
  #9  
Old   
Magnus Hagander
 
Posts: n/a

Default Re: plpython win32 - 09-25-2004 , 07:26 AM



Quote:
We run the first part of the autoconf test. The one that sets
python_includespec. (PGAC_PATH_PYTHON) We just skip the
parts that tries
to read the Makefile.

It would be better to put an "if" in the PGAC_CHECK_PYTHON_EMBED_SETUP
macro, and have it use some other technique for obtaining the info it
needs when on Windows.
Ok. I'll look into that.


Quote:
If they don't have a Makefile, one would hope they have some other kind
of file that has the needed info. Or doesn't Python support embedding
on Windows?
They do. They just don't install the Makefile (could be because it's all
built with MSVC).

The distutils module has a get_python_inc() function which returns the
include directory. If this one was used, we wouldn't have to hack up the
include path as I do now. Is there any reason this is not used on Unix,
instead of the hardcoded subdirectory-of-"python_prefix" way it is now?
(in _PGAC_CHECK_PYTHON_DIRS)

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
  #10  
Old   
Joe Conway
 
Posts: n/a

Default Re: plpython win32 - 09-25-2004 , 10:03 AM



Magnus Hagander wrote:
Quote:
The distutils module has a get_python_inc() function which returns the
include directory. If this one was used, we wouldn't have to hack up the
include path as I do now. Is there any reason this is not used on Unix,
instead of the hardcoded subdirectory-of-"python_prefix" way it is now?
(in _PGAC_CHECK_PYTHON_DIRS)
Probably because until about 2 weeks ago, we didn't check for, or use,
distutils at all ;-). Now we probably should.

Joe

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.