From 3648b336ba448ca0d4534cee3af164c4618af4d3 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sun, 23 Oct 2022 12:00:00 +0000 Subject: [PATCH] lib.normalizePath: the empty string is not a valid regex on darwin presumably due to using libc++'s regex lib instead of libstdc++ on linux Fixes https://github.com/NixOS/nixpkgs/pull/177273#issuecomment-1287562800 --- lib/strings.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/strings.nix b/lib/strings.nix index be217cb064697..af26532aa4305 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -193,7 +193,7 @@ rec { normalizePath "/a//b///c/" => "/a/b/c/" */ - normalizePath = s: (builtins.foldl' (x: y: if y == "/" && hasSuffix "/" x then x else x+y) "" (splitString "" s)); + normalizePath = s: (builtins.foldl' (x: y: if y == "/" && hasSuffix "/" x then x else x+y) "" (stringToCharacters s)); /* Depending on the boolean `cond', return either the given string or the empty string. Useful to concatenate against a bigger string.