From c5f167527b44a51c1e8cdd0e519040092ad31b8f Mon Sep 17 00:00:00 2001 From: r-vdp Date: Sat, 28 Mar 2026 10:46:19 +0100 Subject: [PATCH 1/2] fish: 4.5.0 -> 4.6.0 https://github.com/fish-shell/fish-shell/releases/tag/4.6.0 Upstream refactored tests in this release, removing many hardcoded FHS paths, so most substituteInPlace calls are no longer needed. The highlight test now uses /usr/bin/env instead of /bin/cat. Add the new resettable_style_attribute SGR test to skip-sgr-tests.patch since it fails in the sandbox like the other SGR tests. --- pkgs/by-name/fi/fish/package.nix | 30 ++++------------------- pkgs/by-name/fi/fish/skip-sgr-tests.patch | 12 +++++++-- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/pkgs/by-name/fi/fish/package.nix b/pkgs/by-name/fi/fish/package.nix index 712307f8fdb0..69127aa37d78 100644 --- a/pkgs/by-name/fi/fish/package.nix +++ b/pkgs/by-name/fi/fish/package.nix @@ -149,13 +149,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "fish"; - version = "4.5.0"; + version = "4.6.0"; src = fetchFromGitHub { owner = "fish-shell"; repo = "fish-shell"; tag = finalAttrs.version; - hash = "sha256-9EhvCStAeL+ADkLy9b4gXPx+JrVzUZ5Fdkf+imY3Vw0="; + hash = "sha256-lhixotjhD8+xb8Hw6Mu1uJPtCq0zlQsBAXpHRzT+moI="; }; env = { @@ -168,7 +168,7 @@ stdenv.mkDerivation (finalAttrs: { cargoDeps = rustPlatform.fetchCargoVendor { inherit (finalAttrs) src patches; - hash = "sha256-RVg6Zciy9mqZQwM5P3ngJi2NjC0qwFH7XgVEanaKnsg="; + hash = "sha256-zua2O3eGi7dXh4w0IoUGL2RxvGIW0O3WpVg/tT8942Q="; }; patches = [ @@ -195,37 +195,17 @@ stdenv.mkDerivation (finalAttrs: { # Fix FHS paths in tests postPatch = '' - substituteInPlace src/builtins/test.rs \ - --replace-fail '"/bin/ls"' '"${lib.getExe' coreutils "ls"}"' - substituteInPlace src/highlight/highlight.rs \ - --replace-fail '"/bin/c"' '"${lib.getExe' coreutils "c"}"' \ - --replace-fail '"/bin/ca"' '"${lib.getExe' coreutils "ca"}"' + --replace-fail '/usr/bin/e' '${coreutils}/bin/e' substituteInPlace src/highlight/file_tester.rs \ --replace-fail '/usr' '/' - substituteInPlace tests/checks/cd.fish \ - --replace-fail '/bin/pwd' '${lib.getExe' coreutils "pwd"}' - - substituteInPlace tests/checks/redirect.fish \ - --replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}' - substituteInPlace tests/checks/vars_as_commands.fish \ --replace-fail '/usr/bin' '${coreutils}/bin' substituteInPlace tests/checks/jobs.fish \ - --replace-fail 'ps -o' '${lib.getExe' procps "ps"} -o' \ - --replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}' - - substituteInPlace tests/checks/job-control-noninteractive.fish \ - --replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}' - - substituteInPlace tests/checks/complete.fish \ - --replace-fail '/bin/ls' '${lib.getExe' coreutils "ls"}' - - substituteInPlace tests/checks/output-buffering.fish \ - --replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}' + --replace-fail 'ps -o' '${lib.getExe' procps "ps"} -o' substituteInPlace tests/pexpects/wait.py \ --replace-fail 'expect_prompt("Job ' 'expect_prompt("fish: Job ' \ diff --git a/pkgs/by-name/fi/fish/skip-sgr-tests.patch b/pkgs/by-name/fi/fish/skip-sgr-tests.patch index f643a4ba8201..2073310d87a7 100644 --- a/pkgs/by-name/fi/fish/skip-sgr-tests.patch +++ b/pkgs/by-name/fi/fish/skip-sgr-tests.patch @@ -1,7 +1,7 @@ diff --git a/src/terminal.rs b/src/terminal.rs --- a/src/terminal.rs +++ b/src/terminal.rs -@@ -787,6 +787,7 @@ +@@ -803,6 +803,7 @@ mod tests { SgrTerminalCommand::ExitAttributeMode, }; @@ -9,7 +9,7 @@ diff --git a/src/terminal.rs b/src/terminal.rs #[test] fn sgr_combining() { // No style, no content -@@ -823,6 +824,7 @@ +@@ -838,6 +839,7 @@ mod tests { assert_eq!(String::from_utf8_lossy(outp.contents()), "\u{1b}[30;40m"); } @@ -17,3 +17,11 @@ diff --git a/src/terminal.rs b/src/terminal.rs #[test] fn sgr_max_length() { // Cut at max length +@@ -892,6 +894,7 @@ mod tests { + ); + } + ++ #[ignore] + #[test] + fn resettable_style_attribute() { + type RS = crate::text_face::ResettableStyle<()>; From b4113461331edbdef89fc8b591deb354385c0a90 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Sat, 28 Mar 2026 10:47:37 +0100 Subject: [PATCH 2/2] nixos/tests/fish: fix test broken by coreutils 9.10 coreutils 9.10 man pages are generated by help2man 1.50 which embeds tty hyperlink escape codes (\X'tty: link ...'). These break fish's create_manpage_completions.py parser, so coreutils.fish is no longer generated. Switch to coreutils-full (the minimal coreutils has no man pages at all) and check for chmod.fish which still parses successfully. --- nixos/tests/fish.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/tests/fish.nix b/nixos/tests/fish.nix index a134bf1f68c1..65ea0b964694 100644 --- a/nixos/tests/fish.nix +++ b/nixos/tests/fish.nix @@ -7,7 +7,9 @@ { programs.fish.enable = true; environment.systemPackages = with pkgs; [ - coreutils + # coreutils-full (not coreutils) so that man pages are available + # for completion generation + coreutils-full procps # kill collides with coreutils' to test https://github.com/NixOS/nixpkgs/issues/56432 ]; @@ -19,7 +21,7 @@ #python '' start_all() - machine.wait_for_file("/etc/fish/generated_completions/coreutils.fish") + machine.wait_for_file("/etc/fish/generated_completions/chmod.fish") machine.wait_for_file("/etc/fish/generated_completions/kill.fish") machine.succeed( "fish -ic 'echo $fish_complete_path' | grep -q '/share/fish/vendor_completions.d /etc/fish/generated_completions /root/.cache/fish/generated_completions$'"