pygrub''s setup.py relies on distutils.UnixCCompiler.has_function(),
which does not exist with python2.2, causing the following build
error:
make[2]: Entering directory `/home/muli/xen/x86.hg/tools/pygrub''
CFLAGS=" -m32 -march=i686" python setup.py build
Traceback (most recent call last):
File "setup.py", line 15, in ?
if cc.has_function("ext2fs_open2"):
AttributeError: UnixCCompiler instance has no attribute
''has_function''
The following patch gets it to build, but is pretty ugly. A proper fix
would be to do the check for ext2fs_open2() in a way that is backward
compatible with python2.2.
Signed-Off-By: Muli Ben-Yehuda <mulix@mulix.org>
Exporting patch:
# HG changeset patch
# User Muli Ben-Yehuda <mulix@mulix.org>
# Node ID 174450b627fd5aadc686d7737e23eb1a6a8a4175
# Parent 7c951e3eb5ab4ab0a6de33a8f831c828d16b1ad4
get pygrub to build with python2.2
diff -r 7c951e3eb5ab4ab0a6de33a8f831c828d16b1ad4 -r
174450b627fd5aadc686d7737e23eb1a6a8a4175 tools/pygrub/setup.py
--- a/tools/pygrub/setup.py Wed Oct 19 10:53:00 2005
+++ b/tools/pygrub/setup.py Wed Oct 19 14:59:13 2005
@@ -12,11 +12,14 @@
ext2defines = []
cc = new_compiler()
cc.add_library("ext2fs")
- if cc.has_function("ext2fs_open2"):
- ext2defines.append( ("HAVE_EXT2FS_OPEN2", None) )
- else:
- sys.stderr.write("WARNING: older version of e2fsprogs installed,
not building full\n")
- sys.stderr.write(" disk support for ext2.\n")
+ try:
+ if cc.has_function("ext2fs_open2"):
+ ext2defines.append( ("HAVE_EXT2FS_OPEN2", None) )
+ else:
+ sys.stderr.write("WARNING: older version of e2fsprogs
installed, not building full\n")
+ sys.stderr.write(" disk support for ext2.\n")
+ except AttributeError:
+ pass
ext2 = Extension("grub.fsys.ext2._pyext2",
extra_compile_args = extra_compile_args,
--
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Hi, On Wed, Oct 19, 2005 at 05:03:50PM +0200, Muli Ben-Yehuda wrote:> pygrub''s setup.py relies on distutils.UnixCCompiler.has_function(), > which does not exist with python2.2, causing the following build > error:[...]> The following patch gets it to build, but is pretty ugly. A proper fix > would be to do the check for ext2fs_open2() in a way that is backward > compatible with python2.2.Why not just disable building pygrub if your python is that ancient? -- Kurt Garloff <kurt@garloff.de> [Koeln, DE] Physics:Plasma modeling <garloff@plasimo.phys.tue.nl> [TU Eindhoven, NL] Linux: SUSE Labs (Director) <garloff@suse.de> [Novell Inc] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, Oct 19, 2005 at 06:51:21PM +0200, Kurt Garloff wrote:> Hi, > > On Wed, Oct 19, 2005 at 05:03:50PM +0200, Muli Ben-Yehuda wrote: > > pygrub''s setup.py relies on distutils.UnixCCompiler.has_function(), > > which does not exist with python2.2, causing the following build > > error: > [...] > > The following patch gets it to build, but is pretty ugly. A proper fix > > would be to do the check for ext2fs_open2() in a way that is backward > > compatible with python2.2. > > Why not just disable building pygrub if your python is that ancient?If this is the only thing required for it to work with 2.2, it would be a shame not to support it. If it''s entirely dependant on 2.4, disabling it is fine. FWIW, the top-level README gives python2.2 as a prerequisite and everything else appears to build fine with it. Cheers, Muli -- Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, 2005-10-19 at 17:03 +0200, Muli Ben-Yehuda wrote:> pygrub''s setup.py relies on distutils.UnixCCompiler.has_function(), > which does not exist with python2.2, causing the following build > error:*sigh* And there doesn''t seem to be a good way to do the functionality with older distutils. I guess if you''re running that old of a python, it''s probably fair to think that the version of e2fsprogs is old as well. Something like the following is a little bit cleaner, though. Signed-off-by: Jeremy Katz <katzj@redhat.com> Jeremy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, Oct 20, 2005 at 11:48:22AM -0400, Jeremy Katz wrote:> *sigh* And there doesn''t seem to be a good way to do the functionality > with older distutils. I guess if you''re running that old of a python, > it''s probably fair to think that the version of e2fsprogs is old as > well. Something like the following is a little bit cleaner, though.Yup, I was looking for something like hasattr() but my python-fu was weak. Thanks! Cheers, Muli -- Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel