From a30d87eadce46bea37f916e849b4f15de51643a3 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Fri, 31 Oct 2025 14:41:27 +0100 Subject: [PATCH] nix/doctor: skip inaccessible PATH elems for duplicate nix Inaccessible-but-extant PATH elements can't be executed anyway, so we can skip them as if they didn't exist, instead of erroring like before. Change-Id: I9288c3ecb6768171e62a3088122d98421558eb03 --- lix/nix/doctor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lix/nix/doctor.cc b/lix/nix/doctor.cc index 01dcfcac1..05b5d5203 100644 --- a/lix/nix/doctor.cc +++ b/lix/nix/doctor.cc @@ -79,7 +79,8 @@ struct CmdDoctor : StoreCommand PathSet dirs; for (auto & dir : tokenizeString(getEnv("PATH").value_or(""), ":")) - if (pathExists(dir + "/nix-env")) + // Inaccessible-but-extant PATH elements can't be executed anyway. + if (pathAccessible(dir + "/nix-env")) dirs.insert(dirOf(canonPath(dir + "/nix-env", true))); if (dirs.size() != 1) {