[Python-Dev] PEP 229 checked in

Thomas Wouters thomas@xs4all.net
Wed, 17 Jan 2001 23:49:25 +0100


On Wed, Jan 17, 2001 at 02:04:04PM -0500, Andrew Kuchling wrote:
> I've checked in the last bit of the PEP 229 changes.  Be sure to
> rename your Modules/Setup file (or do a 'make distclean' before
> rebuilding.

make distclean doesn't remove Modules/Setup anymore :) Also, I couldn't get
it to work with an old tree, even after several make distclean/reconfigures.
I got tired looking for it, so I just grabbed a new tree.

> Squeal if you run into trouble, or file bugs on SF.

I have a couple of questions: what to do when setup.py doesn't work ? Is
there a way to make it bypass a module ? What about specifying include dirs
manually, for some modules (for instance, when you have readline source in a
separate directory, and want to link it statically.)

Here are are some specific squeals. See at the bottom for the most important
one :)

On BSDI, readline sits in /usr/local or /usr/contrib, and isn't detected by
setup.py. Also, SSL support for the socket module was not enabled, though
OpenSSL is installed, in the default path.

On Debian GNU/Linux' 'woody', the 'testing' (soon 'stable') branch, I can't
compile dbmmodule:

building 'dbm' extension
gcc -g -O2 -Wall -Wstrict-prototypes -fPIC -fpic -I. -I/home/thomas/python/python/dist/src/./Include -IInclude/ -c /home/thomas/python/python/dist/src/Modules/dbmmodule.c -o build/temp.linux-i686-2.1/dbmmodule.o
/home/thomas/python/python/dist/src/Modules/dbmmodule.c:24: #error "No ndbm.h available!"
error: command 'gcc' failed with exit status 1
make: *** [sharedmods] Error 1

(ndbm.h does exist, as /usr/include/db1/ndbm.h. There is also
/usr/include/gdbm-ndbm.h, but I'm not sure if that's the same.)

Nor can I build the _tkinter module there:

building '_tkinter' extension
gcc -g -O2 -Wall -Wstrict-prototypes -fPIC -fpic -DWITH_APPINIT=1 -I/usr/X11R6/include -I. -I/home/thomas/python/python/dist/src/./Include -IInclude/ -c /home/thomas/python/python/dist/src/Modules/_tkinter.c -o build/temp.linux-i686-2.1/_tkinter.o
/home/thomas/python/python/dist/src/Modules/_tkinter.c:44: tcl.h: No such file or directory
In file included from /home/thomas/python/python/dist/src/Modules/_tkinter.c:45:/usr/include/tk.h:66: tcl.h: No such file or directory
error: command 'gcc' failed with exit status 1
make: *** [sharedmods] Error 1

The Tcl/Tk header files are stored in /usr/include/tcl<ver>/ on Debian,
which I personally like a lot, though it's probably a bitch to autodetect.
(I tried, using autoconf ;-P)

On Debian GNU/Linux 'sid', the current unstable branch, I can't compile
Python at all, now:

c++  -Xlinker -export-dynamic python.o \
          ../libpython2.1.a   -lpthread -ldl  -lutil -lm  -o python
../libpython2.1.a(posixmodule.o): In function `posix_tmpnam':
/home/thomas/python/python-write/dist/src/Modules/./posixmodule.c:4115: the use of `tmpnam_r' is dangerous, better use `mkstemp'
../libpython2.1.a(posixmodule.o): In function `posix_tempnam':
/home/thomas/python/python-write/dist/src/Modules/./posixmodule.c:4071: the use of `tempnam' is dangerous, better use `mkstemp'
mv python ../python
make[1]: Leaving directory `/home/thomas/python/python-write/dist/src/Modules'
./python ./setup.py build
running build
running build_ext
Traceback (most recent call last):
  File "./setup.py", line 460, in ?
    main()
  File "./setup.py", line 455, in main
    ext_modules=[Extension('struct', ['structmodule.c'])]
  File "/home/thomas/python/python-write/dist/src/Lib/distutils/core.py", line 138, in setup
    dist.run_commands()
  File "/home/thomas/python/python-write/dist/src/Lib/distutils/dist.py", line 871, in run_commands
    self.run_command(cmd)
  File "/home/thomas/python/python-write/dist/src/Lib/distutils/dist.py", line 891, in run_command
    cmd_obj.run()
  File "/home/thomas/python/python-write/dist/src/Lib/distutils/command/build.py", line 106, in run
    self.run_command(cmd_name)
  File "/home/thomas/python/python-write/dist/src/Lib/distutils/cmd.py", line 328, in run_command
    self.distribution.run_command(command)
  File "/home/thomas/python/python-write/dist/src/Lib/distutils/dist.py", line 891, in run_command
    cmd_obj.run()
  File "/home/thomas/python/python-write/dist/src/Lib/distutils/command/build_ext.py", line 202, in run
    customize_compiler(self.compiler)
  File "/home/thomas/python/python-write/dist/src/Lib/distutils/sysconfig.py", line 121, in customize_compiler
    (cc, opt, ccshared, ldshared, so_ext) = \
  File "/home/thomas/python/python-write/dist/src/Lib/distutils/sysconfig.py", line 389, in get_config_vars
    func()
  File "/home/thomas/python/python-write/dist/src/Lib/distutils/sysconfig.py", line 302, in _init_posix
    raise DistutilsPlatformError, my_msg
distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /usr/lib/python2.1/config/Makefile (No such file or directory)
make: *** [sharedmods] Error 1

For the record, I don't have a /usr/lib/python2.1 directory on the other
machines either.

I haven't been able to test FreeBSD yet, will get to that later tonight.

And most importantly(!), on all these machines, 'make test' stops
functioning. In fact, after setup.py started building, you can't run 'make'
without 'make clean' anymore. You get a lot of undefined-symbol warnings
(see below.) If you run 'make clean;make test' it also doesn't work, because
the build directory is not in the Python library path, and regrtest.py
requires (at least) the time module.

c++  -Xlinker -export-dynamic python.o \
          ../libpython2.1.a   -lpthread -ldl  -lutil -lm  -o python 
../libpython2.1.a(posixmodule.o): In function `posix_tmpnam':
/home/thomas/python/python/dist/src/Modules/./posixmodule.c:4115: the use of `tmpnam_r' is dangerous, better use `mkstemp'
../libpython2.1.a(posixmodule.o): In function `posix_tempnam':
/home/thomas/python/python/dist/src/Modules/./posixmodule.c:4071: the use of `tempnam' is dangerous, better use `mkstemp'
../libpython2.1.a(myreadline.o): In function `my_fgets':
/home/thomas/python/python/dist/src/Parser/myreadline.c:41: undefined reference to `PyOS_InterruptOccurred'
/home/thomas/python/python/dist/src/Parser/myreadline.c:35: undefined reference to `PyOS_InterruptOccurred'
../libpython2.1.a(errors.o): In function `PyErr_SetFromErrnoWithFilename':
/home/thomas/python/python/dist/src/Python/errors.c:260: undefined reference to `PyErr_CheckSignals'
../libpython2.1.a(pythonrun.o): In function `Py_Finalize':
/home/thomas/python/python/dist/src/Python/pythonrun.c:193: undefined reference to `PyOS_FiniInterrupts'
../libpython2.1.a(pythonrun.o): In function `initsigs':
/home/thomas/python/python/dist/src/Python/pythonrun.c:1161: undefined reference to `PyOS_InitInterrupts'
../libpython2.1.a(traceback.o): In function `tb_printinternal':
/home/thomas/python/python/dist/src/Python/traceback.c:213: undefined reference to `PyErr_CheckSignals'
../libpython2.1.a(fileobject.o): In function `get_line':
/home/thomas/python/python/dist/src/Objects/fileobject.c:883: undefined reference to `PyErr_CheckSignals'
../libpython2.1.a(longobject.o): In function `long_format':
/home/thomas/python/python/dist/src/Objects/longobject.c:644: undefined reference to `PyErr_CheckSignals'
../libpython2.1.a(longobject.o): In function `x_divrem':
/home/thomas/python/python/dist/src/Objects/longobject.c:855: undefined reference to `PyErr_CheckSignals'
../libpython2.1.a(longobject.o): In function `long_mul':
/home/thomas/python/python/dist/src/Objects/longobject.c:1193: undefined reference to `PyErr_CheckSignals'
../libpython2.1.a(object.o):/home/thomas/python/python/dist/src/Objects/object.c:174: more undefined references to `PyErr_CheckSignals' follow
../libpython2.1.a(posixmodule.o): In function `posix_fork':
/home/thomas/python/python/dist/src/Modules/./posixmodule.c:1666: undefined reference to `PyOS_AfterFork'
../libpython2.1.a(posixmodule.o): In function `posix_forkpty':
/home/thomas/python/python/dist/src/Modules/./posixmodule.c:1733: undefined reference to `PyOS_AfterFork'
collect2: ld returned 1 exit status
make[1]: *** [link] Error 1
make[1]: Leaving directory `/home/thomas/python/python/dist/src/Modules'
make: *** [python] Error 2

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!