about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/eval.cc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-07-13 r/1281 docs(3p/nix): Minor semantic correction to a commentVincent Ambo1-1/+1
Change-Id: I1cfbb7e933da54198115b28ac509b0d04870fd8f Reviewed-on: https://cl.tvl.fyi/c/depot/+/1127 Tested-by: BuildkiteCI Reviewed-by: lukegb <lukegb@tvl.fyi> Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-13 r/1280 refactor(3p/nix/libexpr): Remove the nix::Symbol default constructorVincent Ambo1-6/+13
Having a default constructor for this causes a variety of annoying situations across the codebase in which this is initialised to an unexpected value, leading to constant guarding against those conditions. It turns out there's actually no intrinsic reason that this default constructor needs to exist. The biggest one was addressed in CL/1138 and this commit cleans up the remaining bits. Change-Id: I4a847f50bc90e72f028598196592a7d8730a4e01 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1139 Reviewed-by: isomer <isomer@tvl.fyi> Tested-by: BuildkiteCI
2020-07-13 r/1278 refactor(3p/nix/libexpr): Make nix::AttrName a std::variantVincent Ambo1-13/+12
nix:AttrName was one of the few classes that relied on the default constructor of nix::Symbol (which I am trying to remove in a separate change). The class essentially represents the name of an attribute in a set, which is either just a string expression or a dynamically evaluated expression (e.g. string interpolation). Previously it would be constructed by only setting one of the fields and defaulting the other, now it is an explicit std::variant. Note that there are several code paths where not all eventualities are handled and this code is bug-for-bug compatible with those, except that unknown conditions (which should never work) are now throwing instead of silently doing ... something. The language tests pass with this change, and the depot derivations that I tested with evaluated successfully. Change-Id: Icf1ee60a5f8308f4ab18a82749e00cf37a938a8f Reviewed-on: https://cl.tvl.fyi/c/depot/+/1138 Reviewed-by: edef <edef@edef.eu> Reviewed-by: glittershark <grfn@gws.fyi> Tested-by: BuildkiteCI
2020-07-04 r/1206 chore(3p/nix/libexpr): Remove dead code from attribute setsVincent Ambo1-1/+1
These bits are no longer required with the hashmap-backed implementation of attribute sets. Change-Id: I8b936d8d438a00bad4ccf8e0b4dd719c559ce8c2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/912 Tested-by: BuildkiteCI Reviewed-by: edef <edef@edef.eu>
2020-05-27 r/865 refactor(3p/nix): Anchor local includes at src/Vincent Ambo1-10/+10
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/845 refactor(3p/nix/libutil): Replace hasPrefix/Suffix with AbseilVincent Ambo1-3/+4
Uses the equivalent absl::StartsWith and absl::EndsWith functions instead.
2020-05-24 r/840 style(3p/nix): Remove 'using std::*' from types.hhVincent Ambo1-19/+22
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-23 r/829 fix(3p/nix/libexpr): Ensure ExprOpUpdate merges into destinationVincent Ambo1-17/+5
... this fixes nixpkgs eval!
2020-05-23 r/825 docs(3p/nix/libexpr): Add some comments about function callsVincent Ambo1-4/+8
These were things that took me a moment to realise.
2020-05-23 r/821 fix(3p/nix/libexpr): Remove the global empty attribute setVincent Ambo1-4/+0
In the change to the backing structure of attribute sets, the requirement to manually balance the capacity of the structure went away. This is a) because Abseil's data structures manage this on their own, and b) because the new Bindings class is allocated using `new (GC)` rather than writing into a predefined memory area. As part of this change functions related to the capacity were deprecated and set to 0 values, which in turn caused the creation of new attribute sets to return the same (mutable!) default value in various cases, leading to "side effects" that caused evaluation failures. FWIW, I'm not sure if this optimisation had noticeable performance impact, but while untangling libexpr it definitely doesn't help trying to follow what it's doing - so bye, bye!
2020-05-23 r/820 chore(3p/nix/libexpr): Minor readability improvements in eval/valueVincent Ambo1-2/+2
2020-05-23 r/819 chore(3p/nix/libexpr): Remove unused __overrides featureVincent Ambo1-47/+11
This feature does not appear in nixpkgs, so I don't care about it. My only goal is evaluating nixpkgs.
2020-05-22 r/806 refactor(3p/nix/libexpr): Use gc_cpp to allocate Value instancesVincent Ambo1-20/+4
2020-05-22 r/805 refactor(3p/nix/libexpr): state->allocBindings -> Bindings::NewGCVincent Ambo1-2/+2
EvalState::allocBindings had little to do with Bindings, other than returning them, and didn't belong in that class.
2020-05-22 r/803 chore(3p/nix/libexpr): Delete Bindings::sortVincent Ambo1-10/+1
This function does nothing anymore since the attributes are always in-order.
2020-05-22 r/802 fix(3p/nix): Update for usage of new attribute set APIVincent Ambo1-31/+33
The new attribute set API uses the iterators of the btree_map directly. This requires changes in various files because the internals of libexpr are very entangled. This code runs and compiles, but there is a bug causing empty attribute sets to be assigned incorrectly.
2020-05-22 r/800 refactor(3p/nix/libexpr): Use absl::btree_map::merge for '//'Vincent Ambo1-22/+3
Instead of doing some sort of inline merge-sort of the two attribute sets, use the attribute sets merge function. This commit alone does not build and is not supposed to.
2020-05-21 r/799 refactor(3p/nix/libexpr): Use absl::btree_map for AttrSetsVincent Ambo1-6/+10
This is the first step towards replacing the implementation of attribute sets with an absl::btree_map. Currently many access are done using array offsets and pointer arithmetic, so this change is currently causing Nix to fail in various ways.
2020-05-21 r/797 refactor(3p/nix/libexpr): Use std::string as qualified typeVincent Ambo1-29/+34
Replaces most uses of `string` with `std::string`. This came up because I removed the "types.hh" import from "symbol-table.hh", which percolated through a bunch of files where `string` was suddenly no longer defined ... *sigh*
2020-05-21 r/795 fix(3p/nix): Compatibility with updated SymbolTableVincent Ambo1-38/+39
The functions in SymbolTable have been renamed to match the Google Style guide, and some debug-only functions have been removed.
2020-05-20 r/789 refactor(3p/nix): Apply clang-tidy's performance-* fixesVincent Ambo1-1/+1
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-43/+45
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-12/+13
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/777 style(3p/nix): Final act in the brace-wrapping sagaVincent Ambo1-55/+100
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/772 style(3p/nix): Add braces around single-line for-loopsVincent Ambo1-9/+27
These were not caught by the previous clang-tidy invocation, but were instead sorted out using amber[0] as such: ambr --regex 'for (\(.+\))\s([a-z].*;)' 'for $1 { $2 }' [0]: https://github.com/dalance/amber
2020-05-19 r/771 style(3p/nix): Add braces around single-line conditionalsVincent Ambo1-33/+99
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/768 fix(3p/nix): Fix incorrectly braced conditionals and loopsVincent Ambo1-12/+6
Fixes mistakes introduced by clang-tidy in the previous commit.
2020-05-19 r/767 style(3p/nix): Enforce braces around loops and conditionalsVincent Ambo1-49/+105
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-4/+7
2020-05-19 r/760 style(3p/nix/libexpr): Reformat with clang-formatVincent Ambo1-1/+1
2020-05-19 r/758 refactor(3p/nix/libexpr): Replace logging.h with glogVincent Ambo1-5/+5
2020-05-17 r/740 style(3p/nix): Reformat project in Google C++ styleVincent Ambo1-1604/+1461
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/+1991
git-subtree-dir: third_party/nix git-subtree-mainline: cf8cd640c1adf74a3706efbcb0ea4625da106fb2 git-subtree-split: be66c7a6b24e3c3c6157fd37b86c7203d14acf10