From b8541f163a0b2db6e244e77fe995b31fa54c5f14 Mon Sep 17 00:00:00 2001 From: Yifei Sun Date: Wed, 17 Jun 2026 09:51:07 +0200 Subject: [PATCH 1/3] nixVersions.git: 2.35pre20260504 -> 2.35pre20260619 --- pkgs/tools/package-management/nix/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index f01ccee39e42..fcb11efab910 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -213,14 +213,14 @@ lib.makeExtensible ( nixComponents_git = (nixDependencies.callPackage ./modular/packages.nix rec { - version = "2.35pre20260504_${lib.substring 0 8 src.rev}"; + version = "2.35pre20260619_${lib.substring 0 8 src.rev}"; inherit teams; otherSplices = generateSplicesForNixComponents "nixComponents_git"; src = fetchFromGitHub { owner = "NixOS"; repo = "nix"; - rev = "53ab7375a110825814837005aaf5a256edea6eae"; - hash = "sha256-ILPe+2GSPjmsZvEegUh0lJ1yWSsQnU1eJvfvIdJ8ins="; + rev = "f8bb823a23bf6d62f4c8feb792a77702d7a49fe1"; + hash = "sha256-eWBQ01zjUjTF6VyWzmt6fN6jI+vlCDtqYaJG1McIKpc="; }; }).appendPatches patches_common; From c57d288273c534c2ee66e0844ff7126f18288ece Mon Sep 17 00:00:00 2001 From: Yifei Sun Date: Wed, 17 Jun 2026 10:04:46 +0200 Subject: [PATCH 2/3] nix: comment out unwanted tests directly in `src` in https://github.com/NixOS/nixpkgs/pull/532575 we were using hardcoded line numbers to disable tests and the patch might not apply if upstream source reordered the tests or added/removed entries instead we added `removeFunctionalTests` helper to directly comment out those lines in meson.build file --- pkgs/tools/package-management/nix/default.nix | 73 +++++++++++++++---- .../nix/patches/skip-flaky-darwin-tests.patch | 18 ----- 2 files changed, 57 insertions(+), 34 deletions(-) delete mode 100644 pkgs/tools/package-management/nix/patches/skip-flaky-darwin-tests.patch diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index fcb11efab910..54f237d2c8cb 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -125,15 +125,48 @@ let lib.teams.security-review ]; + # Comment out functional tests from meson.build file + # This is to prevent test list reordering between releases in `tests/functional/**/meson.build` + # `tests` is a list of `{ file; test; }` + removeFunctionalTests = + tests: src: + # empty implies noop + if tests == [ ] then + src + else + runCommand src.name { inherit src; } '' + cp -r "$src" "$out" + chmod -R u+w "$out" + ${lib.concatMapStringsSep "\n" ( + { file, test }: + ''substituteInPlace "$out/${file}" --replace-fail "'${test}'," "# '${test}',"'' + ) tests} + ''; + # Disables tests that have been flaky due to the darwin sandbox and fork safety # with missing shebangs. # See: # - https://github.com/NixOS/nix/pull/14778 # - https://github.com/NixOS/nixpkgs/issues/476794 # - https://github.com/NixOS/nix/issues/13106 - patches_common = lib.optional ( - stdenv.system == "aarch64-darwin" - ) ./patches/skip-flaky-darwin-tests.patch; + commonDisabledTests = lib.optionals (stdenv.hostPlatform.system == "aarch64-darwin") [ + { + file = "tests/functional/meson.build"; + test = "nix-shell.sh"; + } + { + file = "tests/functional/meson.build"; + test = "user-envs.sh"; + } + { + file = "tests/functional/ca/meson.build"; + test = "nix-shell.sh"; + } + { + file = "tests/functional/flakes/meson.build"; + test = "shebang.sh"; + } + ]; # Lowdown 3.0 compatibility patch for nix 2.31–2.33; fetched from the # upstream backport (same diff on every maintenance branch after @@ -156,9 +189,14 @@ lib.makeExtensible ( { nix_2_28 = commonMeson { version = "2.28.7"; - hash = "sha256-Fq4+7uYz6bdE1HvPqn+qZcYX1rNilVKT7YAAPLA8170="; + src = removeFunctionalTests commonDisabledTests (fetchFromGitHub { + owner = "NixOS"; + repo = "nix"; + rev = "2.28.7"; + hash = "sha256-Fq4+7uYz6bdE1HvPqn+qZcYX1rNilVKT7YAAPLA8170="; + }); self_attribute_name = "nix_2_28"; - patches = patches_common ++ [ + patches = [ lowdown30PatchOld ]; }; @@ -168,14 +206,14 @@ lib.makeExtensible ( version = "2.30.5"; inherit teams; otherSplices = generateSplicesForNixComponents "nixComponents_2_30"; - src = fetchFromGitHub { + src = removeFunctionalTests commonDisabledTests (fetchFromGitHub { owner = "NixOS"; repo = "nix"; tag = version; hash = "sha256-tGiV71RxtCNcUNX86ZwmOIghG4pLwm5nlRKd89er7Gk="; - }; + }); }).appendPatches - (patches_common ++ [ lowdown30PatchOld ]); + [ lowdown30PatchOld ]; nix_2_30 = addTests "nix_2_30" self.nixComponents_2_30.nix-everything; @@ -200,30 +238,33 @@ lib.makeExtensible ( version = "2.34.7"; inherit teams; otherSplices = generateSplicesForNixComponents "nixComponents_2_34"; - src = fetchFromGitHub { + src = removeFunctionalTests commonDisabledTests (fetchFromGitHub { owner = "NixOS"; repo = "nix"; tag = version; hash = "sha256-uj5KNW8Vdm60FCUxD2KsrCVH/WwoemvczWmmrb3Gvlo="; - }; + }); }).appendPatches - patches_common; + [ ]; nix_2_34 = addTests "nix_2_34" self.nixComponents_2_34.nix-everything; nixComponents_git = - (nixDependencies.callPackage ./modular/packages.nix rec { - version = "2.35pre20260619_${lib.substring 0 8 src.rev}"; - inherit teams; - otherSplices = generateSplicesForNixComponents "nixComponents_git"; + let src = fetchFromGitHub { owner = "NixOS"; repo = "nix"; rev = "f8bb823a23bf6d62f4c8feb792a77702d7a49fe1"; hash = "sha256-eWBQ01zjUjTF6VyWzmt6fN6jI+vlCDtqYaJG1McIKpc="; }; + in + (nixDependencies.callPackage ./modular/packages.nix { + version = "2.35pre20260619_${lib.substring 0 8 src.rev}"; + inherit teams; + otherSplices = generateSplicesForNixComponents "nixComponents_git"; + src = removeFunctionalTests commonDisabledTests src; }).appendPatches - patches_common; + [ ]; git = addTests "git" self.nixComponents_git.nix-everything; diff --git a/pkgs/tools/package-management/nix/patches/skip-flaky-darwin-tests.patch b/pkgs/tools/package-management/nix/patches/skip-flaky-darwin-tests.patch deleted file mode 100644 index 60d1a4ac78d7..000000000000 --- a/pkgs/tools/package-management/nix/patches/skip-flaky-darwin-tests.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/tests/functional/ca/meson.build -+++ b/tests/functional/ca/meson.build -@@ -27 +27 @@ suites += { -- 'nix-shell.sh', -+ # 'nix-shell.sh', ---- a/tests/functional/flakes/meson.build -+++ b/tests/functional/flakes/meson.build -@@ -27 +27 @@ suites += { -- 'shebang.sh', -+ # 'shebang.sh', ---- a/tests/functional/meson.build -+++ b/tests/functional/meson.build -@@ -65 +65 @@ suites = [ -- 'user-envs.sh', -+ # 'user-envs.sh', -@@ -92 +92 @@ suites = [ -- 'nix-shell.sh', -+ # 'nix-shell.sh', From 40b1d13a21291c43543a0c66f7c285396a5fa5ac Mon Sep 17 00:00:00 2001 From: Yifei Sun Date: Wed, 17 Jun 2026 14:22:57 +0200 Subject: [PATCH 3/3] nix: cleanup unused lowdown patch --- pkgs/tools/package-management/nix/default.nix | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 54f237d2c8cb..226bc4adaabd 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -5,7 +5,6 @@ nixDependencies, generateSplicesForMkScope, fetchFromGitHub, - fetchpatch2, runCommand, pkgs, pkgsi686Linux, @@ -168,16 +167,6 @@ let } ]; - # Lowdown 3.0 compatibility patch for nix 2.31–2.33; fetched from the - # upstream backport (same diff on every maintenance branch after - # fetchpatch strips metadata). Nix 2.34.4+ and the git snapshot - # already include the fix in their tagged source. - lowdown30Patch = pkgs.fetchpatch { - name = "nix-lowdown-3.0-support.patch"; - url = "https://github.com/NixOS/nix/commit/472c35c561bd9e8db1465e0677f1efe2cb88c568.patch"; - hash = "sha256-ZCQgI/euBN8t9rgdCsGRgrcEWG3T5MUc+bQc4tIcHuI="; - }; - # 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.