Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 219961

Summary: "setup.py install" doesn't work without pyconfig-32.h for most cases
Product: [Fedora] Fedora Reporter: Mamoru TASAKA <mtasaka>
Component: pythonAssignee: Jeremy Katz <katzj>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: katzj
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-19 18:52:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 219932    

Description Mamoru TASAKA 2006-12-17 20:57:43 UTC
Description of problem:

Some python related packages use distutils modules
in setup.py like:
------------------------------------
from distutils.core import setup

setup(......)
-------------------------------------

With python 2.5, this no longer works without pyconfig-32.h
(on i386) on install stage because with python 2.5 
distutils/sysconfig.py checks the existence of pyconfig-32.h
---------------------------------------
--- ./usr/lib/python2.4/distutils/sysconfig.py  2006-10-02 07:00:44.000000000 +0900
+++ /usr/lib/python2.5/distutils/sysconfig.py   2006-12-16 01:08:37.000000000 +0900
<snip>
@@ -357,17 +351,28 @@
 
         raise DistutilsPlatformError(my_msg)
 
+    # load the installed pyconfig.h:
+    try:
+        filename = get_config_h_filename()
+        parse_config_h(file(filename), g)
+    except IOError, msg:
+        my_msg = "invalid Python installation: unable to open %s" % filename
+        if hasattr(msg, "strerror"):
+            my_msg = my_msg + " (%s)" % msg.strerror
+
+        raise DistutilsPlatformError(my_msg)
+
     # On MacOSX we need to check the setting of the environment variable
     # MACOSX_DEPLOYMENT_TARGET: configure bases some choices on it so
     # it needs to be compatible.
     # If it isn't set we set it to the configure-time value
<snip>
---------------------------------------

Version-Release number of selected component (if applicable):
python-2.5-6.fc7

How reproducible:
100%

Steps to Reproduce:
1. Try mockbuild of
http://www.ioa.s.u-tokyo.ac.jp/~mtasaka/dist/extras/development/SRPMS/driconf-0.9.1-2.tmp1.src.rpm
  
Actual results:
On FC-devel:
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.48489
+ umask 022
+ cd /builddir/build/BUILD
+ cd driconf-0.9.1
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /var/tmp/driconf-0.9.1-2.tmp1.fc7-root-mockbuild
+ /usr/bin/python setup.py install -O1 --skip-build --root
/var/tmp/driconf-0.9.1-2.fc7.tmp1-root-mockbuild --prefix=/usr
running install
error: invalid Python installation: unable to open
/usr/include/python2.5/pyconfig-32.h (No such file or directory)
error: Bad exit status from /var/tmp/rpm-tmp.48489 (%install)

Expected results:
This should succeed as FC-6.
I think pyconfig-32.h should be moved from -devel to
main package because currently the packaging on distutils module
is broken anyway.

Comment 1 Jeremy Katz 2006-12-19 18:52:04 UTC
Realistically, you should have been depending on python-devel to build already;
the fact that it previously "worked" is a side effect more than anything.  

I'd just move all of distutils to python-devel (or its own package) but there
are occasionally valid uses of distutils at runtime which don't require
python-devel to be present