diff --git a/lib/tests/release.nix b/lib/tests/release.nix index 54d62f87b3d5..280c88cee66b 100644 --- a/lib/tests/release.nix +++ b/lib/tests/release.nix @@ -9,7 +9,6 @@ pkgsBB ? pkgs.pkgsBuildBuild, nix ? pkgs-nixVersions.stable, nixVersions ? [ - pkgs-nixVersions.nix_2_28 nix pkgs-nixVersions.latest ], diff --git a/pkgs/tools/package-management/nix/common-meson.nix b/pkgs/tools/package-management/nix/common-meson.nix deleted file mode 100644 index 4a5b765a4131..000000000000 --- a/pkgs/tools/package-management/nix/common-meson.nix +++ /dev/null @@ -1,274 +0,0 @@ -{ - lib, - fetchFromGitHub, - version, - suffix ? "", - hash ? null, - src ? fetchFromGitHub { - owner = "NixOS"; - repo = "nix"; - rev = version; - inherit hash; - }, - patches ? [ ], - teams ? [ lib.teams.nix ], - self_attribute_name, -}@args: -assert (hash == null) -> (src != null); -{ - stdenv, - bison, - boehmgc, - boost, - brotli, - busybox-sandbox-shell, - bzip2, - callPackage, - cmake, - curl, - doxygen, - editline, - flex, - git, - gtest, - jq, - lib, - libarchive, - libblake3, - libcpuid, - libgit2, - libsodium, - lowdown, - lowdown-unsandboxed, - toml11, - man, - meson, - ninja, - mdbook, - nlohmann_json, - nixosTests, - openssl, - perl, - python3, - pkg-config, - rapidcheck, - rsync, - sqlite, - util-linuxMinimal, - xz, - enableDocumentation ? stdenv.buildPlatform.canExecute stdenv.hostPlatform, - enableStatic ? stdenv.hostPlatform.isStatic, - withAWS ? lib.meta.availableOn stdenv.hostPlatform aws-c-common, - aws-c-common, - aws-sdk-cpp, - withLibseccomp ? lib.meta.availableOn stdenv.hostPlatform libseccomp, - libseccomp, - - confDir, - stateDir, - storeDir, - - # passthru tests - pkgsi686Linux, - pkgsStatic, - runCommand, - pkgs, -}: - -stdenv.mkDerivation (finalAttrs: { - pname = "nix"; - - version = "${version}${suffix}"; - VERSION_SUFFIX = suffix; - - inherit src patches; - - outputs = [ - "out" - "dev" - ] - ++ lib.optionals enableDocumentation [ - "man" - "doc" - ]; - - hardeningDisable = [ - "shadowstack" - ] - ++ lib.optional stdenv.hostPlatform.isMusl "fortify"; - - nativeCheckInputs = [ - git - man - ]; - - nativeBuildInputs = [ - bison - cmake - flex - jq - meson - ninja - pkg-config - rsync - ] - ++ lib.optionals enableDocumentation [ - (lib.getBin lowdown-unsandboxed) - mdbook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - util-linuxMinimal - ] - ++ lib.optionals enableDocumentation [ - python3 - doxygen - ]; - - buildInputs = [ - boost - brotli - bzip2 - curl - editline - libgit2 - libsodium - lowdown - openssl - sqlite - toml11 - xz - ] - ++ lib.optionals (lib.versionAtLeast version "2.26") [ - libblake3 - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - libcpuid - ] - ++ lib.optionals withLibseccomp [ - libseccomp - ] - ++ lib.optionals withAWS [ - aws-sdk-cpp - ]; - - propagatedBuildInputs = [ - boehmgc - nlohmann_json - libarchive - ]; - - checkInputs = [ - gtest - rapidcheck - ]; - - postPatch = '' - patchShebangs --build tests - ''; - - preConfigure = - # Copy libboost_context so we don't get all of Boost in our closure. - # https://github.com/NixOS/nixpkgs/issues/45462 - lib.optionalString (!enableStatic) '' - mkdir -p $out/lib - cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib - rm -f $out/lib/*.a - ${lib.optionalString stdenv.hostPlatform.isLinux '' - chmod u+w $out/lib/*.so.* - patchelf --set-rpath $out/lib:${lib.getLib stdenv.cc.cc}/lib $out/lib/libboost_thread.so.* - ''} - ''; - - dontUseCmakeConfigure = true; - - mesonFlags = [ - (lib.mesonBool "unit-tests" (stdenv.buildPlatform.canExecute stdenv.hostPlatform)) - (lib.mesonBool "bindings" false) - (lib.mesonOption "libstore:store-dir" storeDir) - (lib.mesonOption "libstore:localstatedir" stateDir) - (lib.mesonOption "libstore:sysconfdir" confDir) - (lib.mesonEnable "libutil:cpuid" stdenv.hostPlatform.isx86_64) - (lib.mesonEnable "libstore:seccomp-sandboxing" withLibseccomp) - (lib.mesonBool "libstore:embedded-sandbox-shell" ( - stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic - )) - (lib.mesonBool "doc-gen" enableDocumentation) - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - (lib.mesonOption "libstore:sandbox-shell" "${busybox-sandbox-shell}/bin/busybox") - # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50 - ] - ++ lib.optionals (stdenv.cc.isGNU && !enableStatic) [ - # TODO: do we still need this? - # "--enable-lto" - ]; - - doCheck = true; - - # socket path becomes too long otherwise - preInstallCheck = - lib.optionalString stdenv.hostPlatform.isDarwin '' - export TMPDIR=$NIX_BUILD_TOP - '' - # See https://github.com/NixOS/nix/issues/5687 - + lib.optionalString (stdenv.hostPlatform.system == "aarch64-linux") '' - echo "exit 0" > tests/functional/flakes/show.sh - '' - + '' - # nixStatic otherwise does not find its man pages in tests. - export MANPATH=$man/share/man:$MANPATH - ''; - - separateDebugInfo = stdenv.hostPlatform.isLinux && !enableStatic; - - passthru = { - inherit aws-sdk-cpp boehmgc; - - # TODO: - perl-bindings = perl.pkgs.toPerlModule ( - callPackage ./nix-perl.nix { - nix = finalAttrs.finalPackage; - } - ); - - tests = import ./tests.nix { - inherit - runCommand - version - src - lib - stdenv - pkgs - pkgsi686Linux - pkgsStatic - nixosTests - self_attribute_name - ; - nix = finalAttrs.finalPackage; - }; - }; - - # point 'nix edit' and ofborg at the file that defines the attribute, - # not this common file. - pos = builtins.unsafeGetAttrPos "version" args; - meta = { - description = "Powerful package manager that makes package management reliable and reproducible"; - longDescription = '' - Nix is a powerful package manager for Linux and other Unix systems that - makes package management reliable and reproducible. It provides atomic - upgrades and rollbacks, side-by-side installation of multiple versions of - a package, multi-user package management and easy setup of build - environments. - ''; - homepage = "https://nixos.org/"; - license = lib.licenses.lgpl21Plus; - inherit teams; - platforms = lib.platforms.unix; - # Gets stuck in functional-tests in cross-trunk jobset and doesn't timeout - # https://hydra.nixos.org/build/298175022 - # probably https://github.com/NixOS/nix/issues/13042 - broken = stdenv.hostPlatform.system == "i686-linux" && stdenv.buildPlatform != stdenv.hostPlatform; - outputsToInstall = [ "out" ] ++ lib.optional enableDocumentation "man"; - mainProgram = "nix"; - }; -}) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 226bc4adaabd..0ff19738b39c 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -10,24 +10,8 @@ pkgsi686Linux, pkgsStatic, nixosTests, - - storeDir ? "/nix/store", - stateDir ? "/nix/var", - confDir ? "/etc", }: let - # Called for Nix == 2.28. Transitional until we always use - # per-component packages. - commonMeson = - args: - nixDependencies.callPackage (import ./common-meson.nix ({ inherit lib fetchFromGitHub; } // args)) { - inherit - storeDir - stateDir - confDir - ; - }; - # Intentionally does not support overrideAttrs etc # Use only for tests that are about the package relation to `pkgs` and/or NixOS. addTestsShallowly = @@ -176,20 +160,6 @@ lib.makeExtensible ( self: ( { - nix_2_28 = commonMeson { - version = "2.28.7"; - src = removeFunctionalTests commonDisabledTests (fetchFromGitHub { - owner = "NixOS"; - repo = "nix"; - rev = "2.28.7"; - hash = "sha256-Fq4+7uYz6bdE1HvPqn+qZcYX1rNilVKT7YAAPLA8170="; - }); - self_attribute_name = "nix_2_28"; - patches = [ - lowdown30PatchOld - ]; - }; - nixComponents_2_30 = (nixDependencies.callPackage ./modular/packages.nix rec { version = "2.30.5"; @@ -281,6 +251,7 @@ lib.makeExtensible ( nix_2_26 = throw "nix_2_26 has been removed. use nix_2_31."; nix_2_27 = throw "nix_2_27 has been removed. use nix_2_31."; nix_2_25 = throw "nix_2_25 has been removed. use nix_2_31."; + nix_2_28 = throw "nix_2_28 has been removed. use nix_2_31."; nix_2_29 = throw "nix_2_29 has been removed. use nix_2_31."; nix_2_32 = throw "nix_2_32 has been removed. use nix_2_34."; nix_2_33 = throw "nix_2_33 has been removed. use nix_2_34."; diff --git a/pkgs/tools/package-management/nix/nix-perl.nix b/pkgs/tools/package-management/nix/nix-perl.nix deleted file mode 100644 index 828255f5453a..000000000000 --- a/pkgs/tools/package-management/nix/nix-perl.nix +++ /dev/null @@ -1,107 +0,0 @@ -{ - stdenv, - lib, - perl, - pkg-config, - curl, - nix, - libsodium, - boost, - autoreconfHook, - autoconf-archive, - xz, - meson, - ninja, - bzip2, - libarchive, -}: - -let - atLeast223 = lib.versionAtLeast nix.version "2.23"; - atLeast224 = lib.versionAtLeast nix.version "2.24"; - atLeast226 = lib.versionAtLeast nix.version "2.26"; - - mkConfigureOption = - { - mesonOption, - autoconfOption, - value, - }: - let - setFlagTo = - if atLeast223 then lib.mesonOption mesonOption else lib.withFeatureAs true autoconfOption; - in - setFlagTo value; -in -stdenv.mkDerivation (finalAttrs: { - pname = "nix-perl"; - inherit (nix) version src; - - postUnpack = "sourceRoot=$sourceRoot/${lib.optionalString atLeast224 "src"}/perl"; - - # TODO: Remove this once the nix build also uses meson - postPatch = lib.optionalString (atLeast224 && lib.versionOlder nix.version "2.27") '' - substituteInPlace lib/Nix/Store.xs \ - --replace-fail 'config-util.hh' 'nix/config.h' \ - --replace-fail 'config-store.hh' 'nix/config.h' - ''; - - buildInputs = [ - boost - bzip2 - curl - libsodium - nix - perl - xz - ] - ++ lib.optional atLeast226 libarchive; - - # Not cross-safe since Nix checks for curl/perl via - # NEED_PROG/find_program, but both seem to be needed at runtime - # as well. - nativeBuildInputs = [ - pkg-config - perl - curl - ] - ++ ( - if atLeast223 then - [ - meson - ninja - ] - else - [ - autoconf-archive - autoreconfHook - ] - ); - - # `perlPackages.Test2Harness` is marked broken for Darwin - doCheck = !stdenv.hostPlatform.isDarwin; - - nativeCheckInputs = [ - perl.pkgs.Test2Harness - ]; - - ${if atLeast223 then "mesonFlags" else "configureFlags"} = [ - (mkConfigureOption { - mesonOption = "dbi_path"; - autoconfOption = "dbi"; - value = "${perl.pkgs.DBI}/${perl.libPrefix}"; - }) - (mkConfigureOption { - mesonOption = "dbd_sqlite_path"; - autoconfOption = "dbd-sqlite"; - value = "${perl.pkgs.DBDSQLite}/${perl.libPrefix}"; - }) - ] - ++ lib.optionals atLeast223 [ - (lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck) - ]; - - preConfigure = "export NIX_STATE_DIR=$TMPDIR"; - - passthru = { inherit perl; }; -}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 89e8ab34a9ae..d73f73085643 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10812,12 +10812,7 @@ with pkgs; callPackage ../tools/package-management/nix/dependencies-scope.nix { } ); - nixVersions = recurseIntoAttrs ( - callPackage ../tools/package-management/nix { - storeDir = config.nix.storeDir or "/nix/store"; - stateDir = config.nix.stateDir or "/nix/var"; - } - ); + nixVersions = recurseIntoAttrs (callPackage ../tools/package-management/nix { }); nix = nixVersions.stable;