From 0e3ffe430e52f2f24ceee6d01173e99c9f75bfd7 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 8 Aug 2018 21:18:19 +0000 Subject: cryptsetup: fix tests --- pkgs/os-specific/linux/cryptsetup/default.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkgs/os-specific/linux') diff --git a/pkgs/os-specific/linux/cryptsetup/default.nix b/pkgs/os-specific/linux/cryptsetup/default.nix index fc13d97429c..5211fd2a61b 100644 --- a/pkgs/os-specific/linux/cryptsetup/default.nix +++ b/pkgs/os-specific/linux/cryptsetup/default.nix @@ -20,6 +20,10 @@ stdenv.mkDerivation rec { }) ]; + postPatch = '' + patchShebangs tests + ''; + NIX_LDFLAGS = "-lgcc_s"; configureFlags = [ -- cgit 1.4.1 From 556da201b82dfed2b4db8420a4d39786230cdeb6 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 8 Aug 2018 21:20:15 +0000 Subject: libaio: fix tests --- pkgs/os-specific/linux/libaio/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkgs/os-specific/linux') diff --git a/pkgs/os-specific/linux/libaio/default.nix b/pkgs/os-specific/linux/libaio/default.nix index e2be136adee..949c8135df7 100644 --- a/pkgs/os-specific/linux/libaio/default.nix +++ b/pkgs/os-specific/linux/libaio/default.nix @@ -14,10 +14,20 @@ stdenv.mkDerivation rec { sha256 = "1kqpiswjn549s3w3m89bw5qkl7bw5pvq6gp5cdzd926ymlgivj5c"; }) ]; + postPatch = '' + patchShebangs harness + + # Makefile is too optimistic, gcc is too smart + substituteInPlace harness/Makefile \ + --replace "-Werror" "" + ''; + makeFlags = "prefix=$(out)"; hardeningDisable = stdenv.lib.optional (stdenv.isi686) "stackprotector"; + checkTarget = "partcheck"; # "check" needs root + meta = { description = "Library for asynchronous I/O in Linux"; homepage = http://lse.sourceforge.net/io/aio.html; -- cgit 1.4.1 From 662756bb6d992c8678cf4b430e61e40a2fd5d316 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 8 Aug 2018 21:19:37 +0000 Subject: fuse: make tests run, but disable --- pkgs/os-specific/linux/fuse/common.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkgs/os-specific/linux') diff --git a/pkgs/os-specific/linux/fuse/common.nix b/pkgs/os-specific/linux/fuse/common.nix index 7cc58c19c07..1e4f3d8d583 100644 --- a/pkgs/os-specific/linux/fuse/common.nix +++ b/pkgs/os-specific/linux/fuse/common.nix @@ -4,6 +4,7 @@ , fusePackages, utillinux, gettext , meson, ninja, pkgconfig , autoreconfHook +, python3Packages, which }: let @@ -58,6 +59,14 @@ in stdenv.mkDerivation rec { ./makeconf.sh ''); + checkInputs = [ which ] ++ (with python3Packages; [ python pytest ]); + + checkPhase = '' + python3 -m pytest test/ + ''; + + doCheck = false; # v2: no tests, v3: all tests get skipped in a sandbox + postFixup = "cd $out\n" + (if isFuse3 then '' install -D -m444 etc/fuse.conf $common/etc/fuse.conf install -D -m444 etc/udev/rules.d/99-fuse3.rules $common/etc/udev/rules.d/99-fuse.rules -- cgit 1.4.1 From 6c931a13c5f9c2d2be31c1e5053e037b4e6b3cbd Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 8 Aug 2018 21:27:16 +0000 Subject: numactl: make tests run, but disable. Ugh! --- pkgs/os-specific/linux/numactl/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkgs/os-specific/linux') diff --git a/pkgs/os-specific/linux/numactl/default.nix b/pkgs/os-specific/linux/numactl/default.nix index 9928897ae4d..4506945ffba 100644 --- a/pkgs/os-specific/linux/numactl/default.nix +++ b/pkgs/os-specific/linux/numactl/default.nix @@ -23,6 +23,15 @@ stdenv.mkDerivation rec { sha256 = "080b0sygmg7104qbbh1amh3b322yyiajwi2d3d0vayffgva0720v"; }); + postPatch = '' + patchShebangs test + ''; + + # You probably shouldn't ever run these! They will reconfigure Linux + # NUMA settings, which on my build machine makes the rest of package + # building ~5% slower until reboot. Ugh! + doCheck = false; # never ever! + meta = with stdenv.lib; { description = "Library and tools for non-uniform memory access (NUMA) machines"; homepage = http://oss.sgi.com/projects/libnuma/; -- cgit 1.4.1 From c74e59511d71ff220b5473a34ce31c5e58d3d2e7 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 8 Aug 2018 21:27:57 +0000 Subject: syslinux: make tests run, but disable --- pkgs/os-specific/linux/syslinux/default.nix | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'pkgs/os-specific/linux') diff --git a/pkgs/os-specific/linux/syslinux/default.nix b/pkgs/os-specific/linux/syslinux/default.nix index 8a87d3fce58..f02f1baafe6 100644 --- a/pkgs/os-specific/linux/syslinux/default.nix +++ b/pkgs/os-specific/linux/syslinux/default.nix @@ -21,19 +21,23 @@ stdenv.mkDerivation rec { }) ]; - nativeBuildInputs = [ nasm perl python ]; - buildInputs = [ libuuid makeWrapper ]; - - enableParallelBuilding = false; # Fails very rarely with 'No rule to make target: ...' - hardeningDisable = [ "pic" "stackprotector" "fortify" ]; - - preBuild = '' + postPatch = '' substituteInPlace Makefile --replace /bin/pwd $(type -P pwd) substituteInPlace gpxe/src/Makefile.housekeeping --replace /bin/echo $(type -P echo) substituteInPlace utils/ppmtolss16 --replace /usr/bin/perl $(type -P perl) substituteInPlace gpxe/src/Makefile --replace /usr/bin/perl $(type -P perl) + + # fix tests + substituteInPlace tests/unittest/include/unittest/unittest.h \ + --replace /usr/include/ "" ''; + nativeBuildInputs = [ nasm perl python ]; + buildInputs = [ libuuid makeWrapper ]; + + enableParallelBuilding = false; # Fails very rarely with 'No rule to make target: ...' + hardeningDisable = [ "pic" "stackprotector" "fortify" ]; + stripDebugList = "bin sbin share/syslinux/com32"; makeFlags = [ @@ -47,6 +51,8 @@ stdenv.mkDerivation rec { "bios" ]; + doCheck = false; # fails. some fail in a sandbox, others require qemu + postInstall = '' wrapProgram $out/bin/syslinux \ --prefix PATH : "${mtools}/bin" -- cgit 1.4.1 From 7cd8fdbf631e58332af64fe96910056fe5314dbc Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 8 Aug 2018 21:28:37 +0000 Subject: utillinux: make tests run, but disable --- pkgs/os-specific/linux/util-linux/default.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkgs/os-specific/linux') diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index 1a7232afedb..f8a5f201bf9 100644 --- a/pkgs/os-specific/linux/util-linux/default.nix +++ b/pkgs/os-specific/linux/util-linux/default.nix @@ -22,6 +22,8 @@ in stdenv.mkDerivation rec { outputs = [ "bin" "dev" "out" "man" ]; postPatch = '' + patchShebangs tests/run.sh + substituteInPlace include/pathnames.h \ --replace "/bin/login" "${shadow}/bin/login" substituteInPlace sys-utils/eject.c \ @@ -54,6 +56,8 @@ in stdenv.mkDerivation rec { [ zlib pam ] ++ lib.filter (p: p != null) [ ncurses systemd perl ]; + doCheck = false; # "For development purpose only. Don't execute on production system!" + postInstall = '' rm "$bin/bin/su" # su should be supplied by the su package (shadow) '' + lib.optionalString minimal '' -- cgit 1.4.1 From 8e1a0b59fda94aecb2782ff8a733f202c3f119bb Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 1 Aug 2018 21:58:57 +0000 Subject: pmount: disable tests --- pkgs/os-specific/linux/pmount/default.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkgs/os-specific/linux') diff --git a/pkgs/os-specific/linux/pmount/default.nix b/pkgs/os-specific/linux/pmount/default.nix index ea34075210d..f0f706157ed 100644 --- a/pkgs/os-specific/linux/pmount/default.nix +++ b/pkgs/os-specific/linux/pmount/default.nix @@ -34,6 +34,8 @@ stdenv.mkDerivation rec { substituteInPlace ./src/Makefile --replace '-o root -g root -m 4755 ' '-m 755 ' ''; + doCheck = false; # fails 1 out of 1 tests with "Error: could not open fstab-type file: No such file or directory" + meta = { homepage = http://pmount.alioth.debian.org/; description = "Mount removable devices as normal user"; -- cgit 1.4.1 From 7d85ade0ccf4fdb0b93fdbd18a07249a360144d4 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 20 Aug 2018 15:18:07 -0400 Subject: treewide: Purge `stdenv.platform` and top-level `platform` Progress towards #27069 --- nixos/modules/installer/netboot/netboot.nix | 4 ++-- .../modules/system/boot/loader/generations-dir/generations-dir.nix | 2 +- nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix | 2 +- nixos/release.nix | 4 ++-- pkgs/build-support/vm/default.nix | 2 +- pkgs/development/compilers/chez/default.nix | 3 ++- pkgs/development/libraries/v8/3.16.14.nix | 2 +- pkgs/os-specific/gnu/default.nix | 2 +- pkgs/os-specific/linux/kernel/hardened-config.nix | 2 +- pkgs/os-specific/linux/rtl8723bs/default.nix | 2 +- pkgs/top-level/all-packages.nix | 6 ++---- pkgs/top-level/stage.nix | 5 +---- 12 files changed, 16 insertions(+), 20 deletions(-) (limited to 'pkgs/os-specific/linux') diff --git a/nixos/modules/installer/netboot/netboot.nix b/nixos/modules/installer/netboot/netboot.nix index a4eda3c52dc..a2c8e26f62c 100644 --- a/nixos/modules/installer/netboot/netboot.nix +++ b/nixos/modules/installer/netboot/netboot.nix @@ -28,7 +28,7 @@ with lib; ++ (if pkgs.stdenv.system == "aarch64-linux" then [] else [ pkgs.grub2 pkgs.syslinux ]); - system.boot.loader.kernelFile = pkgs.stdenv.platform.kernelTarget; + system.boot.loader.kernelFile = pkgs.stdenv.hostPlatform.platform.kernelTarget; fileSystems."/" = { fsType = "tmpfs"; @@ -86,7 +86,7 @@ with lib; system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" '' #!ipxe - kernel ${pkgs.stdenv.platform.kernelTarget} init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} + kernel ${pkgs.stdenv.hostPlatform.platform.kernelTarget} init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} initrd initrd boot ''; diff --git a/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix b/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix index f8a00784034..2d27611946e 100644 --- a/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix +++ b/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix @@ -13,7 +13,7 @@ let }; # Temporary check, for nixos to cope both with nixpkgs stdenv-updates and trunk - platform = pkgs.stdenv.platform; + inherit (pkgs.stdenv.hostPlatform) platform; in diff --git a/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix b/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix index f974d07da9e..9bec24c53f5 100644 --- a/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix +++ b/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix @@ -15,7 +15,7 @@ let inherit configTxt; }; - platform = pkgs.stdenv.platform; + inherit (pkgs.stdenv.hostPlatform) platform; builderUboot = import ./builder_uboot.nix { inherit config; inherit pkgs; inherit configTxt; }; diff --git a/nixos/release.nix b/nixos/release.nix index 1d1f8009f27..b25c684ff47 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -83,7 +83,7 @@ let in tarball // { meta = { - description = "NixOS system tarball for ${system} - ${stdenv.platform.name}"; + description = "NixOS system tarball for ${system} - ${stdenv.hostPlatform.platform.name}"; maintainers = map (x: lib.maintainers.${x}) maintainers; }; inherit config; @@ -106,7 +106,7 @@ let let configEvaled = import lib/eval-config.nix config; build = configEvaled.config.system.build; - kernelTarget = configEvaled.pkgs.stdenv.platform.kernelTarget; + kernelTarget = configEvaled.pkgs.stdenv.hostPlatform.platform.kernelTarget; in pkgs.symlinkJoin { name = "netboot"; diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 221e19ca5ed..67c67c88177 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -1,6 +1,6 @@ { pkgs , kernel ? pkgs.linux -, img ? pkgs.stdenv.platform.kernelTarget +, img ? pkgs.stdenv.hostPlatform.platform.kernelTarget , storeDir ? builtins.storeDir , rootModules ? [ "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "9p" "9pnet_virtio" "crc32c_generic" ] diff --git a/pkgs/development/compilers/chez/default.nix b/pkgs/development/compilers/chez/default.nix index 3ffd024305d..09d68084e77 100644 --- a/pkgs/development/compilers/chez/default.nix +++ b/pkgs/development/compilers/chez/default.nix @@ -61,7 +61,8 @@ stdenv.mkDerivation rec { ** ** Ideally in the future this would be less of a hack and could be ** done by Chez itself. Alternatively, there could just be a big - ** case statement matching to the different stdenv.platform values... + ** case statement matching to the different stdenv.hostPlatform.platform + ** values... */ postInstall = '' m="$(ls ./work/boot)" diff --git a/pkgs/development/libraries/v8/3.16.14.nix b/pkgs/development/libraries/v8/3.16.14.nix index e1a9336e3a5..a7dddd14124 100644 --- a/pkgs/development/libraries/v8/3.16.14.nix +++ b/pkgs/development/libraries/v8/3.16.14.nix @@ -6,7 +6,7 @@ let arch = if stdenv.isAarch32 then (if stdenv.is64bit then "arm64" else "arm") else (if stdenv.is64bit then "x64" else "ia32"); - armHardFloat = stdenv.isAarch32 && (stdenv.platform.gcc.float or null) == "hard"; + armHardFloat = stdenv.isAarch32 && (stdenv.hostPlatform.platform.gcc.float or null) == "hard"; in stdenv.mkDerivation rec { diff --git a/pkgs/os-specific/gnu/default.nix b/pkgs/os-specific/gnu/default.nix index 5dc52c766f1..d5760003525 100644 --- a/pkgs/os-specific/gnu/default.nix +++ b/pkgs/os-specific/gnu/default.nix @@ -3,7 +3,7 @@ args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool , texinfo, glibcCross, hurdPartedCross, libuuid, samba , gccCrossStageStatic, gcc -, pkgsi686Linux, newScope, platform, config +, pkgsi686Linux, newScope, config , targetPlatform, buildPlatform , overrides ? {} , buildPackages, pkgs diff --git a/pkgs/os-specific/linux/kernel/hardened-config.nix b/pkgs/os-specific/linux/kernel/hardened-config.nix index 309b5f6c74e..84d1dd8a378 100644 --- a/pkgs/os-specific/linux/kernel/hardened-config.nix +++ b/pkgs/os-specific/linux/kernel/hardened-config.nix @@ -22,7 +22,7 @@ ${optionalString (versionAtLeast version "4.10") '' BUG_ON_DATA_CORRUPTION y ''} -${optionalString (stdenv.platform.kernelArch == "x86_64") '' +${optionalString (stdenv.hostPlatform.platform.kernelArch == "x86_64") '' DEFAULT_MMAP_MIN_ADDR 65536 # Prevent allocation of first 64K of memory # Reduce attack surface by disabling various emulations diff --git a/pkgs/os-specific/linux/rtl8723bs/default.nix b/pkgs/os-specific/linux/rtl8723bs/default.nix index 0263d17ead0..b1e01f705dc 100644 --- a/pkgs/os-specific/linux/rtl8723bs/default.nix +++ b/pkgs/os-specific/linux/rtl8723bs/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { buildInputs = [ nukeReferences ]; makeFlags = concatStringsSep " " [ - "ARCH=${stdenv.platform.kernelArch}" # Normally not needed, but the Makefile sets ARCH in a broken way. + "ARCH=${stdenv.hostPlatform.platform.kernelArch}" # Normally not needed, but the Makefile sets ARCH in a broken way. "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" # Makefile uses $(uname -r); breaks us. ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 027e4632f38..a7491632fb5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13742,9 +13742,7 @@ with pkgs; nmon = callPackage ../os-specific/linux/nmon { }; # GNU/Hurd core packages. - gnu = recurseIntoAttrs (callPackage ../os-specific/gnu { - inherit platform; - }); + gnu = recurseIntoAttrs (callPackage ../os-specific/gnu { }); hwdata = callPackage ../os-specific/linux/hwdata { }; @@ -13865,7 +13863,7 @@ with pkgs; kernelPatches.cpu-cgroup-v2."4.11" kernelPatches.modinst_arg_list_too_long ] - ++ lib.optionals ((platform.kernelArch or null) == "mips") + ++ lib.optionals ((stdenv.hostPlatform.platform.kernelArch or null) == "mips") [ kernelPatches.mips_fpureg_emu kernelPatches.mips_fpu_sigill kernelPatches.mips_ext3_n32 diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 5b802aea075..06978d1067b 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -82,11 +82,8 @@ let platformCompat = self: super: let inherit (super.stdenv) buildPlatform hostPlatform targetPlatform; in { - stdenv = super.stdenv // { - inherit (super.stdenv.buildPlatform) platform; - }; inherit buildPlatform hostPlatform targetPlatform; - inherit (buildPlatform) system platform; + inherit (buildPlatform) system; }; splice = self: super: import ./splice.nix lib self (buildPackages != null); -- cgit 1.4.1