aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.hh
AgeCommit message (Collapse)Author
2023-04-07Finish converting existing comments for internal API docs (#8146)John Ericson
* Finish converting existing comments for internal API docs 99% of this was just reformatting existing comments. Only two exceptions: - Expanded upon `BuildResult::status` compat note - Split up file-level `symbol-table.hh` doc comments to get per-definition docs Also fixed a few whitespace goofs, turning leading tabs to spaces and removing trailing spaces. Picking up from #8133 * Fix two things from comments * Use triple-backtick not indent for `dumpPath` * Convert GNU-style `\`..'` quotes to markdown style in API docs This will render correctly.
2023-04-06Origin: Use SourcePathEelco Dolstra
2023-04-06Backport SourcePath from the lazy-trees branchEelco Dolstra
This introduces the SourcePath type from lazy-trees as an abstraction for accessing files from inputs that may not be materialized in the real filesystem (e.g. Git repositories). Currently, however, it's just a wrapper around CanonPath, so it shouldn't change any behaviour. (On lazy-trees, SourcePath is a <InputAccessor, CanonPath> tuple.)
2023-03-31Ensure all headers have `#pragma once` and are in API docsJohn Ericson
`///@file` makes them show up in the internal API dos. A tiny few were missing `#pragma once`.
2023-02-27Revert "getDefaultNixPath: actually respect `{restrict,pure}-eval`"Eelco Dolstra
This reverts commit 1cba5984a68a489c4a56691032e4c87991c678f4.
2023-02-27Revert "Document default `nix-path` value"Eelco Dolstra
This reverts commit dba9173a1d8cb1dd40e5922d009cb3a434e081c3.
2023-01-27Document default `nix-path` valueNaïm Favier
2023-01-27getDefaultNixPath: actually respect `{restrict,pure}-eval`Naïm Favier
Previously, getDefaultNixPath was called too early: at initialisation time, before CLI and config have been processed, when `restrictEval` and `pureEval` both have their default value `false`. Call it when initialising the EvalState instead, and use `setDefault`.
2023-01-19Discuss re-entrant errors and designGuillaume Maudoux
2023-01-19Add tests for error traces, and fixesGuillaume Maudoux
2023-01-19Revert "Revert "Merge pull request #6204 from layus/coerce-string""Guillaume Maudoux
This reverts commit 9b33ef3879a764bed4cc2404a08344c3a697a646.
2023-01-18Revert "Merge pull request #6204 from layus/coerce-string"Robert Hensing
This reverts commit a75b7ba30f1e4f8b15e810fd18e63ee9552e0815, reversing changes made to 9af16c5f742300e831a2cc400e43df1e22f87f31.
2023-01-10Parse string context elements properlyJohn Ericson
Prior to this change, we had a bunch of ad-hoc string manipulation code scattered around. This made it hard to figure out what data model for string contexts is. Now, we still store string contexts most of the time as encoded strings --- I was wary of the performance implications of changing that --- but whenever we parse them we do so only through the `NixStringContextElem::parse` method, which handles all cases. This creates a data type that is very similar to `DerivedPath` but: - Represents the funky `=<drvpath>` case as properly distinct from the others. - Only encodes a single output, no wildcards and no set, for the "built" case. (I would like to deprecate `=<path>`, after which we are in spitting distance of `DerivedPath` and could maybe get away with fewer types, but that is another topic for another day.)
2023-01-10Merge remote-tracking branch 'origin/master' into fix-7417Eelco Dolstra
2023-01-02Merge remote-tracking branch 'origin/master' into coerce-stringEelco Dolstra
2023-01-02Merge pull request #7351 from NaN-git/fix-mkStringThéophane Hufschmitt
cleanup eval.hh/eval.cc
2022-12-24remove undefined functionPhilipp Otterbein
2022-12-20EvalState::copyPathToStore(): Return a StorePathEelco Dolstra
2022-12-13Introduce AbstractPosEelco Dolstra
This makes the position object used in exceptions abstract, with a method getSource() to get the source code of the file in which the error originated. This is needed for lazy trees because source files don't necessarily exist in the filesystem, and we don't want to make libutil depend on the InputAccessor type in libfetcher.
2022-12-12Move isUri() and resolveUri() out of filetransfer.ccEelco Dolstra
These are purely related to NIX_PATH / -I command line parsing, so put them in libexpr.
2022-10-25Rework error throwing, and test itGuillaume Maudoux
2022-10-23Try to please clang with convoluted templatesGuillaume Maudoux
2022-10-22Introduce an Error builder to tackle complexityGuillaume Maudoux
2022-10-20Rollback unneeded throwFrameErrorWithTrace functionGuillaume Maudoux
2022-10-17Initial frames supportGuillaume Maudoux
2022-09-11Cleanup error strings rebaseGuillaume Maudoux
2022-09-07WIP: broken merge but need a git checkpointGuillaume Maudoux
2022-07-11Merge branch 'master' into ignore-tryBen Burdette
2022-07-11move ignore-try to EvalSettingsBen Burdette
2022-07-05Add builtins.traceVerboseGytis Ivaskevicius
Co-Authored-By: Silvan Mosberger <contact@infinisil.com> Add builtins.traceVerbose tests
2022-06-02Shut up clang warningsEelco Dolstra
2022-06-02print message with exceptions in a try clauseBen Burdette
2022-06-02ignore-try flagBen Burdette
2022-05-30Respect the outputSpecified attributeEelco Dolstra
E.g. 'nix build nixpkgs#libxml2.dev' will build the 'dev' output.
2022-05-26Remove pre-C++11 hackinessEelco Dolstra
2022-05-25back to ref<EvalState> in NixReplBen Burdette
2022-05-25Style tweaksEelco Dolstra
2022-05-22remove redundant 'debugMode' flagBen Burdette
2022-05-20debugRepl ftn pointerBen Burdette
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-16first whack at passing evalState as an arg to debuggerHook.Ben Burdette
2022-05-12Merge branch 'debugThrow' into debug-exploratory-PRBen Burdette
2022-05-12template-ize debugThrowBen Burdette
2022-05-09Merge branch 'master' into debug-exploratory-PRBen Burdette
2022-05-06Add unit tests for libexpr (#5377)Andreas Rammhold
* libexpr: fix builtins.split example The example was previously indicating that multiple whitespaces would be collapsed into a single captured whitespace. That isn't true and was likely a mistake when being documented initially. * Fix segfault on unitilized list when printing value Since lists are just chunks of memory the individual elements in the list might be unitilized when a programming error happens within Nix. In this case the values are null-initialized (at least with Boehm GC) and we can avoid a nullptr deref when printing them. I ran into this issue while ensuring that new expression tests would show the actual value on an assertion failure. This is unlikely to cause any runtime performance regressions as printing values is not really in the hot path (unless the repl is the primary use case). * Add operator<< for ValueTypes * Add libexpr tests This introduces tests for libexpr that evalulate various trivial Nix language expressions and primop invocations that should be good smoke tests wheter or not the implementation is behaving as expected.
2022-05-06debugError()Ben Burdette
2022-05-06trying debugThrowBen Burdette