aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd
AgeCommit message (Collapse)Author
2022-05-25Style tweaksEelco Dolstra
2022-05-23commentBen Burdette
2022-05-22remove redundant 'debugMode' flagBen Burdette
2022-05-22commentsBen Burdette
2022-05-22change state derefsBen Burdette
2022-05-22changning repl to use EvalState& instead of refBen Burdette
2022-05-20debugRepl ftn pointerBen Burdette
2022-05-20Apply suggestions from code reviewtomberek
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2022-05-19'debugMode'Ben Burdette
2022-05-19de-const evalState exceptionsBen Burdette
2022-05-19Merge branch 'debug-exploratory-PR' into debuggerHook-eval-argBen Burdette
2022-05-19use an expr->StaticEnv table in evalStateBen Burdette
2022-05-18repl: provide backward compat with legacy usageTom Bereknyei
2022-05-18repl: use installablesTom Bereknyei
2022-05-18repl: allow loading installables from CLITom Bereknyei
repl: search installable with findAlongAttrPath repl: refactor handling of args repl: temp
2022-05-16first whack at passing evalState as an arg to debuggerHook.Ben Burdette
2022-05-16resolve redundant priority passing, wrap NixInt in eval-cache variantEli Kogan-Wang
2022-05-15remove extra argumentBen Burdette
2022-05-13Integrate review changesEli Kogan-Wang
2022-05-12Use `^` not `!` in indexed store derivations installable syntaxJohn Ericson
Match the other syntax that was recently added
2022-05-12Merge remote-tracking branch 'upstream/master' into indexed-store-path-outputsJohn Ericson
2022-05-09Merge branch 'master' into debug-exploratory-PRBen Burdette
2022-05-06renderMarkdownToTerminal(): Avoid line overflowEelco Dolstra
Lowdown doesn't respect '.cols' exactly (maybe because of the whitespace in front of each line), so adjust .cols a bit.
2022-05-05fix repl bugBen Burdette
2022-05-05traceable_allocatorBen Burdette
2022-05-05rename debug commands to be more gdb-like; hide them except in debug modeBen Burdette
2022-05-05Style fixesEelco Dolstra
In particular, use std::make_shared and enumerate(). Also renamed some fields to fit naming conventions.
2022-05-04Merge remote-tracking branch 'origin/master' into debug-exploratory-PREelco Dolstra
2022-05-04Get rid of most `.at` calls (#6393)Alain Zscheile
Use one of `get` or `getOr` instead which will either return a null-pointer (with a nicer error message) or a default value when the key is missing.
2022-05-03Allow selecting derivation outputs using 'installable!outputs'Eelco Dolstra
E.g. 'nixpkgs#glibc^dev,static' or 'nixpkgs#glibc^*'.
2022-04-29remove 'libnix'Ben Burdette
2022-04-29line endingsBen Burdette
2022-04-29incorporate PosIdx changes, symbol changes.Ben Burdette
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-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: 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-21replace most Pos objects/ptrs with indexes into a position tablepennae
Pos objects are somewhat wasteful as they duplicate the origin file name and input type for each object. on files that produce more than one Pos when parsed this a sizeable waste of memory (one pointer per Pos). the same goes for ptr<Pos> on 64 bit machines: parsing enough source to require 8 bytes to locate a position would need at least 8GB of input and 64GB of expression memory. it's not likely that we'll hit that any time soon, so we can use a uint32_t index to locate positions instead.
2022-04-21don't use full Pos for findPackageFilename/editorForpennae
only file and line of the returned position were ever used, it wasn't actually used a position. as such we may as well use a path+int pair for only those two values and remove a use of Pos that would not work well with a position table.
2022-04-21Fix the error message in case of a missing realisationThéophane Hufschmitt
Don’t say that the derivation is CA as it might happen on a non-ca derivation too. Technically we could always recover _something_ for a purely input-addressed derivation (like we already do when the `ca-derivations` xp feature isn’t enabled), but it seems better to consistently fail − the end-result wouldn’t really make sense anyways in most cases.
2022-04-19Merge remote-tracking branch 'upstream/master' into indexed-store-path-outputsJohn Ericson
2022-04-19Merge pull request #6128 from ncfavier/fix-completionEelco Dolstra
Shell completion improvements
2022-04-19Merge pull request #6404 from edolstra/unify-flake-attr-evalEelco Dolstra
Make InstallableFlake::toValue() and toDerivation() behave consistently
2022-04-15Merge branch 'master' into debug-exploratory-PRBen Burdette
2022-04-15Merge pull request #6323 from erikarvstedt/eval-read-onlyEelco Dolstra
`nix eval`: Add option `--read-only`
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-08revise command helpBen Burdette