-
-
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
Impurity: Hash of relative paths depends on parent directory name #166
Comments
That's not really an impurity. As long as the name and contents of the file are the same, you should get the same hash. That the name might change is simply a reason not to use ./. in this case. |
But the parent directory is not really part of the content, I think. If I clone Nix sources from github, should it really impact my build what I named the target directory? My example may seem contrived, but I discovered this when building NixOS. I keep different NixOS configurations in the following directory layout:
My
Then I can build a system in the following way:
But if I change the names of the |
Closing since this is intended (if not always desirable) behaviour. |
rpi: suggest updating firmware in case image doesn't boot
Consider the following Nix expression, stored in
default.nix
:Then look at the following console session:
As you can see, the hash of the build depends on the name of directory that contains
default.nix
. I had expected that only the files and directories contained inside this directory would matter. This is an impurity, I would say, since you can't recreate a build if you don't know the name of the directory that the build was originally performed in.The text was updated successfully, but these errors were encountered: