From 10efa49863286d0f5be5c4cee4f45b5300e04cbf Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Sat, 30 Jan 2021 22:30:28 +0100 Subject: [PATCH 1/3] autoconf271: init at 2.71 This is a newer version of autoconf that fixes a bunch of issues that occured since the last autoconf release and they also fixed one issue with clang that I ran into while trying out Nix on aarch64-darwin [1]. [1] http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=de36ccf6637974f4faba3747813d38ee46e77d69 --- pkgs/development/tools/misc/autoconf/2.71.nix | 54 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 ++ 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/tools/misc/autoconf/2.71.nix diff --git a/pkgs/development/tools/misc/autoconf/2.71.nix b/pkgs/development/tools/misc/autoconf/2.71.nix new file mode 100644 index 00000000000..3b70e819c89 --- /dev/null +++ b/pkgs/development/tools/misc/autoconf/2.71.nix @@ -0,0 +1,54 @@ +{ lib, stdenv, fetchurl, m4, perl }: + +# Note: this package is used for bootstrapping fetchurl, and thus +# cannot use fetchpatch! All mutable patches (generated by GitHub or +# cgit) that are needed here should be included directly in Nixpkgs as +# files. + +stdenv.mkDerivation rec { + name = "autoconf-2.71"; + + src = fetchurl { + url = "mirror://gnu/autoconf/${name}.tar.xz"; + sha256 = "197sl23irn6s9pd54rxj5vcp5y8dv65jb9yfqgr2g56cxg7q6k7i"; + }; + + nativeBuildInputs = [ m4 perl ]; + buildInputs = [ m4 ]; + + # Work around a known issue in Cygwin. See + # http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6822 for + # details. + # There are many test failures on `i386-pc-solaris2.11'. + doCheck = ((!stdenv.isCygwin) && (!stdenv.isSunOS)); + + # Don't fixup "#! /bin/sh" in Autoconf, otherwise it will use the + # "fixed" path in generated files! + dontPatchShebangs = true; + + enableParallelBuilding = true; + + # Make the Autotest test suite run in parallel. + preCheck ='' + export TESTSUITEFLAGS="-j$NIX_BUILD_CORES" + ''; + + meta = { + homepage = "https://www.gnu.org/software/autoconf/"; + description = "Part of the GNU Build System"; + + longDescription = '' + GNU Autoconf is an extensible package of M4 macros that produce + shell scripts to automatically configure software source code + packages. These scripts can adapt the packages to many kinds of + UNIX-like systems without manual user intervention. Autoconf + creates a configuration script for a package from a template + file that lists the operating system features that the package + can use, in the form of M4 macro calls. + ''; + + license = lib.licenses.gpl3Plus; + + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c9e45a90aea..e65beb79f42 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -124,6 +124,10 @@ in { deps = [ autoconf269 automake gettext libtool ]; } ../build-support/setup-hooks/autoreconf.sh; + autoreconfHook271 = makeSetupHook + { deps = [ autoconf271 automake gettext libtool ]; } + ../build-support/setup-hooks/autoreconf.sh; + autoPatchelfHook = makeSetupHook { name = "auto-patchelf-hook"; } ../build-support/setup-hooks/auto-patchelf.sh; @@ -11624,6 +11628,7 @@ in autoconf264 = callPackage ../development/tools/misc/autoconf/2.64.nix { }; autoconf269 = callPackage ../development/tools/misc/autoconf/2.69.nix { }; autoconf270 = callPackage ../development/tools/misc/autoconf { }; + autoconf271 = callPackage ../development/tools/misc/autoconf/2.71.nix { }; autocutsel = callPackage ../tools/X11/autocutsel{ }; From b9cc20e0fd79b7b970598d8ec8bc26afb3e94176 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Sat, 30 Jan 2021 22:36:55 +0100 Subject: [PATCH 2/3] autoconf: use autoconf 2.71 by default --- pkgs/development/tools/misc/autoconf/2.71.nix | 54 ------------------- .../tools/misc/autoconf/default.nix | 4 +- pkgs/top-level/all-packages.nix | 9 +--- 3 files changed, 4 insertions(+), 63 deletions(-) delete mode 100644 pkgs/development/tools/misc/autoconf/2.71.nix diff --git a/pkgs/development/tools/misc/autoconf/2.71.nix b/pkgs/development/tools/misc/autoconf/2.71.nix deleted file mode 100644 index 3b70e819c89..00000000000 --- a/pkgs/development/tools/misc/autoconf/2.71.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ lib, stdenv, fetchurl, m4, perl }: - -# Note: this package is used for bootstrapping fetchurl, and thus -# cannot use fetchpatch! All mutable patches (generated by GitHub or -# cgit) that are needed here should be included directly in Nixpkgs as -# files. - -stdenv.mkDerivation rec { - name = "autoconf-2.71"; - - src = fetchurl { - url = "mirror://gnu/autoconf/${name}.tar.xz"; - sha256 = "197sl23irn6s9pd54rxj5vcp5y8dv65jb9yfqgr2g56cxg7q6k7i"; - }; - - nativeBuildInputs = [ m4 perl ]; - buildInputs = [ m4 ]; - - # Work around a known issue in Cygwin. See - # http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6822 for - # details. - # There are many test failures on `i386-pc-solaris2.11'. - doCheck = ((!stdenv.isCygwin) && (!stdenv.isSunOS)); - - # Don't fixup "#! /bin/sh" in Autoconf, otherwise it will use the - # "fixed" path in generated files! - dontPatchShebangs = true; - - enableParallelBuilding = true; - - # Make the Autotest test suite run in parallel. - preCheck ='' - export TESTSUITEFLAGS="-j$NIX_BUILD_CORES" - ''; - - meta = { - homepage = "https://www.gnu.org/software/autoconf/"; - description = "Part of the GNU Build System"; - - longDescription = '' - GNU Autoconf is an extensible package of M4 macros that produce - shell scripts to automatically configure software source code - packages. These scripts can adapt the packages to many kinds of - UNIX-like systems without manual user intervention. Autoconf - creates a configuration script for a package from a template - file that lists the operating system features that the package - can use, in the form of M4 macro calls. - ''; - - license = lib.licenses.gpl3Plus; - - platforms = lib.platforms.all; - }; -} diff --git a/pkgs/development/tools/misc/autoconf/default.nix b/pkgs/development/tools/misc/autoconf/default.nix index ae8fc2d9061..3b70e819c89 100644 --- a/pkgs/development/tools/misc/autoconf/default.nix +++ b/pkgs/development/tools/misc/autoconf/default.nix @@ -6,11 +6,11 @@ # files. stdenv.mkDerivation rec { - name = "autoconf-2.70"; + name = "autoconf-2.71"; src = fetchurl { url = "mirror://gnu/autoconf/${name}.tar.xz"; - sha256 = "1ipckz0wr2mvhj9n3ys54fmf2aksin6bhqvzl304bn6rc1w257ps"; + sha256 = "197sl23irn6s9pd54rxj5vcp5y8dv65jb9yfqgr2g56cxg7q6k7i"; }; nativeBuildInputs = [ m4 perl ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e65beb79f42..c73e817889e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -124,10 +124,6 @@ in { deps = [ autoconf269 automake gettext libtool ]; } ../build-support/setup-hooks/autoreconf.sh; - autoreconfHook271 = makeSetupHook - { deps = [ autoconf271 automake gettext libtool ]; } - ../build-support/setup-hooks/autoreconf.sh; - autoPatchelfHook = makeSetupHook { name = "auto-patchelf-hook"; } ../build-support/setup-hooks/auto-patchelf.sh; @@ -11620,15 +11616,14 @@ in autobuild = callPackage ../development/tools/misc/autobuild { }; - autoconf = autoconf270; + autoconf = autoconf271; autoconf-archive = callPackage ../development/tools/misc/autoconf-archive { }; autoconf213 = callPackage ../development/tools/misc/autoconf/2.13.nix { }; autoconf264 = callPackage ../development/tools/misc/autoconf/2.64.nix { }; autoconf269 = callPackage ../development/tools/misc/autoconf/2.69.nix { }; - autoconf270 = callPackage ../development/tools/misc/autoconf { }; - autoconf271 = callPackage ../development/tools/misc/autoconf/2.71.nix { }; + autoconf271 = callPackage ../development/tools/misc/autoconf { }; autocutsel = callPackage ../tools/X11/autocutsel{ }; From 16d7d40b8a00adfb912154820777acb6de0a8f8f Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Sun, 31 Jan 2021 18:31:13 +0100 Subject: [PATCH 3/3] pythonPackages.psutil: disable tests due to test failures Tests are very flaky and depend on the exact execution environment. It is weird that it has gone well so far but started causing issues across many of my builders. Also started rewording some of the comments in the expression so hopefully the next person looking at this has an easier time to understand it. On systems where swap is available and fully used tests fail like this: > def test_swap_memory(self): > mem = psutil.swap_memory() > self.assertEqual( > mem._fields, ('total', 'used', 'free', 'percent', 'sin', 'sout')) > > assert mem.total >= 0, mem > assert mem.used >= 0, mem > if mem.total > 0: > # likely a system with no swap partition > > assert mem.free > 0, mem > E AssertionError: sswap(total=1048567808, used=1048567808, free=0, percent=100.0, sin=50741248, sout=1316823040) > E assert 0 > 0 > E + where 0 = sswap(total=1048567808, used=1048567808, free=0, percent=100.0, sin=50741248, sout=1316823040).free Upstream bug report: https://github.com/giampaolo/psutil/issues/1911 Systems where /proc/mounts doesn't expose any mount points to build the tests fail like this: > def test_disk_partitions(self): > self.assertIsInstance(nt.device, str) > def check_ntuple(nt): > self.assertIsInstance(nt.mountpoint, str) > self.assertIsInstance(nt.fstype, str) > self.assertIsInstance(nt.opts, str) > self.assertIsInstance(nt.maxfile, (int, type(None))) > self.assertIsInstance(nt.maxpath, (int, type(None))) > self.assertGreater(nt.maxfile, 0) > if nt.maxfile is not None and not GITHUB_ACTIONS: > if nt.maxpath is not None: > self.assertGreater(nt.maxpath, 0) > > # all = False > ls = psutil.disk_partitions(all=False) > > self.assertTrue(ls, msg=ls) > E AssertionError: [] is not true : [] Upstream bug report: https://github.com/giampaolo/psutil/issues/1912 --- .../python-modules/psutil/default.nix | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/psutil/default.nix b/pkgs/development/python-modules/psutil/default.nix index 6760ff168e5..87ead7eee1a 100644 --- a/pkgs/development/python-modules/psutil/default.nix +++ b/pkgs/development/python-modules/psutil/default.nix @@ -15,14 +15,22 @@ buildPythonPackage rec { sha256 = "1immnj532bnnrh1qmk5q3lsw3san8qfk9kxy1cpmy0knmfcwp70c"; }; - # arch doesn't report frequency is the same way - # tests segfaults on darwin https://github.com/giampaolo/psutil/issues/1715 - doCheck = !stdenv.isDarwin && stdenv.isx86_64; + # We have many test failures on various parts of the package: + # - segfaults on darwin: + # https://github.com/giampaolo/psutil/issues/1715 + # - swap (on linux) might cause test failures if it is fully used: + # https://github.com/giampaolo/psutil/issues/1911 + # - some mount paths are required in the build sanbox to make the tests succeed: + # https://github.com/giampaolo/psutil/issues/1912 + doCheck = false; checkInputs = [ pytest ] - ++ lib.optionals isPy27 [ mock ipaddress unittest2 ]; - # out must be referenced as test import paths are relative - # disable tests which don't work in sandbox - # cpu_times is flakey on darwin + ++ lib.optionals isPy27 [ mock ipaddress unittest2 ]; + # In addition to the issues listed above there are some that occure due to + # our sandboxing which we can work around by disabling some tests: + # - cpu_times was flaky on darwin + # - the other disabled tests are likely due to sanboxing (missing specific errors) + + # Note: $out must be referenced as test import paths are relative checkPhase = '' pytest $out/${python.sitePackages}/psutil/tests/test_system.py \ -k 'not user and not disk_io_counters and not sensors_battery and not cpu_times'