lib.fetchers: add hash-normalization helpers#342072
lib.fetchers: add hash-normalization helpers#342072nicoonoclaste merged 15 commits intoNixOS:masterfrom
Conversation
bfa109f to
f9730ce
Compare
normalizeHashes wrapper|
Also converted |
Aleksanaa
left a comment
There was a problem hiding this comment.
Looks reasonable; missing doc comments (or we don't write it for "internal use"?); Should evaluate performance impact after converting some major fetchers
Good catch, I forgot to make a new documentation comment when splitting up the function PS: The comments also do not yet comply with the new documentation conventions, though writing a type signature for those functions will be... fun 😓 |
That was indeed my plan. If you think the PR is in a reasonable state, and once ofborg is done evaluating it, I can plonk the wrapper on |
6261a7f to
a55508f
Compare
|
Fixed the eval issue (forgot to update |
a55508f to
c85d3e6
Compare
Done, |
|
Result of 1 package built:
|
|
Result of 1 package blacklisted:
2 packages built:
|
|
From the evaluation perf. report, this didn't have a significant impact on memory use, but may have made nixpkgs 4% slower to eval, though IDK what's the measurement noise on that metric. There's a couple potential optimizations I can try, though. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm sorry I can't give final review as I'm not really familiar with (And I'm preparing for GRE test at Friday) |
No problem, and thanks for letting me know to look for another reviewer.
👍
加油! |
|
Added a cleaner error message for cases like |
05dd453 to
4e4101f
Compare
|
Rebased now, since this won't make final review harder, introducing no changes |
eb0d28b to
f5e52f8
Compare
|
Reformated the tests |
…ithNormalizedHash`
|
Forgot to update some commit messages when renaming the functions; no change |
a11da5f to
4a02b5b
Compare
|
Fixed the way the new test file is invoked PS: That took a bit of back-and-forth, but finally got it 🎉 |
bf2c563 to
0aa5242
Compare
|
Formated |
|
Result of 1 package built:
|
|
Result of 1 package blacklisted:
2 packages built:
|
|
Result of 1 package built:
|
|
Result of 1 package blacklisted:
2 packages built:
|
Description of changes
lib.fetchers, intended to deduplicate the logic needed for Tracking: deprecate sha256 attribute in fetchers in favor of hash = "<SRI hash>" #325892normalizeHashconverts an attrset containing one ofhash,sha256, ... into one containingoutputHash{,Algo};withNormalizedHashwraps a function withnormalizeHash, updating its signature :it automatically converts a fetcher which accepts
outputHash{, Algo}into the current convention.and even a 6% improvement as of 582439bfc2793729823e7d993149df170be01dff.fetchRepoProjectinwithNormalizedHash, and updateamdvlkto use thehashattribute as working example.buildBazelPackageto acceptfetchAttrs.hash(usingnormalizedHash) and update a few packages as working examples.Things done
nixpkgs-review.Add a 👍 reaction to pull requests you find important.