diff --git a/doc/release-notes/rl-2611.section.md b/doc/release-notes/rl-2611.section.md index d7206ba99e2a..79a5a1c865de 100644 --- a/doc/release-notes/rl-2611.section.md +++ b/doc/release-notes/rl-2611.section.md @@ -25,6 +25,8 @@ - `uhttpmock` providing 0.0 ABI was removed. `uhttpmock_1_0` providing 1.0 ABI was renamed to `uhttpmock` and `uhttpmock_1_0` was kept as an alias. +- `nix-serve-ng` (and `haskellPackages.nix-serve-ng`) is now built against Lix instead of CppNix, following upstream which has switched to Lix as its supported Nix implementation. + - Linux kernel configuration has been moved out of the `linux-kernel` field of the platform structure into the kernel builders: - `linux-kernel.name` has been removed. - `linux-kernel.target` is available as the `target` parameter and passthru attribute on the kernel builders. 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/by-name/ni/nickel/package.nix b/pkgs/by-name/ni/nickel/package.nix index becfec74d3fd..e0f52def68a3 100644 --- a/pkgs/by-name/ni/nickel/package.nix +++ b/pkgs/by-name/ni/nickel/package.nix @@ -41,7 +41,7 @@ rustPlatform.buildRustPackage (finalAttrs: { ]; buildInputs = lib.optionals enableNixImport [ - nixVersions.nix_2_28 + nixVersions.nix_2_31 boost ]; @@ -70,6 +70,12 @@ rustPlatform.buildRustPackage (finalAttrs: { "--exclude=py-nickel" ]; + checkFlags = lib.optionals enableNixImport [ + # libnixmain from Nix >= 2.31 tries to create /nix/var/nix/profiles on + # initialisation, which is rejected by the build sandbox. + "--skip=stdin_format::evaluates_nix_from_stdin" + ]; + postInstall = '' mkdir -p $nls/bin mv $out/bin/nls $nls/bin/nls diff --git a/pkgs/by-name/ni/nix-inspect/package.nix b/pkgs/by-name/ni/nix-inspect/package.nix index 838cdda8bec7..f1563fca7d59 100644 --- a/pkgs/by-name/ni/nix-inspect/package.nix +++ b/pkgs/by-name/ni/nix-inspect/package.nix @@ -12,7 +12,7 @@ fetchpatch2, }: let - nixComponents = nixVersions.nixComponents_2_30; + nixComponents = nixVersions.nixComponents_2_31; src = fetchFromGitHub { owner = "bluskript"; repo = "nix-inspect"; diff --git a/pkgs/by-name/ni/nix-plugins/package.nix b/pkgs/by-name/ni/nix-plugins/package.nix index c889a9cbd29b..adf934991061 100644 --- a/pkgs/by-name/ni/nix-plugins/package.nix +++ b/pkgs/by-name/ni/nix-plugins/package.nix @@ -3,7 +3,7 @@ stdenv, fetchFromGitHub, nixVersions, - nixComponents ? nixVersions.nixComponents_2_30, + nixComponents ? nixVersions.nixComponents_2_31, cmake, pkg-config, boost, diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 601a7048781a..a7a440c32513 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -529,7 +529,9 @@ builtins.intersectAttrs super { # Add necessary reference to gtk3 package gi-dbusmenugtk3 = addPkgconfigDepend pkgs.gtk3 super.gi-dbusmenugtk3; - nix-serve-ng = lib.pipe (super.nix-serve-ng.override { nix = pkgs.nixVersions.nix_2_28; }) [ + # Upstream has switched to Lix as its supported Nix implementation. + nix-serve-ng = lib.pipe (super.nix-serve-ng.override { nix = pkgs.lix; }) [ + (enableCabalFlag "lix") # nix-serve-ng isn't regularly released to Hackage (overrideSrc { src = pkgs.fetchFromGitHub { 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..8dfbd7f46bd2 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 = @@ -166,46 +150,11 @@ let test = "shebang.sh"; } ]; - - # Lowdown 3.0 compatibility patch for nix 2.28 and 2.30, which have a - # different markdown.cc layout (no LOWDOWN_TERM_NORELLINK branch) and - # never received an upstream backport. - lowdown30PatchOld = ./patches/lowdown-3.0-compat-2.28-2.30.patch; in 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"; - inherit teams; - otherSplices = generateSplicesForNixComponents "nixComponents_2_30"; - src = removeFunctionalTests commonDisabledTests (fetchFromGitHub { - owner = "NixOS"; - repo = "nix"; - tag = version; - hash = "sha256-tGiV71RxtCNcUNX86ZwmOIghG4pLwm5nlRKd89er7Gk="; - }); - }).appendPatches - [ lowdown30PatchOld ]; - - nix_2_30 = addTests "nix_2_30" self.nixComponents_2_30.nix-everything; - nixComponents_2_31 = (nixDependencies.callPackage ./modular/packages.nix rec { version = "2.31.5"; @@ -275,13 +224,16 @@ lib.makeExtensible ( // { nixComponents_2_27 = throw "nixComponents_2_27 has been removed. use nixComponents_2_31."; nixComponents_2_29 = throw "nixComponents_2_29 has been removed. use nixComponents_2_31."; + nixComponents_2_30 = throw "nixComponents_2_30 has been removed. use nixComponents_2_31."; nixComponents_2_32 = throw "nixComponents_2_32 has been removed. use nixComponents_2_34."; nixComponents_2_33 = throw "nixComponents_2_33 has been removed. use nixComponents_2_34."; nix_2_24 = throw "nix_2_24 has been removed. use nix_2_31."; 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_30 = throw "nix_2_30 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/tools/package-management/nix/patches/lowdown-3.0-compat-2.28-2.30.patch b/pkgs/tools/package-management/nix/patches/lowdown-3.0-compat-2.28-2.30.patch deleted file mode 100644 index dd527f7f1cd6..000000000000 --- a/pkgs/tools/package-management/nix/patches/lowdown-3.0-compat-2.28-2.30.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/src/libcmd/markdown.cc -+++ b/src/libcmd/markdown.cc -@@ -37,7 +37,13 @@ - .vmargin = 0, - # endif - .feat = LOWDOWN_COMMONMARK | LOWDOWN_FENCED | LOWDOWN_DEFLIST | LOWDOWN_TABLES, -- .oflags = LOWDOWN_TERM_NOLINK, -+ .oflags = -+# if HAVE_LOWDOWN_3 -+ LOWDOWN_NOLINK -+# else -+ LOWDOWN_TERM_NOLINK -+# endif -+ , - }; - - auto doc = lowdown_doc_new(&opts); ---- a/src/libcmd/meson.build -+++ b/src/libcmd/meson.build -@@ -36,6 +36,7 @@ - configdata.set('HAVE_LOWDOWN', lowdown.found().to_int()) - # The API changed slightly around terminal initialization. - configdata.set('HAVE_LOWDOWN_1_4', lowdown.version().version_compare('>= 1.4.0').to_int()) -+configdata.set('HAVE_LOWDOWN_3', lowdown.version().version_compare('>= 3.0.0').to_int()) - - readline_flavor = get_option('readline-flavor') - if readline_flavor == 'editline' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5be68bdc26a1..230cf302f47d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10810,12 +10810,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;