From 00aafcb7d30ce394d1781ee91aaaf738358542fa Mon Sep 17 00:00:00 2001 From: Tom Hunze Date: Sat, 29 Aug 2026 21:53:25 +0200 Subject: [PATCH] fish: avoid replacing "awk" in store paths We encountered a fish build failure [1] caused by the store path for gnugrep coincidentally containing the string `awk`. A later substitution of `awk` replaced this substring with another store path in some files, resulting in a number of broken paths. Extending the `awk` pattern to `awk ` solves this problem and should be relatively safe given that awk requires arguments to be passed. [1] https://hydra.nixos.org/build/343861659 (cherry picked from commit c1d634b2923f4edd748555d6af6ea9e934a0a569) --- pkgs/by-name/fi/fish/package.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/fi/fish/package.nix b/pkgs/by-name/fi/fish/package.nix index b4dcdc21337b..453dd500a62e 100644 --- a/pkgs/by-name/fi/fish/package.nix +++ b/pkgs/by-name/fi/fish/package.nix @@ -254,14 +254,16 @@ stdenv.mkDerivation (finalAttrs: { EOF '' + lib.optionalString stdenv.hostPlatform.isLinux '' + # Trailing space in 'awk ' to avoid matching store paths that coincidentally + # contain the string 'awk'. (Yes, this has happened before!) for cur in share/functions/*.fish; do substituteInPlace "$cur" \ --replace-quiet '/usr/bin/getent' '${lib.getExe getent}' \ - --replace-quiet 'awk' '${lib.getExe' gawk "awk"}' + --replace-quiet 'awk ' '${lib.getExe' gawk "awk"} ' done for cur in share/completions/*.fish; do substituteInPlace "$cur" \ - --replace-quiet 'awk' '${lib.getExe' gawk "awk"}' + --replace-quiet 'awk ' '${lib.getExe' gawk "awk"} ' done '' + ''