-
-
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
Git hashing for Git fetching #9025
base: master
Are you sure you want to change the base?
Git hashing for Git fetching #9025
Conversation
79fc9f6
to
cdbbc69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursory review
88e2bda
to
4c8736c
Compare
4c8736c
to
e4c7e89
Compare
🎉 All dependencies have been resolved ! |
f0d1e1a
to
33e945b
Compare
The git fetcher is now more tree-hash-oriented, and we will want to integrate this with git fetching eventually. This PR exposes `treeHash` inputs and outputs in a few ways for this purpose. Eventually, we should add something like `builtins.derivation`'s `outputHashMode` to `builtins.fetchTree`, in order to specify we should use git hashing, and then this and the store-layer git hashing should meet together, ensuring we have the same tree hash end-to-end. Part of RFC 133 Co-Authored-By: Matthew Bauer <mjbauer95@gmail.com> Co-Authored-By: Carlo Nucera <carlo.nucera@protonmail.com> Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
33e945b
to
a8314ff
Compare
They already meet, and they involve a transformation that turns git trees without submodules and filtering into git trees where those things are resolved. Could you clarify what "meeting" entails and how we benefit from that? |
if (auto narHash = input.getNarHash()) { | ||
attrs.alloc("narHash").mkString(narHash->to_string(HashFormat::SRI, true)); | ||
} else if (auto treeHash = input.getTreeHash()) { | ||
attrs.alloc("treeHash").mkString(treeHash->to_string(HashFormat::SRI, true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have two kinds of tree hashes:
- tree hashes from git commits, which do not correspond to fetched trees in general
- tree hashes from file system objects returned by
fetchTree
Which one is this, and what is the purpose of exposing it to the expression language?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The meaning of the tree hash must be unambiguous.
- We need a concrete benefit to users before exposing arbitrary data to the expression language.
Motivation
The git fetcher is now more tree-hash-oriented, and we will want to integrate this with git fetching eventually. This PR exposes
treeHash
inputs and outputs in a few ways for this purpose.Eventually, we should add something like
builtins.derivation
'soutputHashMode
tobuiltins.fetchTree
, in order to specify we should use git hashing, and then this and the store-layer git hashing should meet together, ensuring we have the same tree hash end-to-end.Context
Part of RFC 133
Tracking issue #8919
depends on #8918Priorities
Add 👍 to pull requests you find important.