about summary refs log tree commit diff
path: root/third_party/nix/src/libutil/util.hh (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-08-21 r/1703 style(tvix): Add missing braces in expressionsVincent Ambo1-1/+3
The previous clang-tidy invocation missed some header files, which has now been rectified. Change-Id: I31547754fbf52f439dc7aeefb08ab90bd50c4156 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1831 Reviewed-by: glittershark <grfn@gws.fyi> Tested-by: BuildkiteCI
2020-08-21 r/1702 style(tvix): Replace remaining typedefs with using statementsVincent Ambo1-2/+2
Change (mostly) created via: fd . -e hh -e cc | parallel clang-tidy -p ~/builds/nix --fix "'--checks=-*,modernize-use-using'" Change-Id: I90ad6e64a5399f2005dfb9956074ec51c2c78cea Reviewed-on: https://cl.tvl.fyi/c/depot/+/1830 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-08-01 r/1534 fix(3p/nix): revert "apply all clang-tidy fixes"Kane York1-1/+1
This reverts commit ef54f5da9fa30b5c302f2a49595ee5d041f9706a. Resolved conflicts: third_party/nix/src/libexpr/eval.cc third_party/nix/src/libstore/builtins/fetchurl.cc third_party/nix/src/libstore/references.cc third_party/nix/src/libutil/hash.cc third_party/nix/src/nix-daemon/nix-daemon.cc Change-Id: Ib9cf6e96a79a23bde3983579ced3f92e530cb011 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1547 Reviewed-by: glittershark <grfn@gws.fyi> Tested-by: BuildkiteCI
2020-07-27 r/1495 fix(3p/nix): apply all clang-tidy fixesKane York1-1/+1
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-4/+0
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-07-24 r/1457 fix(3p/nix): do not call vforkKane York1-1/+0
The use of vfork() in Nix is entirely illegal. Quote: If the process created by vfork() returns from the function in which vfork() was called, or calls any other function before successfully calling _exit() or one of the exec*() family of functions, the behavior is undefined. -- Linux man-pages, release 5.05 Add a TODO to use the higher-performance variants of clone() on Linux when it is available. Change-Id: I42370e1568ad6e2d00d70d0b66c8aded8f1288bb Reviewed-on: https://cl.tvl.fyi/c/depot/+/1418 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: Alyssa Ross <hi@alyssa.is>
2020-07-19 r/1403 fix(3p/nix): Fix all remaining compiler warningsVincent Ambo1-0/+7
This compiles under `-Wall -Werror`. The largest chunk of this change is `final` qualifiers for the various Nix CLI command structs, which inherit from a Command class that has more virtual functions than are implemented by each command. Change-Id: I0925e6e1a39013f026773db5816e4a77d50f3b4a Reviewed-on: https://cl.tvl.fyi/c/depot/+/1294 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi> Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-06-22 r/1060 fix(3p/nix): fix readTree by fixing readDir by deleting some codeLuke Granger-Brown1-7/+0
Change-Id: I4f44e6050fc5121072f4cde7758defe2dcbd4e92 Reviewed-on: https://cl.tvl.fyi/c/depot/+/552 Reviewed-by: tazjin <mail@tazj.in>
2020-05-27 r/865 refactor(3p/nix): Anchor local includes at src/Vincent Ambo1-1/+1
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-25 r/846 refactor(3p/nix): Replace tokenizeStrings with absl::StrSplitVincent Ambo1-6/+1
This function was a custom (and inefficient in the case of single-character delimiters) string splitter which was used all over the codebase. Abseil provides an appropriate replacement function.
2020-05-25 r/845 refactor(3p/nix/libutil): Replace hasPrefix/Suffix with AbseilVincent Ambo1-6/+0
Uses the equivalent absl::StartsWith and absl::EndsWith functions instead.
2020-05-25 r/843 refactor(3p/nix/libutil): Replace string2Int & trim functionsVincent Ambo1-16/+3
Replaces these functions with corresponding functions from Abseil, namely absl::StripAsciiWhitespace and absl::SimpleAtoi. In the course of doing this some minor things I encountered along the way were also refactored. This also changes the signatures of the various custom readFile functions to use absl::string_view types.
2020-05-24 r/840 style(3p/nix): Remove 'using std::*' from types.hhVincent Ambo1-38/+41
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-24 r/835 refactor(3p/nix/libutil): Replace chomp() with absl::stringsVincent Ambo1-3/+0
2020-05-20 r/789 refactor(3p/nix): Apply clang-tidy's performance-* fixesVincent Ambo1-2/+2
This applies the performance fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html
2020-05-20 r/788 refactor(3p/nix): Apply clang-tidy's readability-* fixesVincent Ambo1-2/+2
This applies the readability fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html
2020-05-20 r/787 refactor(3p/nix): Apply clang-tidy's modernize-* fixesVincent Ambo1-1/+1
This applies the modernization fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html The 'modernize-use-trailing-return-type' fix was excluded due to my personal preference (more specifically, I think the 'auto' keyword is misleading in that position).
2020-05-19 r/771 style(3p/nix): Add braces around single-line conditionalsVincent Ambo1-1/+3
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/766 style(3p/nix): Reformat all includes to match new styleVincent Ambo1-5/+7
2020-05-18 r/754 refactor(3p/nix/libutil): Replace internal logging library with glogVincent Ambo1-1/+0
2020-05-17 r/740 style(3p/nix): Reformat project in Google C++ styleVincent Ambo1-271/+219
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/+542
git-subtree-dir: third_party/nix git-subtree-mainline: cf8cd640c1adf74a3706efbcb0ea4625da106fb2 git-subtree-split: be66c7a6b24e3c3c6157fd37b86c7203d14acf10