Subject: Re: python build error on Sparc Solaris
To: Raymond Meyer <raymond.meyer@rambler.ru>
From: Matt Kolb <muk@msu.edu>
List: pkgsrc-users
Date: 08/16/2006 16:26:39
Raymond Meyer writes: 

> On Thu, 10 Aug 2006 16:16:42 +0100
> Raymond Meyer <raymond.meyer@rambler.ru> wrote: 
> 
>> This happens with both lang/python23 and lang/python24.
>> Does anyone know how to fix this? 
>> 
>> running build
>> running build_ext
>> INFO: Can't locate Tcl/Tk libs and/or headers
>> building 'struct' extension
>> Traceback (most recent call last):
>>   File "./setup.py", line 1105, in ?
>>     main()
>>   File "./setup.py", line 1099, in main
>>     scripts = ['Tools/scripts/pydoc2.4',
>>   File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/core.py",
>> line 149, in setup dist.run_commands() File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/dist.py",
>> line 946, in run_commands self.run_command(cmd) File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/dist.py",
>> line 966, in run_command cmd_obj.run() File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/command/build.py",
>> line 112, in run self.run_command(cmd_name) File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/cmd.py",
>> line 333, in run_command self.distribution.run_command(command) File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/dist.py",
>> line 966, in run_command cmd_obj.run() File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/command/build_ext.py",
>> line 279, in run self.build_extensions() File "./setup.py", line 179, in
>> build_extensions build_ext.build_extensions(self)
>>   File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/command/build_ext.py",
>> line 405, in build_extensions self.build_extension(ext) File "./setup.py",
>> line 184, in build_extension build_ext.build_extension(self, ext)
>>   File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/command/build_ext.py",
>> line 470, in build_extension depends=ext.depends) File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/ccompiler.py",
>> line 699, in compile self._compile(obj, src, ext, cc_args, extra_postargs,
>> pp_opts) File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/unixccompiler.py",
>> line 112, in _compile self.spawn(self.compiler_so + cc_args + [src, '-o',
>> obj] + File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/ccompiler.py",
>> line 1040, in spawn spawn (cmd, dry_run=self.dry_run) File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/spawn.py",
>> line 37, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/spawn.py",
>> line 122, in _spawn_posix log.info(string.join(cmd, ' ')) File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/log.py",
>> line 33, in info self._log(INFO, msg, args) File
>> "/opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3/Lib/distutils/log.py",
>> line 23, in _log print msg % args TypeError: not enough arguments for format
>> string *** Error code 1 
>> 
>> Stop.
>> bmake: stopped in /opt/pkg.obj/lang/python24/work.ultra10/Python-2.4.3
>> *** Error code 1
> 
> I just filed a PR for this problem, with a description of a possible fix, see: 
> 
> http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=34217 
> 

We've been happily running pkgsrc'd python on solaris 10 in production for 
quite some time.  I did have to write a local patch to get it to work 
properly though. 

Here it is: 

 --- Include/pyport.h.orig       Tue Apr  4 15:58:33 2006
+++ Include/pyport.h    Tue Apr  4 16:16:22 2006
@@ -250,9 +250,7 @@
 * a platform where HUGE_VAL is defined incorrectly, fiddle your Python
 * config to #define Py_HUGE_VAL to something that works on your platform.
 */
 -#ifndef Py_HUGE_VAL
 -#define Py_HUGE_VAL HUGE_VAL
 -#endif
+#define Py_HUGE_VAL DBL_MAX 

/* Py_OVERFLOWED(X)
 * Return 1 iff a libm function overflowed.  Set errno to 0 before calling