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

Source roots result in /nix/store/<hash>-<hash>-source #10627

Open
edolstra opened this issue Apr 30, 2024 · 1 comment
Open

Source roots result in /nix/store/<hash>-<hash>-source #10627

edolstra opened this issue Apr 30, 2024 · 1 comment

Comments

@edolstra
Copy link
Member

edolstra commented Apr 30, 2024

Describe the bug

In a flake with a derivation attribute like

src = ./.;

the tree gets copied into the store as /nix/store/<hash1>-<hash2>-source. This is because (pre lazy-trees) the basename of the tree is /nix/store/<hash2>-source.

This double-copying is obviously undesirable, but we can't fix it without a breaking change (i.e. without changing derivation paths).

On lazy-trees, we can at least avoid writing /nix/store/<hash2>-source to disk, but we do need to hash the input to compute <hash2>. (See c5ae41d.)

Steps To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

nix-env --version output

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

@KiaraGrouwstra
Copy link

KiaraGrouwstra commented May 14, 2024

we could already improve on the user experience here by warning the user to avoid such paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants