Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builtins.pathExists returns false on symlinks that point to non-existent paths #9901

Closed
infinisil opened this issue Feb 1, 2024 · 4 comments · Fixed by #9985
Closed

builtins.pathExists returns false on symlinks that point to non-existent paths #9901

infinisil opened this issue Feb 1, 2024 · 4 comments · Fixed by #9985
Assignees
Labels
bug regression Something doesn't work anymore

Comments

@infinisil
Copy link
Member

infinisil commented Feb 1, 2024

Describe the bug

On master, builtins.pathExists returns false for an existing symlink that points to a non-existent path.

This is a regression, as Nix 2.18.1 returns true.

Steps To Reproduce

$ ln -s does-not-exist symlink
$ nix-instantiate --eval -E 'builtins.pathExists ./symlink'
false

Expected behavior

The same as Nix 2.18.1, which is true

nix-env --version output

nix-env (Nix) 2.21.0pre20240201_ef6d055

Additional context

This was found from the lib.fileset test suite in Nixpkgs failing in a PR (NixOS/nixpkgs#285264), after which @roberth opened #9900.

This may relate to previous regressions:

This issue is sponsored by Antithesis

Priorities

Add 👍 to issues you find important.

@infinisil
Copy link
Member Author

Bisection leads to 83c067c from #9497 causing this regression

@domenkozar
Copy link
Member

@edolstra what are your thoughts on this?

@Ericson2314
Copy link
Member

#9985 fixes this

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update-54/39990/1

srid added a commit to srid/nixos-config that referenced this issue Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug regression Something doesn't work anymore
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants