aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
AgeCommit message (Collapse)Author
2023-01-02Merge pull request #5941 from hercules-ci/optimize-intersectAttrsThéophane Hufschmitt
Optimize intersectAttrs performance
2023-01-02antiquotation -> string interpolationValentin Gagarin
as proposed by @mkaito[1] and @tazjin[2] and discussed with @edolstra and Nix maintainers [1]: https://github.com/NixOS/nix.dev/pull/267#issuecomment-1270076332 [2]: https://github.com/NixOS/nix.dev/pull/267#issuecomment-1270201979 Co-authored-by: John Ericson <git@JohnEricson.me> Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2023-01-02Merge pull request #7478 from hercules-ci/make-sure-initNix-calledThéophane Hufschmitt
libstore: Make sure that initNix has been called
2023-01-02Merge pull request #7351 from NaN-git/fix-mkStringThéophane Hufschmitt
cleanup eval.hh/eval.cc
2022-12-24Optimize intersectAttrs performanceRobert Hensing
Always traverse the shortest set.
2022-12-24libstore: Make sure that initNix has been calledRobert Hensing
Prevent bugs like https://github.com/cachix/cachix/pull/477
2022-12-24remove undefined functionPhilipp Otterbein
2022-12-24remove function makeImmutableStringWithLenPhilipp Otterbein
2022-12-21primops `storeDir` test uses `settings.nixStore`mupdt
2022-12-20EvalState::copyPathToStore(): Return a StorePathEelco Dolstra
2022-12-20Merge pull request #7451 from edolstra/abstract-posEelco Dolstra
Introduce AbstractPos
2022-12-16printMsg replacement by printInfoSolène Rapenne
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-12-14warnings: switch to info level when using a saved substituterSolène Rapenne
2022-12-13Restore display of source lines for stdin/string inputsEelco Dolstra
2022-12-13Fix compilationEelco Dolstra
2022-12-13Improve cast safetyEelco Dolstra
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-12-13Merge pull request #6741 from Mindavi/nix-no-gcThéophane Hufschmitt
support building with --enable-gc=no
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-12support building with --enable-gc=noRick van Schijndel
Some minor changes fixing the build without boehm. Fixes NixOS#6250
2022-12-12Fix stack context notes to not rely on orderJohn Ericson
Make everything be in the form "while ..." (most things were already), and in particular *don't* use other propositions that must go after or before specific "while ..." clauses to make sense.
2022-12-12Support flake references in the old CLIEelco Dolstra
Fixes #7026.
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-12-12Use get_ptr()Eelco Dolstra
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-12-12Update URLEelco Dolstra
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-12-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-12-02Merge pull request #7395 from obsidiansystems/evaluating-to-callingEelco Dolstra
Change "while evaluating <fun>" to "while *calling*" in trace
2022-12-02Change "while evaluating <fun>" to "while *calling*" in traceJohn Ericson
The old way was not correct. Here is an example: ``` $ nix-instantiate --eval --expr 'let x = a: throw "asdf"; in x 1' --show-trace error: asdf … while evaluating 'x' at «string»:1:9: 1| let x = a: throw "asdf"; in x 1 | ^ … from call site at «string»:1:29: 1| let x = a: throw "asdf"; in x 1 | ^ ``` and yet also: ``` $ nix-instantiate --eval --expr 'let x = a: throw "asdf"; in x' --show-trace <LAMBDA> ``` Here is the thing: in both cases we are evaluating `x`! Nix is a higher-order languages, and functions are a sort of value. When we write `x = a: ...`, `a: ...` is the expression that `x` is being defined to be, and that is already a value. Therefore, we should *never* get an trace that says "while evaluating `x`", because evaluating `a: ...` is *trival* and nothing happens during it! What is actually happening here is we are applying `x` and evaluating its *body* with arguments substituted for parameters. I think the simplest way to say is just "while *calling* `x`", and so that is what I changed it to.
2022-12-01doc: listToAttrs: add extra whitespaceAlex Ameen
2022-11-30doc: listToAttrs: fix line wrappingAlex Ameen
2022-11-30doc: listToAttrs: document repeated keysAlex Ameen
2022-11-28Merge pull request #7313 from yorickvP/nlohmann-everywhereEelco Dolstra
Replace src/libutil/json.cc with nlohmann
2022-11-25Don't use GC_STRNDUPEelco Dolstra
It calls strlen() on the input (rather than simply copying at most `size` bytes), which can fail if the input is not zero-terminated and is inefficient in any case. Fixes #7347.
2022-11-16Replace src/libutil/json.cc with nlohmann json generationYorick van Pelt
2022-11-14Merge remote-tracking branch 'nixos/master' into readFile-scan-referencesThéophane Hufschmitt
2022-11-11Restrict `readFile` context to references that appear in the stringNaïm Favier
When calling `builtins.readFile` on a store path, the references of that path are currently added to the resulting string's context. This change makes those references the *possible* context of the string, but filters them to keep only the references whose hash actually appears in the string, similarly to what is done for determining the runtime references of a path.
2022-11-10Merge pull request #7258 from ncfavier/fix-eval-error-fmtThéophane Hufschmitt
Fix printing of eval errors with two format placeholders
2022-11-04Fix printing of eval errors with two format placeholdersNaïm Favier
2022-10-25Use _typeEelco Dolstra
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2022-10-25Complete genericClosure testsGuillaume Maudoux
2022-10-25Rework error throwing, and test itGuillaume Maudoux
2022-10-23Mark flakes with .type = "flake".Shea Levy
Fixes #7186
2022-10-23Try to please clang with convoluted templatesGuillaume Maudoux
2022-10-22Introduce an Error builder to tackle complexityGuillaume Maudoux
2022-10-22Build with C++20Graham Bennett
2022-10-20Rollback unneeded throwFrameErrorWithTrace functionGuillaume Maudoux
2022-10-20Fix context message being printed twice with forceStringNoCtxGuillaume Maudoux
2022-10-20Reword incomparable types messageGuillaume Maudoux
2022-10-20Revert custom position of 'if' blocksGuillaume Maudoux
2022-10-17Initial frames supportGuillaume Maudoux
2022-10-16Merge remote-tracking branch 'origin/master' into coerce-stringGuillaume Maudoux