Robert Bradshaw wrote:
On Sat, Jan 30, 2010 at 10:16 PM, Dr. David Kirkby <david.kir...@onetel.net> wrote:

Faillure to build the haslib module results from a failure to find the SSL libraries. Would it not be more sensible to check for these in prereq, then
exit if they are not found. It would save someone getting half a build.

This may have been true at one point, but looking at the current Python sources [0,1] it seems that Python provides native implementations of hashlib if OpenSSL is not found, so import hashlib should never fail (#7761 was an artifact that *no* distutils extensions built...).

Looking at the source code, I can understand why you come to this conclusion. I would agree with you.

But the fact is, that it does not build. Someone obviously added the test in Sage, which I admit could be outdated.

-------------------------
# Make sure sufficient crypto support is available in the built python.
# This is critical.
python -c "import hashlib"

if [ $? -eq 0 -a -f "$SAGE_LOCAL/bin/python" ]; then
   echo "hashlib module imported"
   exit 0
else
   echo "hashlib module failed to import"
   exit 1
fi
-----------------------------

When I had this problem on OpenSolaris, William told me to install OpenSSL. Yesterday I rebuilt python, having changed the permissions of the /usr/local/ssl directory to 000. Sure enough, it fails.

I can't fault your logic based on looking at the source code, but in practice I can assure you that the failure to have OpenSSL libraries results in a failure for the hashlib module to build, so results in a failure of the Sage build.

I'm happy to report that as a bug to the Python developers, but it does not solve the more pressing issue in Sage.

A google finds other failing to get haslib installed on linux too.

What might be more of an issue is _ssl not building [2], which may be easier to fix (especially if we don't use any parts of _ssl that gnutls doesn't support).

In which case, perhaps we should test for _ssl too.

I'm not sure why this ticket was closed without resolving that issue. OTOH, I'm doubtful we use _ssl anywhere except for the notebook, as it is all about secure sockets. Gnutls claims to have support for twisted.

Of course I'm just jumping into the issue now, so there is probably a lot of history, and pragmatic background of how stuff actually works, that I'm missing. But can anyone verify that we actually even require OpenSSL (which is the running assumption)?

- Robert

I believe that is true we currently need OpenSSL - at least on Solaris, and I don't see why it should be any different on any other platform. If you have a Linux machine where you have root access and can ensure that there are no SSL libraries to be found, I suspect you will get the same issue.

There is this python bug about hashlib. I'm not suggesting this is the cause of failure, but it might indicate the hashlib stuff in python is poorly implemented.

http://bugs.python.org/issue6281

The ticket starts by saying "The try statement at the end of hashlib.py is some of the worst python code I've had the mispleasure of reading for a long time."


Dave

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to