aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
AgeCommit message (Collapse)Author
2021-09-30`std::visit` by referenceJohn Ericson
I had started the trend of doing `std::visit` by value (because a type error once mislead me into thinking that was the only form that existed). While the optomizer in principle should be able to deal with extra coppying or extra indirection once the lambdas inlined, sticking with by reference is the conventional default. I hope this might even improve performance.
2021-09-29reset yylloc when yyless(0) is calledTaeer Bar-Yam
2021-09-29Merge pull request #5301 from Ma27/builtins-missing-feature-errorEelco Dolstra
libexpr: throw a more helpful eval-error if a builtin is not available due to a missing feature-flag
2021-09-29libexpr: throw a more helpful eval-error if a builtin is not available due ↵Maximilian Bosch
to a missing feature-flag I found it somewhat confusing to have an error like error: attribute 'getFlake' missing if the required experimental-feature (`flakes`) is not enabled. Instead, I'd expect Nix to throw an error just like it's the case when using e.g. `nix flake` without `flakes` being enabled. With this change, the error looks like this: $ nix-instantiate -E 'builtins.getFlake "nixpkgs"' error: Cannot call 'builtins.getFlake' because experimental Nix feature 'flakes' is disabled. You can enable it via '--extra-experimental-features flakes'. at «string»:1:1: 1| builtins.getFlake "nixpkgs" | ^ I didn't use `settings.requireExperimentalFeature` here on purpose because this doesn't contain a position. Also, it doesn't seem as if we need to catch the error and check for the missing feature here since this already happens at evaluation time.
2021-09-27Don't copy in rethrowEelco Dolstra
2021-09-24Merge pull request #5253 from edolstra/flake-ifdEelco Dolstra
Don't allow IFD in flakes by default
2021-09-22Revert "Merge pull request #4922 from nrdxp/default-submodules"Eelco Dolstra
This reverts commit 6678e98411cd3bfe8143a4ba1b35d1451babce32, reversing changes made to 90b2dd570cbd8313a8cf45b3cf66ddef2bb06e07.
2021-09-22Don't cache realiseContext() errorsEelco Dolstra
Errors that depend on the configuration (such as whether allow-import-from-derivation is set) should not be cached.
2021-09-21Set input parent at construction timeEelco Dolstra
2021-09-16Include subpath in flake fingerprintGeoff Reedy
Without this, flakes within the same tree and same lock data will have the same fingerprint and the eval cache for one flake will be incorrectly used for another.
2021-09-15Merge pull request #5257 from edolstra/dirty-lock-fileEelco Dolstra
If we can't write a lock file, pretend the top-level flake is dirty
2021-09-15Merge branch 'mh/fix-chroot-eval' of https://github.com/obsidiansystems/nixEelco Dolstra
2021-09-15If we can't write a lock file, pretend the top-level flake is dirtyEelco Dolstra
Alternative to #4639. You can still read flake.lock, but at least in reproducible workflows like NixOS configurations where you require a non-dirty tree, evaluation will fail because there is no rev.
2021-09-15Revert "Disallow reading flake.lock"Eelco Dolstra
This reverts commit e5596113f7fc5e47e058bb15afdf75eee02ed95e.
2021-09-14Disallow reading flake.lockEelco Dolstra
With --no-write-lock-file, it's possible that flake.lock is out of sync with the actual inputs used by the evaluation. So doing fromJSON (readFile ./flake.lock) will give wrong results. Fixes #4639.
2021-09-14Merge pull request #5240 from edolstra/builtin-helpEelco Dolstra
nix --help: Display help using lowdown instead of man
2021-09-13hashFile, hashString: realize context before calculation, and discard afterwardskvtb
2021-09-13nix --help: Display help using lowdown instead of manEelco Dolstra
Fixes #4476. Fixes #5231.
2021-09-08Merge pull request #5215 from ncfavier/patch-1Eelco Dolstra
Fix use-registries logic in builtins.getFlake
2021-09-07Merge pull request #4922 from nrdxp/default-submodulesShea Levy
libfetchers/git: fetch submodules by default
2021-09-05Fix use-registries logic in builtins.getFlakeNaïm Favier
2021-09-01Merge pull request #5066 from Radvendii/masterEelco Dolstra
add antiquotations to paths
2021-08-31fix parse of `/${foo}`. was `// + foo`Taeer Bar-Yam
I don't think this changes the way any program would behave, but it's a cleaner internal representation.
2021-08-31path antiquotations: canonizePath -> canonicalizePathTaeer Bar-Yam
2021-08-30Merge pull request #5175 from Pamplemousse/makeEelco Dolstra
Don't overwrite user provided `lib*_LDFLAGS`
2021-08-30Merge pull request #5191 from hercules-ci/evalstate-lifetime-hygieneEelco Dolstra
EvalState lifetime hygiene
2021-08-29Fix use after free with vImportedDrvToDerivationRobert Hensing
2021-08-29Move vCallFlake into EvalStateRobert Hensing
This fixes a use-after-free bug: 1. s = new EvalState(); 2. callFlake() 3. static vCallFlake now references s 4. delete s; 5. s2 = new EvalState(); 6. callFlake() 7. static vCallFlake still references s 8. crash Nix 2.3 did not have a problem with recreating EvalState.
2021-08-29Force all Pos* to be non-nullRobert Hensing
This fixes a class of crashes and introduces ptr<T> to make the code robust against this failure mode going forward. Thanks regnat for the idea of a ref<T> without overhead! Closes #4895 Closes #4893 Closes #5127 Closes #5113
2021-08-25Don't overwrite user provided `lib*_LDFLAGS`Pamplemousse
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-08-23Coding styleEelco Dolstra
2021-08-17Fix follows paths in subordinate lockfilesAlex Zero
2021-08-13Install pkg-config files in the correct locationPiotr Szubiakowski
Use `$(libdir)` while installing .pc files looks like a more generic solution. For example, it will work for distributions like RHEL or Fedora where .pc files are installed in `/usr/lib64/pkgconfig`.
2021-08-11In flake lock file diffs, show the last-modified date of inputs if availableEelco Dolstra
This is a bit more informative than just the hash. Also, format the diffs a bit nicer.
2021-08-09Merge pull request #5111 from Pamplemousse/cleanEelco Dolstra
Minor maintenance cleaning
2021-08-09libexpr: Squash similar conditionsPamplemousse
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-08-07Whitelist nixConfig.flake-registryAlexander Bantyev
flake-registry should be safe to set to an aribtrary value, since it is identical to just setting `inputs`.
2021-08-06add antiquotations to pathsTaeer Bar-Yam
2021-08-05Use the store path as the context of the result of fetchTree, not the real pathMadeline Haraj
2021-07-28Merge pull request #5042 from alyssais/pthreadEelco Dolstra
Enable pthreads for new libraries
2021-07-27Merge pull request #5048 from tweag/flox-eval-storeEelco Dolstra
--eval-store and faster closure copying
2021-07-26libexpr: Remove unused codePamplemousse
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-07-24Enable pthreads for new librariesAlyssa Ross
Otherwise the lack of pthread causes linking to fail for NetBSD.
2021-07-22Support --eval-store in nix-instantiate and nix-buildEelco Dolstra
2021-07-22Add --eval-store optionEelco Dolstra
2021-07-21Avoid global countersPamplemousse
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-07-21Merge branch 'balsoft/no-registries' of https://github.com/serokell/nixEelco Dolstra
2021-07-19Rename findDerivationFilename -> findPackageFilenameRobert Hensing
It does not operate on a derivation and does not return a derivation path. Instead it works at the language level, where a distinct term "package" is more appropriate to distinguish the parent object of `meta.position`; an attribute which doesn't even make it into the derivation.
2021-07-16Add use-registries config option (and deprecate --no-registries flag)Alexander Bantyev
Some people want to avoid using registries at all on their system; Instead of having to add --no-registries to every command, this commit allows to set use-registries = false in the config. --no-registries is still allowed everywhere it was allowed previously, but is now deprecated. Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-07-15Merge pull request #5011 from Pamplemousse/fix_adjustLocEelco Dolstra
libexpr: Fix read out-of-bound on the heap