-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Git fetcher: Don't compute revCount/lastModified if they're already specified #14596
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
base: master
Are you sure you want to change the base?
Conversation
|
I thought this is what |
|
No, |
|
I think we should make Would this be an accurate release note? ---
synopsis: Git fetcher accepts `revCount` and `lastModified` without validation
prs: [14596]
---The git fetcher now trusts When this applies:
When this doesn't apply:
Impact: Incorrect values don't affect source integrity (correct files are still fetched based on Risks:
Recommendations:
ALTERNATIVELY IF IMPLEMENTED
|
|
Yes that seems accurate. It's worth noting that the tarball fetcher already allows returning these attributes without checking them, so in that sense it makes behavior more consistent. |
We don't care if the user (or more likely the lock file) specifies an incorrect value for revCount, since it doesn't matter for security (unlikely content hashes like narHash).
Same as revCount.
17db441 to
4ecc09c
Compare
|
I guess we could warn if there is a mismatch. That way the user will get a warning in most cases (namely when Nix does an actual fetch, rather than a substitution, which would be the case unless you don't change |
Motivation
This avoids a potentially expensive computation of
revCount(andlastModified, but that's cheap) in the common case where it's already known (namely because it's in a lock file).This means that we no longer check the correctness of those attributes, but we don't care if the user (or more likely the lock file) specifies an incorrect value for these attributes, since it doesn't matter for security (unlikely content hashes like
narHash).Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.