1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 10:11:47 +02:00

Restore builtins.pathExists behavior on broken symlinks

Commit 83c067c0fa changed `builtins.pathExists`
to resolve symlinks before checking for existence. Consequently, if the path
refers to a symlink itself, existence of the target of the symlink (instead of
the symlink itself) was checked. Restore the previous behavior by skipping
symlink resolution in the last component.

(cherry picked from commit 89e21ab4bd)
This commit is contained in:
Alois Wohlschlager 2024-02-10 20:56:54 +01:00 committed by github-actions[bot]
parent 982d07d009
commit 0571e6e9b4
5 changed files with 46 additions and 19 deletions

View file

@ -29,3 +29,6 @@ builtins.pathExists (./lib.nix)
&& builtins.pathExists (builtins.toPath { outPath = builtins.toString ./lib.nix; })
&& builtins.pathExists ./lib.nix
&& !builtins.pathExists ./bla.nix
&& builtins.pathExists ./symlink-resolution/foo/overlays/overlay.nix
&& builtins.pathExists ./symlink-resolution/broken
&& builtins.pathExists (builtins.toString ./symlink-resolution/foo/overlays + "/.")

View file

@ -0,0 +1 @@
nonexistent