aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
AgeCommit message (Collapse)Author
2023-02-28Merge pull request #7911 from edolstra/revert-7689Eelco Dolstra
Revert #7689
2023-02-27Merge pull request #7776 from yorickvP/fix-path-escapes-7707Théophane Hufschmitt
Properly escape local paths into URLs in fetchTree
2023-02-27fetchTree: convert fs path to url via ParsedURL::to_stringYorick van Pelt
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-02-22flakes: Differentiate `self.outPath` and `self.sourceInfo.outPath`Robert Hensing
It would be incorrect to say that the `sourceInfo` has an `outPath` that isn't the root. `sourceInfo` is about the root, whereas only the flake may not be about the root. Thanks Eelco for pointing that out.
2023-02-22flakes: Ensure that `self.outPath == ./.`Robert Hensing
Users expect `self` to refer to the directory where the `flake.nix` file resides.
2023-02-19Merge pull request #7158 from sternenseemann/foldl-strict-accumulation-valueValentin Gagarin
2023-02-16ExprOpHasAttr,ExprSelect,stripIndentation,binds,formals: delete losts objectsEt7f3
We are looking for *$ because it indicate that it was constructed with a new but not release. De-referencing shallow copy so deleting as whole might create dangling pointer that's why we move it so we delete a empty containers + the nice perf boost.
2023-02-12ExprString: Avoid copy of stringEt7f3
2023-02-12parser: use implicit ruleEt7f3
2023-02-10Fix building with GCC 9Eelco Dolstra
Nixpkgs on aarch64-linux is currently stuck on GCC 9 (https://github.com/NixOS/nixpkgs/issues/208412) and using gcc11Stdenv doesn't work either. So use c++2a instead of c++20 for now. Unfortunately this means we can't use some C++20 features for now (like std::span).
2023-02-10Merge pull request #5588 from tweag/balsoft/xdgThéophane Hufschmitt
Follow XDG Base Directory standard
2023-02-10A setting to follow XDG Base Directory standardAlexander Bantyev
XDG Base Directory is a standard for locations for storing various files. Nix has a few files which seem to fit in the standard, but currently use a custom location directly in the user's ~, polluting it: - ~/.nix-profile - ~/.nix-defexpr - ~/.nix-channels This commit adds a config option (use-xdg-base-directories) to follow the XDG spec and instead use the following locations: - $XDG_STATE_HOME/nix/profile - $XDG_STATE_HOME/nix/defexpr - $XDG_STATE_HOME/nix/channels If $XDG_STATE_HOME is not set, it is assumed to be ~/.local/state. Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com> Co-authored-by: Tim Fenney <kodekata@gmail.com> Co-authored-by: pasqui23 <pasqui23@users.noreply.github.com> Co-authored-by: Artturin <Artturin@artturin.com> Co-authored-by: John Ericson <Ericson2314@Yahoo.com>
2023-02-08Documentation: builtins.fetchGit when used on a local path (#7706)Joachim Breitner
* Documentation: builtins.fetchGit when used on a local path Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-02-01Fix clang compilationEelco Dolstra
2023-02-01Merge pull request #7203 from graham33/feature/cpp20Eelco Dolstra
Proposal: Use C++20
2023-01-30Merge pull request #7713 from obsidiansystems/more-rapid-checkRobert Hensing
Add more property tests
2023-01-30Make per-variant Arbitrary impls tooJohn Ericson
This is a nice idea that @roberth requested. If we could factor our a generic `std::variant` impl as a follow-up it would be even better!
2023-01-29More property testsJohn Ericson
Also put proper comparison methods on `DerivedPath` and `NixStringContextElem`, which is needed for the tests but good in general.
2023-01-29Allow unit test infra to be reused across libs' testsJohn Ericson
This allows using Arbitrary "instances" defined in libstore-tests in libexpr-tests, something we will leverage in a moment.
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-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>