M2Crypto 0.20.1 won't build on Red Hat Linux

John Nagle nagle at animats.com
Thu Oct 1 13:13:52 EDT 2009


Heikki Toivonen wrote:
> John Nagle wrote:
>> M2Crypto, from
>>
>> http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.20.1.tar.gz
>>
>> won't build on Red Hat Linux / 386.  The error is
>>
>> It's some incompatibility between Red Hat include file packaging and
>> M2Crypto.
> 
> Yup, all Fedora Core-based systems actually.
> 
> 
> I've also added this to the FAQ:
> http://chandlerproject.org/Projects/MeTooCrypto#Code

    OK, did that.  The build is now failing with

-bash-3.1$ ./fedora-setup.sh build
running build
running build_py
creating build
...
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/usr/local/include/python2.5 -I/usr/include -includeall -o 
SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
SWIG/_evp.i:9: Error: Unable to find 'openssl/opensslconf-i686.h'
SWIG/_ec.i:7: Error: Unable to find 'openssl/opensslconf-i686.h'
error: command 'swig' failed with exit status 1
-bash-3.1$


Installed OpenSSL is "OpenSSL 0.9.8a 11 Oct 2005", and it doesn't
have an "openssl/opensslconf-i686.h".  It has an "openssl/opensslconf-i386.h".

M2Crypto documentation says:
0.20.1:
     * OpenSSL 0.9.7 or newer
           o Some optional new features will require OpenSSL 0.9.8 or newer

so that's current.

The problem, of course, is that using "uname -m" is asking the wrong question.
It prints "i686" on CPUs that are 64-bit capable, even when they are running
a 32-bit version of Linux.  This is running on a 64-bit capable server.

The right question is "uname --hardware-platform".  That returns "i386" if
running on something emulating a 386, even it it's 64-bit capable.

With that change, the build runs to completion and and the regression tests
mostly run.  Test failure occurred at:

======================================================================
FAIL: test_cipher_ok (tests.test_ssl.MiscSSLClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/var/www/vhosts/sitetruth.com/private/downloads/M2Crypto/M2Crypto-0.20.1/tests/test_ssl.py", 
line 485, in test_cipher_ok
     assert s.get_cipher().name() == 'AES128-SHA', s.get_cipher().name()
AssertionError: AES256-SHA

----------------------------------------------------------------------
Ran 226 tests in 91.672s

Is 'AES128-SHA' a cypher that Fedora Core doesn't support, or what?


					John Nagle




More information about the Python-list mailing list