aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval-cache.cc
AgeCommit message (Collapse)Author
2023-01-02Merge remote-tracking branch 'origin/master' into coerce-stringEelco Dolstra
2022-12-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-10-25Rework error throwing, and test itGuillaume Maudoux
2022-10-22Introduce an Error builder to tackle complexityGuillaume Maudoux
2022-09-11fix remaining foo stuffGuillaume Maudoux
2022-09-11Cleanup error strings rebaseGuillaume Maudoux
2022-09-07WIP: broken merge but need a git checkpointGuillaume Maudoux
2022-08-24Fix evaluation cacheEelco Dolstra
98e361ad4c1a26d4ffe4762a6f33bb9e39321a39 introduced a regression where previously stored attributes were replaced by placeholders. As a result, a command like 'nix build nixpkgs#hello' had to be executed at least twice to get caching. This code does not seem necessary for suggestions to work.
2022-07-12Fix debug messageEelco Dolstra
2022-06-23eval-cache: cast rowId to correct typeRick van Schijndel
Prevents errors when running with UBSan: /nix/store/j5vhrywqmz1ixwhsmmjjxa85fpwryzh0-gcc-11.3.0/include/c++/11.3.0/bits/stl_pair.h:353:4: runtime error: load of value 229, which is not a valid value for type 'AttrType'
2022-05-25Merge branch 'master' into debug-exploratory-PRBen Burdette
2022-05-25Style tweaksEelco Dolstra
2022-05-16Make nix::eval_cache::int_t more idiomaticThéophane Hufschmitt
Don’t explicitely give it a constructor, but use aggregate initialization instead (also prevents having an implicit coertion, which is probably good here)
2022-05-16resolve redundant priority passing, wrap NixInt in eval-cache variantEli Kogan-Wang
2022-05-16Add int to eval-cache, bump eval cache schema versionEli Kogan-Wang
2022-05-13Integrate review changesEli Kogan-Wang
2022-05-06trying debugThrowBen Burdette
2022-05-05Merge branch 'NixOS:master' into debug-exploratory-PRBen Burdette
2022-05-04Add forgotten null checkAlexander Shpilkin
2022-05-04Merge remote-tracking branch 'origin/master' into debug-exploratory-PREelco Dolstra
2022-04-29Merge remote-tracking branch 'origin/master' into coerce-stringGuillaume Maudoux
2022-04-28Merge branch 'master' into debug-merge-masterBen Burdette
2022-04-28fix errors case and wordingGuillaume Maudoux
2022-04-26Bump eval cache schema versionEelco Dolstra
2022-04-26nix: Respect meta.outputsToInstall, and use all outputs by defaultEelco Dolstra
'nix profile install' will now install all outputs listed in the package's meta.outputsToInstall attribute, or all outputs if that attribute doesn't exist. This makes it behave consistently with nix-env. Fixes #6385. Furthermore, for consistency, all other 'nix' commands do this as well. E.g. 'nix build' will build and symlink the outputs in meta.outputsToInstall, defaulting to all outputs. Previously, it only built/symlinked the first output. Note that this means that selecting a specific output using attrpath selection (e.g. 'nix build nixpkgs#libxml2.dev') no longer works. A subsequent PR will add a way to specify the desired outputs explicitly.
2022-04-26EvalCache AttrKey: Use Symbol instead of std::stringEelco Dolstra
2022-04-26EvalCache: Revert to using symbols in getAttr()Eelco Dolstra
2022-04-25rename SymbolIdx -> Symbol, Symbol -> SymbolStrpennae
after #6218 `Symbol` no longer confers a uniqueness invariant on the string it wraps, it is now possible to create multiple symbols that compare equal but whose string contents have different addresses. this guarantee is now only provided by `SymbolIdx`, leaving `Symbol` only as a string wrapper that knows about the intricacies of how symbols need to be formatted for output. this change renames `SymbolIdx` to `Symbol` to restore the previous semantics of `Symbol` to that name. we also keep the wrapper type and rename it to `SymbolStr` instead of returning plain strings from lookups into the symbol table because symbols are formatted for output in many places. theoretically we do not need `SymbolStr`, only a function that formats a string for output as a symbol, but having to wrap every symbol that appears in a message into eg `formatSymbol()` is error-prone and inconvient.
2022-04-21store Symbols in a table as well, like positionspennae
this slightly increases the amount of memory used for any given symbol, but this increase is more than made up for if the symbol is referenced more than once in the EvalState that holds it. on average every symbol should be referenced at least twice (once to introduce a binding, once to use it), so we expect no increase in memory on average. symbol tables are limited to 2³² entries like position tables, and similar arguments apply to why overflow is not likely: 2³² symbols would require as many string instances (at 24 bytes each) and map entries (at 24 bytes or more each, assuming that the map holds on average at most one item per bucket as the docs say). a full symbol table would require at least 192GB of memory just for symbols, which is well out of reach. (an ofborg eval of nixpks today creates less than a million symbols!)
2022-04-14Make InstallableFlake::toValue() and toDerivation() behave consistentlyEelco Dolstra
In particular, this means that 'nix eval` (which uses toValue()) no longer auto-calls functions or functors (because AttrCursor::findAlongAttrPath() doesn't). Fixes #6152. Also use ref<> in a few places, and don't return attrpaths from getCursor() because cursors already have a getAttrPath() method.
2022-04-08move throw to preverve Error type; turn off debugger for tryEvalBen Burdette
2022-04-07Merge remote-tracking branch 'upstream/master' into upstream-mergeBen Burdette
2022-03-18Decode string context straight to using `StorePath`sJohn Ericson
I gather decoding happens on demand, so I hope don't think this should have any perf implications one way or the other.
2022-03-18Merge remote-tracking branch 'origin/master' into coerce-stringGuillaume Maudoux
2022-03-18Revert extra colon at end os stringsGuillaume Maudoux
2022-03-14more debug_throw coverage of EvalErrorsBen Burdette
2022-03-11Create some type aliases for string ContextsJohn Ericson
2022-03-07more fixesGuillaume Maudoux
2022-03-07Also display suggestions for the commands using the eval cacheregnat
Make `nix build .#nix-armv8l-linux` work for example
2022-03-04Add error context for most basic coercionsGuillaume Maudoux
2022-02-25Remove std::string alias (for real this time)Eelco Dolstra
Also use std::string_view in a few more places.
2022-01-21determinePos: remove from critical pathKevin Amado
2022-01-21forceAttrs: make pos mandatoryKevin Amado
2022-01-21forceValue: make pos mandatoryKevin Amado
- Make passing the position to `forceValue` mandatory, this way we remember people that the position is important for better error messages - Add pos to all `forceValue` calls
2021-04-19libcmd/installables: force re-evaluation of cached failuresMaximilian Bosch
I think that it's not very helpful to get "cached failures" in a wrong `flake.nix`. This can be very confusing when debugging a Nix expression. See for instance NixOS/nixpkgs#118115. In fact, the eval cache allows a forced reevaluation which is used for e.g. `nix eval`. This change makes sure that this is the case for `nix build` as well. So rather than λ ma27 [~/Projects/exp] → ../nix/outputs/out/bin/nix build -L --rebuild --experimental-features 'nix-command flakes' error: cached failure of attribute 'defaultPackage.x86_64-linux' the evaluation of already-evaluated (and failed) attributes looks like this now: λ ma27 [~/Projects/exp] → ../nix/outputs/out/bin/nix build -L --rebuild --experimental-features 'nix-command flakes' error: attribute 'hell' missing at /nix/store/mrnvi9ss8zn5wj6gpn4bcd68vbh42mfh-source/flake.nix:6:35: 5| 6| packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hell; | ^ 7| (use '--show-trace' to show detailed location information)
2020-12-28FixupMatthew Bauer
2020-12-24Merge branch 'master' into support-libcxx10Matthew Bauer
2020-12-23Cast variants fully for libc++10Matthew Bauer
libc++10 seems to be stricter on what it allows in variant conversion. I'm not sure what the rules are here, but this is the minimal change needed to get through the compilation errors.
2020-12-17Rename Value::normalType() -> Value::type()Silvan Mosberger
2020-12-12Use Value::normalType on all forced values instead of Value::typeSilvan Mosberger