[Nix#9585] builtins.pathExists returns false for symlink to directory suffixed with "/." #88

Open
opened 2024-03-16 06:44:50 +00:00 by lix-bot · 0 comments
Member

Upstream-Issue: NixOS/nix#9585

Describe the bug
If you create a symlink to a directory and then add "/." to the symlink path, that is a path to that directory. The OS recognizes that as a path to the directory. However, builtins.pathExists returns false.

Steps To Reproduce

mkdir regular-dir
ln -s regular-dir symlink-dir
nix eval --impure --expr 'builtins.pathExists (toString ./symlink-dir + "/.")'

Expected behavior

It should return true.

nix-env --version output
nix-env (Nix) 2.18.1

Additional context
Related: https://github.com/NixOS/nix/issues/8838 (Regression in builtins.pathExists)

This similarly breaks overlays if your <nixpkgs-overlays> is a symlink to a directory (e.g. a symlink in /etc pointing into /nix).

Upstream-Issue: https://git.lix.systems/NixOS/nix/issues/9585 **Describe the bug** If you create a symlink to a directory and then add "/." to the symlink path, that is a path to that directory. The OS recognizes that as a path to the directory. However, builtins.pathExists returns false. **Steps To Reproduce** ```sh mkdir regular-dir ln -s regular-dir symlink-dir nix eval --impure --expr 'builtins.pathExists (toString ./symlink-dir + "/.")' ``` **Expected behavior** It should return true. **`nix-env --version` output** nix-env (Nix) 2.18.1 **Additional context** Related: https://github.com/NixOS/nix/issues/8838 (Regression in builtins.pathExists) This similarly breaks overlays if your `<nixpkgs-overlays>` is a symlink to a directory (e.g. a symlink in /etc pointing into /nix).
lix-bot added the
bug
imported
labels 2024-03-16 06:44:50 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#88
No description provided.