wok-next annotate python/stuff/patches/13a39142c047.diff @ rev 20126

get-vivaldi -> vivaldi. Update ldd runtime dependencies.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Oct 31 12:04:50 2017 +0200 (2017-10-31)
parents
children
rev   line source
al@19764 1 Error in the end of the `make install`:
al@19764 2
al@19764 3 ```
al@19764 4 Traceback (most recent call last):
al@19764 5 File "${src}/Lib/runpy.py", line 163, in _run_module_as_main
al@19764 6 mod_name, _Error)
al@19764 7 File "${src}/Lib/runpy.py", line 111, in _get_module_details
al@19764 8 __import__(mod_name) # Do not catch exceptions initializing package
al@19764 9 File "${src}/Lib/ensurepip/__init__.py", line 9, in <module>
al@19764 10 import tempfile
al@19764 11 File "${src}/Lib/tempfile.py", line 35, in <module>
al@19764 12 from random import Random as _Random
al@19764 13 File "${src}/Lib/random.py", line 885, in <module>
al@19764 14 _inst = Random()
al@19764 15 File "${src}/Lib/random.py", line 97, in __init__
al@19764 16 self.seed(x)
al@19764 17 File "${src}/Lib/random.py", line 113, in seed
al@19764 18 a = long(_hexlify(_urandom(2500)), 16)
al@19764 19 OSError: [Errno 38] Function not implemented
al@19764 20 make: *** [Makefile:927: install] Error 1
al@19764 21 ```
al@19764 22
al@19764 23 While the normal installing process is following:
al@19764 24
al@19764 25 ```
al@19764 26 Collecting setuptools
al@19764 27 Collecting pip
al@19764 28 Installing collected packages: setuptools, pip
al@19764 29 Successfully installed pip-9.0.1 setuptools-28.8.0
al@19764 30 ```
al@19764 31
al@19764 32 Discussion found here: http://bugs.python.org/issue29188
al@19764 33 Patch found in the discussion above:
al@19764 34 https://hg.python.org/cpython/rev/13a39142c047
al@19764 35
al@19764 36 Chunk #1 is removed from the original patch because it rejected.
al@19764 37
al@19764 38
al@19764 39 # HG changeset patch
al@19764 40 # User Victor Stinner <victor.stinner@gmail.com>
al@19764 41 # Date 1483956641 -3600
al@19764 42 # Node ID 13a39142c0473ecb64fcd4b12a915025df6e4310
al@19764 43 # Parent cb4f73be9486d47f1dc4285998d1532d8857c59e
al@19764 44 Don't use getentropy() on Linux
al@19764 45
al@19764 46 Issue #29188: Support glibc 2.24 on Linux: don't use getentropy() function but
al@19764 47 read from /dev/urandom to get random bytes, for example in os.urandom(). On
al@19764 48 Linux, getentropy() is implemented which getrandom() is blocking mode, whereas
al@19764 49 os.urandom() should not block.
al@19764 50
al@19764 51 diff --git a/Python/random.c b/Python/random.c
al@19764 52 --- a/Python/random.c
al@19764 53 +++ b/Python/random.c
al@19764 54 @@ -97,8 +97,15 @@ win32_urandom(unsigned char *buffer, Py_
al@19764 55 }
al@19764 56
al@19764 57 /* Issue #25003: Don't use getentropy() on Solaris (available since
al@19764 58 - * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
al@19764 59 -#elif defined(HAVE_GETENTROPY) && !defined(sun)
al@19764 60 + Solaris 11.3), it is blocking whereas os.urandom() should not block.
al@19764 61 +
al@19764 62 + Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
al@19764 63 + implements it with the getrandom() syscall which can fail with ENOSYS,
al@19764 64 + and this error is not supported in py_getentropy() and getrandom() is called
al@19764 65 + with flags=0 which blocks until system urandom is initialized, which is not
al@19764 66 + the desired behaviour to seed the Python hash secret nor for os.urandom():
al@19764 67 + see the PEP 524 which was only implemented in Python 3.6. */
al@19764 68 +#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
al@19764 69 #define PY_GETENTROPY 1
al@19764 70
al@19764 71 /* Fill buffer with size pseudo-random bytes generated by getentropy().
al@19764 72