-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
nix-store --add-fixed
no longer accepts symlinks
#11941
Comments
Assuming this is an intentional behaviour change, I've submitted NixOS/nixpkgs#358685 so that the nix-prefetch scripts resolve /tmp to a real directory before calling |
Speaking more generally, is it expected that you can't call ~/dev $ nix-shell -p 'nixVersions.nix_2_20'
[nix-shell:~/dev]$ mkdir -p foo/bar && ln -s foo foo-link
[nix-shell:~/dev]$ nix-store --add-fixed --recursive sha256 foo-link/bar
error: path '«unknown»/Users/jon/dev/foo-link' is a symlink I don't see a relevant-sounding change listed in the release notes, not sure if it's a bug or feature. |
The last comment gives a way to reproduce on linux easily. The last 2 even mentioning symlinks in their commit messages Bisection log
|
nix-store --add-fixed
no longer accepts symlinks
I believe this is the same issue as #11681 |
Full list of duplicates (that I can find):
Possibly related:
This bug appears to have a wide blast radius. This is the exact reason there was so much resistance to moving the Nixpkgs default Nix version away from 2.18 and makes the decision to remove versions of Nix older than 2.24 from Nixpkgs (despite known regressions with no workarounds) so much more frustrating. |
This was originally filed as a macos-specific bug ("nix-prefetch-git symlink error on macos"), but I think the root cause is a universal issue.
Describe the bug
As of nix 2.20, you can't call
nix-store --add-fixed
on a path with a symlink parent.Steps To Reproduce
The same command works fine with 2.19
This causes problems with tools like nix-prefetch-git, especially on macOS where it clones the repo into /tmp, which is actually a symlink to /private/tmp.
The change-in-behaviour presumably originates from 83c067c
Original issue details
Describe the bug
nix-prefetch-git doesn't seem to work for me on macos with the 24.11-beta tag - it complains that /tmp is a symlink (which it is, it links to /private/tmp).
Steps To Reproduce
Expected behavior
Successfully fetches a git repo into the store
Additional context
The same command works fine with 24.05:
I'd originally posted this in nixpkgs, but then bisected it down to 9a94e07, so I'm guessing the problem is actually in nix itself..?
Metadata
(though I believe that nix-prefetch-git is using 2.24, at least in the 22.11 release
Checklist
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: