aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops
AgeCommit message (Collapse)Author
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-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-14Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
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-06Use named field initialization for referencesJohn Ericson
2023-01-06Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2023-01-02Merge remote-tracking branch 'origin/master' into coerce-stringEelco Dolstra
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-09-07WIP: broken merge but need a git checkpointGuillaume Maudoux
2022-06-26fetchGit: document `shallow` argumentGuillaume Girol
2022-05-25Style tweaksEelco Dolstra
2022-05-06trying debugThrowBen 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-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-19Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2022-04-08minor cleanupBen Burdette
2022-04-08move throw to preverve Error type; turn off debugger for tryEvalBen Burdette
2022-04-07Merge remote-tracking branch 'upstream/master' into upstream-mergeBen Burdette
2022-04-06fetchClosure: Don't allow URL query parametersEelco Dolstra
Allowing this is a potential security hole, since it allows the user to specify parameters like 'local-nar-cache'.
2022-03-25Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2022-03-25Only provide builtin.{getFlake,fetchClosure} is the corresponding ↵Eelco Dolstra
experimental feature is enabled This allows writing fallback code like if builtins ? fetchClosure then builtins.fetchClose { ... } else builtins.storePath ...
2022-03-24Add experimental feature 'fetch-closure'Eelco Dolstra
2022-03-24nix store make-content-addressed: Support --from / --toEelco Dolstra
2022-03-24Document fetchClosureEelco Dolstra
2022-03-24Add a test for fetchClosure and 'nix store make-content-addressed'Eelco Dolstra
2022-03-24fetchClosure: Only allow some "safe" store typesEelco Dolstra
2022-03-24fetchClosure: Skip makeContentAddressed() if toPath is already validEelco Dolstra
2022-03-24fetchClosure: Allow a path to be rewritten to CA on the flyEelco Dolstra
The advantage is that the resulting closure doesn't need to be signed, so you don't need to configure any binary cache keys on the client.
2022-03-24RenameEelco Dolstra
2022-03-24fetchClosure: Require a CA path in pure modeEelco Dolstra
2022-03-24Add builtins.fetchClosureEelco Dolstra
This allows closures to be imported at evaluation time, without requiring the user to configure substituters. E.g. builtins.fetchClosure { storePath = /nix/store/f89g6yi63m1ywfxj96whv5sxsm74w5ka-python3.9-sqlparse-0.4.2; from = "https://cache.ngi0.nixos.org"; }
2022-03-22Merge pull request #6237 from obsidiansystems/store-path-string-contextEelco Dolstra
Decode string context straight to using StorePaths
2022-03-18Decode string context straight to using `StorePath`sJohn Ericson
I gather decoding happens on demand, so I hope don't think this should have any perf implications one way or the other.
2022-03-18Revert extra colon at end os stringsGuillaume Maudoux
2022-03-17Clean up `DerivationOutput`, and headersJohn Ericson
1. `DerivationOutput` now as the `std::variant` as a base class. And the variants are given hierarchical names under `DerivationOutput`. In 8e0d0689be797f9e42f9b43b06f50c1af7f20b4a @matthewbauer and I didn't know a better idiom, and so we made it a field. But this sort of "newtype" is anoying for literals downstream. Since then we leaned the base class, inherit the constructors trick, e.g. used in `DerivedPath`. Switching to use that makes this more ergonomic, and consistent. 2. `store-api.hh` and `derivations.hh` are now independent. In bcde5456cc3295061a0726881c3e441444dd6680 I swapped the dependency, but I now know it is better to just keep on using incomplete types as much as possible for faster compilation and good separation of concerns.
2022-03-14more debug_throw coverage of EvalErrorsBen Burdette
2022-03-11Create some type aliases for string ContextsJohn Ericson
2022-03-10Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2022-03-07more fixesGuillaume Maudoux
2022-03-04Add detailed error mesage for coerceTo{String,Path}Guillaume Maudoux
2022-03-04Add error context for most basic coercionsGuillaume Maudoux
2022-03-01Merge pull request #6185 from hercules-ci/fetchTree-reuse-local-pathsEelco Dolstra
fetchTree: Use isValidPath, add comment
2022-03-01fetchTree: Use isValidPath, add commentRobert Hensing
2022-03-01fetch{url,Tarball}: Remove 'narHash' attributeEelco Dolstra
This was introduced in #6174. However fetch{url,Tarball} are legacy and we shouldn't have an undocumented attribute that does the same thing as one that already exists ('sha256').