Python has its own implementations of various hash functions, that can be used as fallbacks when openssl is not available. However, if openssl *is* available at build time, then these fallbacks don't get built.
It would be nice if they would get built even if openssl *was* found at build time:
(2) for "portable" builds: build onto portable or shared storage, and run on multiple machines, even if openssl happens not to be available on some of the machines.
title: hashlib fallback modules should be built even if openssl *is* available at build time
versions: Python 2.7
The official way for building certain modules despite auto-configuration is to edit Modules/Setup, or Modules/Setup.local. This already supports the exact use case, so I'm closing this as "works for me".
resolution: -> works for me
status: open -> closed
> Antoine: why did you reopen it? Leave *at least* an explanation please.
Ah, sorry. I think it's a reasonable enhancement request, and
furthermore the patch simplifies the setup code.
Also, it allows us to test the _md5 (etc.) modules in non-debug mode as
well. Perhaps Gregory can tell us what he thinks.
If it's an official feature that these modules are always built, the patch is insufficient: it then also needs to adjust the build environment for Windows, and the packaging. It potentially also affects packaging for OSX and Linux.
I still think that users with special needs such as (1) and (2) in the original message are better served by editig Modules/Setup, as that also allows e.g. to make the modules truly builtin.
I don't have a problem with always compiling them.
Distro packagers should see that the stand alone versions are not distributed with their package that has a dependency on openssl as they'll just be a waste of space. But that is up to the distro package maintainers.
regarding the attached patch, rather than changing the test at all, I'd leave it as is. The test as is will do what we want on the buildbots (warning us if they failed to compile when in debug mode). I am not concerned about it testing if they compiled in opt mode or not. I also do not think it is worth making them always compile on other platforms that do not use setup.py.
In short: if we do anything, just make the setup.py change to get rid of the conditional compilation.