aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
AgeCommit message (Collapse)Author
2023-01-23Merge pull request #7447 from aakropotkin/read-file-typeRobert Hensing
Read file type
2023-01-23Merge pull request #7657 from obsidiansystems/fix-7655Robert Hensing
Fix #7655
2023-01-22primop: add readFileType, optimize readDirAlex Ameen
Allows checking directory entry type of a single file/directory. This was added to optimize the use of `builtins.readDir` on some filesystems and operating systems which cannot detect this information using POSIX's `readdir`. Previously `builtins.readDir` would eagerly use system calls to lookup these filetypes using other interfaces; this change makes these operations lazy in the attribute values for each file with application of `builtins.readFileType`.
2023-01-21Fix #7655John Ericson
We had some local variables left over from the older (more complicated) implementation of this function. They should all be unused, but one wasn't by mistake. Delete them all, and replace the one that was still in use as intended.
2023-01-20Use complete '__toString' attribute nameGuillaume Maudoux
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-01-19Always display addErrorContext messages in (expanded) tracesGuillaume Maudoux
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-18Restore support for channel: URLs in fetchTarballEelco Dolstra
Fixes #7625.
2023-01-18Revert "Merge pull request #6204 from layus/coerce-string"Robert Hensing
This reverts commit a75b7ba30f1e4f8b15e810fd18e63ee9552e0815, reversing changes made to 9af16c5f742300e831a2cc400e43df1e22f87f31.
2023-01-11Split `OutputsSpec` and `ExtendedOutputsSpec`, use the former moreJohn Ericson
`DerivedPath::Built` and `DerivationGoal` were previously using a regular set with the convention that the empty set means all outputs. But it is easy to forget about this rule when processing those sets. Using `OutputSpec` forces us to get it right.
2023-01-11Rename `OutputPath` -> `ExtendedOutputPath`John Ericson
Do this prior to making a new more limitted `OutputPath` we will use in more places.
2023-01-11Improve `OutputsSpec` slightlyJohn Ericson
A few little changes preparing for the rest.
2023-01-11Merge pull request #7543 from obsidiansystems/typed-string-contextThéophane Hufschmitt
Parse string context elements properly
2023-01-10Merge pull request #7541 from hercules-ci/check-manual-linksRobert Hensing
Check links in the manual
2023-01-10doc/manual: Apply suggestions from code reviewRobert Hensing
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-01-10doc/manual: Fix broken internal linksRobert Hensing
The targets I could find.
2023-01-10doc/manual: Introduce @docroot@ as a stable base for includable snippetsRobert Hensing
This way the links are clearly within the manual (ie not absolute paths), while allowing snippets to reference the documentation root reliably, regardless of at which base url they're included.
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-10Make clear that `StorePathWithOutputs` is a deprecated typeJohn Ericson
- Add a comment - Put `OutputsSpec` in a different header (First part of #6815) - Make a few stray uses of it in new code use `DerivedPath` instead.
2023-01-10Merge remote-tracking branch 'origin/master' into fix-7417Eelco Dolstra
2023-01-06Fix typo in example for builtin function mapWill Bush
2023-01-02Don't use state.positions[noPos]Eelco Dolstra
This caused traces 'at «none»:0: (source not available)'.
2023-01-02Merge remote-tracking branch 'origin/master' into coerce-stringEelco Dolstra
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