about summary refs log tree commit diff
path: root/third_party/nix/src/libutil/hash.cc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-08-01 r/1516 fix(3p/nix/hash): param of Unknown allows any hash typeKane York1-1/+6
Fixes a crash in the self-hosting instantiate test: NIX_REMOTE="$(mktemp -d)" nix-instantiate -E 'let depot = import ./default.nix {}; in depot.third_party.nix.outPath' Change-Id: If99494aa07ec248d3894d4709ab0fde7fa81aff3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1508 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2020-08-01 r/1515 chore(3p/nix/hash): prefer StatusOr over throwing constructorKane York1-7/+11
The use of `unwrap_throw` can be used as a later grep target. Change-Id: I8c54ed90c4289f07aecb8a1393dd10204c8bce4e Reviewed-on: https://cl.tvl.fyi/c/depot/+/1493 Reviewed-by: glittershark <grfn@gws.fyi> Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2020-08-01 r/1514 fix(3p/nix/hash): initialize HashSink.ctxKane York1-1/+4
Fixup for CL 1492 (addcba11b05500ba28ade309de6bd53f8153a6c4) Additionally, add a test to verify functionality of HashSink. Change-Id: I2a74b925a1b93ed4d3add29021d759c93e813424 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1507 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-29 r/1506 fix(3p/nix/hash): smart pointers in HashSinkKane York1-15/+12
Change-Id: Ib2aaf42c8b234ee343c4653eb03f328c113dea86 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1492 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-28 r/1504 fix(3p/nix/hash): provide a Status-returning constructorKane York1-51/+69
Additionally, add IsValidBase16() to restore the behavior of rejecting invalid base16, which absl's HexStringToBytes does not do. Change-Id: I777a36f5dc787aa54a2aa316d6728f68da129768 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1484 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-28 r/1503 chore(3p/nix/hash): eliminate exposed global variableKane York1-0/+39
Change-Id: I3b34e3e17a751e225831ae599c6c6bb782a25679 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1486 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-27 r/1495 fix(3p/nix): apply all clang-tidy fixesKane York1-7/+8
Change-Id: I265e763393422ee1881653527c91024458060825 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1432 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-25 r/1462 refactor(3p/nix): Remove custom base64 implementationGriffin Smith1-2/+9
Replace the custom, rather questionable base64 implementation with absl::Base64{Une,E}scape. To make sure that the custom implementation was doing the same thing I've also added a test covering nix::Hash::to_string, which was one function that used it - the test passed prior to the replacement, and continued to pass afterwards. The previous base64Decode function threw an exception on failure - to avoid going too far down the rabbit hole I've replicated that functionality at all call sites, but this should be replaced with more sensible error handling such as StatusOr eventually. Also, before this change: ❯ nix eval -f . users.tazjin.emacs.outPath "/nix/store/g6ri2q8nra96ix20bcsc734r1yyaylb1-tazjins-emacs" And after: ❯ ./result/bin/nix eval -f . users.tazjin.emacs.outPath "/nix/store/g6ri2q8nra96ix20bcsc734r1yyaylb1-tazjins-emacs" Change-Id: Id292ffbb82fe808f3f1b34670afbe7b8c13ad615 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1385 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2020-05-27 r/865 refactor(3p/nix): Anchor local includes at src/Vincent Ambo1-4/+4
Previously all includes were anchored in one global mess of header files. This moves the includes into filesystem "namespaces" (if you will) for each sub-package of Nix. Note: This commit does not introduce the relevant build system changes.
2020-05-24 r/840 style(3p/nix): Remove 'using std::*' from types.hhVincent Ambo1-14/+14
It is considered bad form to use things from includes in headers, as these directives propagate to everywhere else and can make it confusing. types.hh (which is includes almost literally everywhere) had some of these directives, which this commit removes.
2020-05-20 r/788 refactor(3p/nix): Apply clang-tidy's readability-* fixesVincent Ambo1-4/+6
This applies the readability fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html
2020-05-19 r/777 style(3p/nix): Final act in the brace-wrapping sagaVincent Ambo1-27/+37
This last change set was generated by a full clang-tidy run (including compilation): clang-tidy -p ~/projects/nix-build/ \ -checks=-*,readability-braces-around-statements -fix src/*/*.cc Actually running clang-tidy requires some massaging to make it play nice with Nix + meson, I'll be adding a wrapper or something for that soon.
2020-05-19 r/771 style(3p/nix): Add braces around single-line conditionalsVincent Ambo1-6/+18
These were not caught by the previous clang-tidy invocation, but were instead sorted out using amber[0] as such: ambr --regex 'if (\(.+\))\s([a-z].*;)' 'if $1 { $2 }' [0]: https://github.com/dalance/amber
2020-05-19 r/767 style(3p/nix): Enforce braces around loops and conditionalsVincent Ambo1-16/+37
This change was generated with: fd -e cc -e hh | xargs -I{} clang-tidy {} -p ~/projects/nix-build/ \ --checks='-*,readability-braces-around-statements' --fix \ -fix-errors Some manual fixes were applied because some convoluted unbraced statements couldn't be untangled by clang-tidy. This commit still includes invalid files, but I decided to clean them up in a subsequent commit so that it becomes more obvious where clang-tidy failed. Maybe this will allow for a bug-report to clang-tidy.
2020-05-19 r/766 style(3p/nix): Reformat all includes to match new styleVincent Ambo1-2/+5
2020-05-17 r/740 style(3p/nix): Reformat project in Google C++ styleVincent Ambo1-284/+252
Reformatted with: fd . -e hh -e cc | xargs clang-format -i
2020-05-17 r/724 Add 'third_party/nix/' from commit 'be66c7a6b24e3c3c6157fd37b86c7203d14acf10'Vincent Ambo1-0/+355
git-subtree-dir: third_party/nix git-subtree-mainline: cf8cd640c1adf74a3706efbcb0ea4625da106fb2 git-subtree-split: be66c7a6b24e3c3c6157fd37b86c7203d14acf10