]> granicus.if.org Git - python/commitdiff
bpo-31904: Don't build the _crypt extension on VxWorks (GH-12833)
authorpxinwr <peixing.xin@windriver.com>
Mon, 15 Apr 2019 09:02:20 +0000 (17:02 +0800)
committerVictor Stinner <vstinner@redhat.com>
Mon, 15 Apr 2019 09:02:20 +0000 (11:02 +0200)
Doc/library/crypt.rst
Misc/NEWS.d/next/Build/2019-04-15-15-01-29.bpo-31904.38fdkg.rst [new file with mode: 0644]
setup.py

index 43d4b5b749e4ed6445bf919714a79d8a7560bb13..d25c626a175854ac5edca4c2f5d30a30bdb60e94 100644 (file)
@@ -30,6 +30,8 @@ the :manpage:`crypt(3)` routine in the running system.  Therefore, any
 extensions available on the current implementation will also  be available on
 this module.
 
+.. availability:: Unix. Not available on VxWorks.
+
 Hashing Methods
 ---------------
 
diff --git a/Misc/NEWS.d/next/Build/2019-04-15-15-01-29.bpo-31904.38fdkg.rst b/Misc/NEWS.d/next/Build/2019-04-15-15-01-29.bpo-31904.38fdkg.rst
new file mode 100644 (file)
index 0000000..c82636e
--- /dev/null
@@ -0,0 +1 @@
+Don't build the ``_crypt`` extension on VxWorks.
index 30caed5b51c1ea78740487e56489e52f8bd11476..9c83914fd907ba7d6e53901753fc5c68b60d3ae9 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -973,17 +973,18 @@ class PyBuildExt(build_ext):
 
     def detect_crypt(self):
         # crypt module.
+        if VXWORKS:
+            # bpo-31904: crypt() function is not provided by VxWorks.
+            # DES_crypt() OpenSSL provides is too weak to implement
+            # the encryption.
+            return
+
         if self.compiler.find_library_file(self.lib_dirs, 'crypt'):
             libs = ['crypt']
         else:
             libs = []
 
-        if not VXWORKS:
-            self.add(Extension('_crypt', ['_cryptmodule.c'],
-                               libraries=libs))
-        elif self.compiler.find_library_file(self.lib_dirs, 'OPENSSL'):
-            libs = ['OPENSSL']
-            self.add(Extension('_crypt', ['_cryptmodule.c'],
+        self.add(Extension('_crypt', ['_cryptmodule.c'],
                                libraries=libs))
 
     def detect_socket(self):