From 2b4e18f3d4a7b80af21b640c0970f83b34efceff Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Mon, 22 Apr 2024 10:09:39 +0200 Subject: [PATCH 1/2] nixVersions.unstable: build from master, re-init at 2.22.0.pre20240321_6fd2f42c The idea behind that is to enable users and developers of downstream tools such as home-manager to test Nix master for several reasons: * Nix is currently trying to have a `master` branch that's always releasable[1]. We're still on Nix 2.18 in nixpkgs due to too many notable regressions. Enabling people to test latest master may help on that end. * This uses the most bleeding-edge Nix, but our packaging, so we can identify issues with our packaging early. * From what I've seen, most people are using the packages from nixpkgs anyways instead of the upstream flake, this is far more convenient anyways. My plan is to update this once a week. Right now we rely on the `installCheckPhase` here, but as soon as we have proper regression testing[2], we may want to add `nixUnstable` there as well (however with failures being allowed probably). [1] https://discourse.nixos.org/t/nix-release-schedule-and-roadmap/14204 [2] https://github.com/NixOS/nixpkgs/pull/304332 --- lib/tests/release.nix | 2 +- .../manual/release-notes/rl-2405.section.md | 4 ++++ .../tools/language-servers/nil/default.nix | 2 +- pkgs/tools/package-management/nix/default.nix | 18 ++++++++++++++++-- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/tests/release.nix b/lib/tests/release.nix index 5b2a9df1635c..1447e8817091 100644 --- a/lib/tests/release.nix +++ b/lib/tests/release.nix @@ -2,7 +2,7 @@ # Don't test properties of pkgs.lib, but rather the lib in the parent directory pkgs ? import ../.. {} // { lib = throw "pkgs.lib accessed, but the lib tests should use nixpkgs' lib path directly!"; }, nix ? pkgs-nixVersions.stable, - nixVersions ? [ pkgs-nixVersions.minimum nix pkgs-nixVersions.unstable ], + nixVersions ? [ pkgs-nixVersions.minimum nix pkgs-nixVersions.latest ], pkgs-nixVersions ? import ./nix-for-tests.nix { inherit pkgs; }, }: diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index d83e7c4ff71c..9dfcc4b373b2 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -30,6 +30,10 @@ In addition to numerous new and upgraded packages, this release has the followin To disable this, set [nixpkgs.flake.setNixPath](#opt-nixpkgs.flake.setNixPath) and [nixpkgs.flake.setFlakeRegistry](#opt-nixpkgs.flake.setFlakeRegistry) to false. +- `nixVersions.unstable` was removed. Instead the following attributes are provided: + - `nixVersions.git` which tracks the latest Nix master and is roughly updated once a week. This is intended to enable people to easily test unreleased changes of Nix to catch regressions earlier. + - `nixVersions.latest` which points to the latest Nix version packaged in nixpkgs. + - Julia environments can now be built with arbitrary packages from the ecosystem using the `.withPackages` function. For example: `julia.withPackages ["Plots"]`. - The PipeWire and WirePlumber modules have removed support for using diff --git a/pkgs/development/tools/language-servers/nil/default.nix b/pkgs/development/tools/language-servers/nil/default.nix index 19822d2977fc..88d4a6fd3668 100644 --- a/pkgs/development/tools/language-servers/nil/default.nix +++ b/pkgs/development/tools/language-servers/nil/default.nix @@ -14,7 +14,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-lyKPmzuZB9rCBI9JxhxlyDtNHLia8FXGnSgV+D/dwgo="; nativeBuildInputs = [ - (lib.getBin nixVersions.unstable) + (lib.getBin nixVersions.latest) ]; env.CFG_RELEASE = version; diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 3eb49fb62b3d..1522f141da7c 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -179,6 +179,19 @@ in lib.makeExtensible (self: ({ hash = "sha256-Ugcc+lSq8nJP+mddMlGFnoG4Ix1lRFHWOal3299bqR8="; }; + git = common rec { + version = "2.22.0"; + suffix = "pre20240421_${lib.substring 0 8 src.rev}"; + src = fetchFromGitHub { + owner = "NixOS"; + repo = "nix"; + rev = "6fd2f42c2defd210e17ec95653110fc58858dba9"; + hash = "sha256-DjkxYMcG52APiADdEtXL1FNVSxNXRBw78LYctly93j0="; + }; + }; + + latest = self.nix_2_21; + # The minimum Nix version supported by Nixpkgs # Note that some functionality *might* have been backported into this Nix version, # making this package an inaccurate representation of what features are available @@ -197,8 +210,6 @@ in lib.makeExtensible (self: ({ nix; stable = addFallbackPathsCheck self.nix_2_18; - - unstable = self.nix_2_22; } // lib.optionalAttrs config.allowAliases ( lib.listToAttrs (map ( minor: @@ -207,4 +218,7 @@ in lib.makeExtensible (self: ({ in lib.nameValuePair attr (throw "${attr} has been removed") ) (lib.range 4 17)) + // { + unstable = throw "nixVersions.unstable has been removed. For bleeding edge (Nix master, roughly weekly updated) use nixVersions.git, otherwise use nixVersions.latest."; + } ))) From 4ccf49b1127aa662a764c6b9393776d03d63a5b3 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 28 Apr 2024 23:33:22 +0200 Subject: [PATCH 2/2] nixVersions.git: 2.22.0.pre20240421_6fd2f42c -> 2.23.0pre20240426_2f678331 Had to rework the nix-perl build a little bit since it's now based on meson. Confirmed that everything from Nix 2.3 works fine with it (confirmed that the `isValidPath` operation is behaving correctly from Perl). This doesn't fix cross though, neither for 2.22 nor later: both configuration systems check for a `curl` & `perl` in the builder's $PATH even though both are only in `buildInputs` in upstream's build. OTOH a native Perl is probably needed for `xsubpp`. --- pkgs/tools/package-management/nix/default.nix | 8 +-- .../tools/package-management/nix/nix-perl.nix | 66 +++++++++++++++---- 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 1522f141da7c..f36497cda34d 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -180,13 +180,13 @@ in lib.makeExtensible (self: ({ }; git = common rec { - version = "2.22.0"; - suffix = "pre20240421_${lib.substring 0 8 src.rev}"; + version = "2.23.0"; + suffix = "pre20240426_${lib.substring 0 8 src.rev}"; src = fetchFromGitHub { owner = "NixOS"; repo = "nix"; - rev = "6fd2f42c2defd210e17ec95653110fc58858dba9"; - hash = "sha256-DjkxYMcG52APiADdEtXL1FNVSxNXRBw78LYctly93j0="; + rev = "2f678331d59451dd6f1d9512cb6d92e4ecb9750f"; + hash = "sha256-4AwaLB/gTRgvZG4FmFY6OY52yeLAnj0a6rtJCz7TRXA="; }; }; diff --git a/pkgs/tools/package-management/nix/nix-perl.nix b/pkgs/tools/package-management/nix/nix-perl.nix index 0796a0914f1f..8fc2657657af 100644 --- a/pkgs/tools/package-management/nix/nix-perl.nix +++ b/pkgs/tools/package-management/nix/nix-perl.nix @@ -9,35 +9,75 @@ , autoreconfHook , autoconf-archive , nlohmann_json +, xz , Security +, meson +, ninja +, bzip2 }: -stdenv.mkDerivation { +let + atLeast223 = lib.versionAtLeast nix.version "2.23"; + + 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/perl"; - buildInputs = lib.optional (stdenv.isDarwin) Security; - - # This is not cross-compile safe, don't have time to fix right now - # but noting for future travellers. - nativeBuildInputs = [ - autoconf-archive - autoreconfHook + buildInputs = [ boost + bzip2 curl libsodium nix - nlohmann_json perl + xz + ] ++ lib.optional (stdenv.isDarwin) Security; + + # 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.isDarwin; + + nativeCheckInputs = [ + perl.pkgs.Test2Harness ]; - configureFlags = [ - "--with-dbi=${perl.pkgs.DBI}/${perl.libPrefix}" - "--with-dbd-sqlite=${perl.pkgs.DBDSQLite}/${perl.libPrefix}" + ${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.doCheck) ]; preConfigure = "export NIX_STATE_DIR=$TMPDIR"; -} +})