-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Unstable NAR hash for git
inputs using export-subst
#7596
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-01-13-nix-team-meeting-minutes-23/24644/3 |
A different problem with unreproducible git fetchTree was discussed in today's Nix Team meeting. Another, somewhat-related data point for the The tree hash could be stored in the lock file and it would also make subdir fetching more efficient. |
Detailed notes: #4635 (comment) |
EDIT: sorry, I'd misunderstood! Indeed, it looks like https://github.com/mcwitt/export-subst-minimal/archive/4e289bdc5e251b8aea07ba6cbc6b892450d95600.tar.gz does not have the substitution applied |
If we were using |
It does, and we've been using libgit2 since Nix 2.20
This is what flakes does internally as well. Solved since #9240 |
Describe the bug
When Flake inputs are git repos that use the
export-subst
feature in.gitattributes
(for example, projects that use python-versioneer), the NAR hashes of these inputs can be unstable over time, leading toNAR hash mismatch in input
errors.Steps To Reproduce
Consider the flake
(the input mcwitt/export-subst-minimal is a minimal example of a repo using
export-subst
)The contents of the resulting store path are not reproducible:
The contents will change for example when the pinned commit is no longer HEAD in main, leading to hash mismatch next time we fetch the input (on a different machine, or if the local cache is invalidated).
Expected behavior
Inputs using the
git+https
scheme should have stable NAR hashes. In particular,git-archive
/export-subst
actions should not be run, since these can lead to non-reproducibility as in the example above.nix-env --version
outputnix-env (Nix) 2.11.1
Additional context
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: