From 110f136dc26902b4d985179117d5761c14280080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 16 Feb 2017 23:10:42 +0100 Subject: [PATCH 1/3] python*: upstream patches to fix with glibc-2.25 https://bugs.python.org/issue29157 The 3.6 release already contains the fix (from 3.5); the branches in-between are claimed to be unaffected. /cc #22874. --- .../interpreters/python/cpython/2.7/default.nix | 2 ++ .../python/cpython/2.7/glibc-2.25-enosys.patch | 15 +++++++++++++++ .../interpreters/python/cpython/3.5/default.nix | 10 +++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/interpreters/python/cpython/2.7/glibc-2.25-enosys.patch diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 15b21b5bed9b..ccf9296e0bcb 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -66,6 +66,8 @@ let # libuuid, slowing down program startup a lot). ./no-ldconfig.patch + ./glibc-2.25-enosys.patch + ] ++ optionals stdenv.isCygwin [ ./2.5.2-ctypes-util-find_library.patch ./2.5.2-tkinter-x11.patch diff --git a/pkgs/development/interpreters/python/cpython/2.7/glibc-2.25-enosys.patch b/pkgs/development/interpreters/python/cpython/2.7/glibc-2.25-enosys.patch new file mode 100644 index 000000000000..31da78e35f1c --- /dev/null +++ b/pkgs/development/interpreters/python/cpython/2.7/glibc-2.25-enosys.patch @@ -0,0 +1,15 @@ +https://bugs.python.org/issue29157 +https://github.com/python/cpython/commit/01bdbad3e951 +diff --git a/Python/random.c b/Python/random.c +index 2f83b5d..0b775ec 100644 +--- a/Python/random.c ++++ b/Python/random.c +@@ -98,7 +98,7 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise) + + /* Issue #25003: Don't use getentropy() on Solaris (available since + * Solaris 11.3), it is blocking whereas os.urandom() should not block. */ +-#elif defined(HAVE_GETENTROPY) && !defined(sun) ++#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux) + #define PY_GETENTROPY 1 + + /* Fill buffer with size pseudo-random bytes generated by getentropy(). diff --git a/pkgs/development/interpreters/python/cpython/3.5/default.nix b/pkgs/development/interpreters/python/cpython/3.5/default.nix index 6e0b7614c7cb..215229086b75 100644 --- a/pkgs/development/interpreters/python/cpython/3.5/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.5/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl +{ stdenv, fetchurl, fetchpatch , bzip2 , gdbm , lzma @@ -55,6 +55,14 @@ in stdenv.mkDerivation { substituteInPlace configure --replace '-Wl,-stack_size,1000000' ' ' ''; + patches = [ + (fetchpatch { + name = "glibc-2.25-enosys.patch"; + url = https://github.com/python/cpython/commit/035ba5da3e53e.patch; + sha256 = "1y74ir1w5cq542w27rgzgp70chhq2x047db9911mihpab8p2nj71"; + }) + ]; + postPatch = optionalString (x11Support && (tix != null)) '' substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" ''; From 0ff2179e0ffc5aded75168cb5a13ca1821bdcd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 20 Feb 2017 21:07:35 +0100 Subject: [PATCH 2/3] gnutls: use 3.5 and remove 3.4 3.4 branch detects support for getrandom() call during configure-time, which gets picked up since glibc-2.25, and consequently it will fail with older kernels during rutime. --- pkgs/development/libraries/gnutls/3.4.nix | 10 ---------- pkgs/top-level/all-packages.nix | 6 +----- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 pkgs/development/libraries/gnutls/3.4.nix diff --git a/pkgs/development/libraries/gnutls/3.4.nix b/pkgs/development/libraries/gnutls/3.4.nix deleted file mode 100644 index 0cb2c67c501b..000000000000 --- a/pkgs/development/libraries/gnutls/3.4.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ callPackage, fetchurl, ... } @ args: - -callPackage ./generic.nix (args // rec { - version = "3.4.17"; - - src = fetchurl { - url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-${version}.tar.xz"; - sha256 = "0bhp8cqrmw15yins65cn0zwbcpj1vmymr4wnbm151sfmf2kfhl4v"; - }; -}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f135d5edaf76..0cc77de90d4c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7506,11 +7506,7 @@ with pkgs; gnu-efi = callPackage ../development/libraries/gnu-efi { }; - gnutls = gnutls34; - - gnutls34 = callPackage ../development/libraries/gnutls/3.4.nix { - guileBindings = config.gnutls.guile or false; - }; + gnutls = gnutls35; gnutls35 = callPackage ../development/libraries/gnutls/3.5.nix { guileBindings = config.gnutls.guile or false; From 09d02f72f6dc9201fbfce631cb1155d295350176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 20 Feb 2017 21:16:41 +0100 Subject: [PATCH 3/3] Re-revert "Merge: glibc: 2.24 -> 2.25" This reverts commit 55cc7700e968001c9ac79190fbcf25ed3620680a. I hope most problems have been solved. /cc #22874. --- pkgs/development/libraries/fontconfig/default.nix | 10 ++++++++++ pkgs/development/libraries/glibc/common.nix | 6 +++--- pkgs/development/libraries/glibc/default.nix | 2 +- pkgs/tools/misc/findutils/default.nix | 3 ++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix index 0130ee2a014b..14983b744df9 100644 --- a/pkgs/development/libraries/fontconfig/default.nix +++ b/pkgs/development/libraries/fontconfig/default.nix @@ -28,7 +28,17 @@ stdenv.mkDerivation rec { src = ./config-compat.patch; inherit configVersion; }) + (fetchpatch { + name = "glibc-2.25.diff"; + url = "https://cgit.freedesktop.org/fontconfig/patch/?id=1ab5258f7c"; + sha256 = "0x2a4qx51j3gqcp1kp4lisdzmhrkw1zw0r851d82ksgjlc0vkbaz"; + }) ]; + # additionally required for the glibc-2.25 patch; avoid requiring gperf + postPatch = '' + sed s/CHAR_WIDTH/CHARWIDTH/g -i src/fcobjshash.{h,gperf} + touch src/* + ''; outputs = [ "bin" "dev" "lib" "out" ]; # $out contains all the config diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 32c1b3647372..7128f5606193 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -10,8 +10,8 @@ cross: , preConfigure ? "", ... }@args: let - version = "2.24"; - sha256 = "1ghzp41ryvsqxn4rhrm8r25wc33m2jf8zrcc1pj3jxyk8ad9a0by"; + version = "2.25"; + sha256 = "067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0"; in assert cross != null -> gccCross != null; @@ -138,7 +138,7 @@ stdenv.mkDerivation ({ lib.optionalString (cross != null) "-${cross.config}"; src = fetchurl { - url = "mirror://gnu/glibc/glibc-${version}.tar.gz"; + url = "mirror://gnu/glibc/glibc-${version}.tar.xz"; inherit sha256; }; diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index d6c496819da5..a46f97e0e051 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -81,7 +81,7 @@ in # to bootstrap-tools; on cross-arm this stripping would break objects. if [ -z "$crossConfig" ]; then for i in "$out"/lib/*.a; do - strip -S "$i" + [ "$i" = "$out/lib/libm.a" ] || strip -S "$i" done fi diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix index 086c72bdbb22..8bedbeb12fef 100644 --- a/pkgs/tools/misc/findutils/default.nix +++ b/pkgs/tools/misc/findutils/default.nix @@ -12,7 +12,8 @@ stdenv.mkDerivation rec { buildInputs = [ coreutils ]; # bin/updatedb script needs to call sort - doCheck = !stdenv.isDarwin; + # Since glibc-2.25 the i686 tests hang reliably right after test-sleep. + doCheck = !stdenv.isDarwin && (stdenv.system != "i686-linux"); outputs = [ "out" "info" ];