From e5f929032e6ad532647ad355e737e6c751c4302e Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Tue, 21 Jul 2026 16:23:24 -0400 Subject: [PATCH] ripgrep: fix cross build Linux to FreeBSD ripgrep was evaluating the emulator for a cross-test, even without `canRunRg`. This failed when there is no emulator. --- pkgs/by-name/ri/ripgrep/package.nix | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/ri/ripgrep/package.nix b/pkgs/by-name/ri/ripgrep/package.nix index 6249e96438c3..a6e1e9748658 100644 --- a/pkgs/by-name/ri/ripgrep/package.nix +++ b/pkgs/by-name/ri/ripgrep/package.nix @@ -50,15 +50,17 @@ rustPlatform.buildRustPackage (finalAttrs: { ''; doInstallCheck = true; - installCheckPhase = '' - file="$(mktemp)" - echo "abc\nbcd\ncde" > "$file" - ${rg} -N 'bcd' "$file" - ${rg} -N 'cd' "$file" - '' - + lib.optionalString withPCRE2 '' - echo '(a(aa)aa)' | ${rg} -P '\((a*|(?R))*\)' - ''; + installCheckPhase = lib.optionalString canRunRg ( + '' + file="$(mktemp)" + echo "abc\nbcd\ncde" > "$file" + ${rg} -N 'bcd' "$file" + ${rg} -N 'cd' "$file" + '' + + lib.optionalString withPCRE2 '' + echo '(a(aa)aa)' | ${rg} -P '\((a*|(?R))*\)' + '' + ); meta = { description = "Utility that combines the usability of The Silver Searcher with the raw speed of grep";