aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
AgeCommit message (Collapse)Author
2022-07-13Simplify the check for overrides on non-existent inputsEelco Dolstra
2022-07-13Fix typo in flake.ccIkko Ashimine
non-existant -> non-existent
2022-07-12Merge pull request #6663 from Ma27/follows-invalid-inputThéophane Hufschmitt
flakes: throw an error if `follows`-declaration for an input is invalid
2022-07-12Fix debug messageEelco Dolstra
2022-07-12Move follows-check into its own functionMaximilian Bosch
2022-07-12Turn error for non-existant follows into a warningMaximilian Bosch
2022-07-12flakes: throw an error if `follows`-declaration for an input is invalidMaximilian Bosch
I recently got fairly confused why the following expression didn't have any effect { description = "Foobar"; inputs.sops-nix = { url = github:mic92/sops-nix; inputs.nixpkgs_22_05.follows = "nixpkgs"; }; } until I found out that the input was called `nixpkgs-22_05` (please note the dash vs. underscore). IMHO it's not a good idea to not throw an error in that case and probably leave end-users rather confused, so I implemented a small check for that which basically checks whether `follows`-declaration from overrides actually have corresponding inputs in the transitive flake. In fact this was done by accident already in our own test-suite where the removal of a `follows` was apparently forgotten[1]. Since the key of the `std::map` that holds the `overrides` is a vector and we have to find the last element of each vector (i.e. the override) this has to be done with a for loop in O(n) complexity with `n` being the total amount of overrides (which shouldn't be that large though). Please note that this doesn't work with nested expressions, i.e. inputs.fenix.inputs.nixpkgs.follows = "..."; which is a known problem[2]. For the expression demonstrated above, an error like this will be thrown: error: sops-nix has a `follows'-declaration for a non-existant input nixpkgs_22_05! [1] 2664a216e57169ec57d7f51be1b8383c1be83fd5 [2] https://github.com/NixOS/nix/issues/5790
2022-07-11Merge branch 'master' into ignore-tryBen Burdette
2022-07-11move ignore-try to EvalSettingsBen Burdette
2022-07-11use util.hh class instead of localBen Burdette
2022-07-11'tryEval' not 'try clause'Ben Burdette
2022-07-05builtins.traceVerbose: Post rebase fixesGytis Ivaskevicius
2022-07-05Add builtins.traceVerboseGytis Ivaskevicius
Co-Authored-By: Silvan Mosberger <contact@infinisil.com> Add builtins.traceVerbose tests
2022-06-29src/libexpr/tests/primops.cc: Quote Nix expressionsEelco Dolstra
Otherwise they don't survive reformatting, see the failure in https://github.com/NixOS/nix/pull/6721.
2022-06-26fetchGit: document `shallow` argumentGuillaume Girol
2022-06-24Merge pull request #6698 from tweag/forbid-tilde-paths-in-pure-modeThéophane Hufschmitt
Forbid the tilde expansion in pure eval mode
2022-06-23eval-cache: cast rowId to correct typeRick van Schijndel
Prevents errors when running with UBSan: /nix/store/j5vhrywqmz1ixwhsmmjjxa85fpwryzh0-gcc-11.3.0/include/c++/11.3.0/bits/stl_pair.h:353:4: runtime error: load of value 229, which is not a valid value for type 'AttrType'
2022-06-21Forbid the tilde expansion in pure eval modeThéophane Hufschmitt
Fix #6684
2022-06-13flake.cc: Make non-flake overrides stickyAlexander Bantyev
Overrides for inputs with flake=false were non-sticky, since they changed the `original` in `flake.lock`. This fixes it, by using the same locked original for both flake and non-flake inputs.
2022-06-10remove unused parameterBen Burdette
2022-06-02Shut up clang warningsEelco Dolstra
2022-06-02use Counter class to count tryEval levelsBen Burdette
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-27Style fixEelco Dolstra
2022-05-26Remove pre-C++11 hackinessEelco Dolstra
2022-05-26Merge pull request #6570 from edolstra/eof-in-stringEelco Dolstra
Handle EOFs in string literals correctly
2022-05-25Merge branch 'master' into debug-exploratory-PRBen Burdette
2022-05-25back to ref<EvalState> in NixReplBen Burdette
2022-05-25Handle EOFs in string literals correctlyEelco Dolstra
We can't return a STR token without setting a valid StringToken, otherwise the parser will crash. Fixes #6562.
2022-05-25Style tweaksEelco Dolstra
2022-05-22remove redundant 'debugMode' flagBen Burdette
2022-05-22commentsBen Burdette
2022-05-22change state derefsBen Burdette
2022-05-20remove special tryEval behaviorBen 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-18Merge pull request #6544 from ncfavier/getFlake-no-write-lock-fileThéophane Hufschmitt
Do not attempt to write a lock file in builtins.getFlake
2022-05-18Do not attempt to write a lock file in builtins.getFlakeNaïm Favier
Fixes https://github.com/NixOS/nix/issues/6541
2022-05-18primop_match: fix example letter case in documentzhujun
2022-05-16first whack at passing evalState as an arg to debuggerHook.Ben Burdette
2022-05-16Make nix::eval_cache::int_t more idiomaticThéophane Hufschmitt
Don’t explicitely give it a constructor, but use aggregate initialization instead (also prevents having an implicit coertion, which is probably good here)
2022-05-16resolve redundant priority passing, wrap NixInt in eval-cache variantEli Kogan-Wang
2022-05-16Add int to eval-cache, bump eval cache schema versionEli Kogan-Wang
2022-05-16Merge branch 'NixOS:master' into masterelikoga
2022-05-15fix thunk issueBen Burdette