aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2022-01-21Merge pull request #5942 from NixOS/5912-quieter-nix-why-dependsEelco Dolstra
Make `nix why-depends` quieter by default
2022-01-19Make `nix why-depends` quieter by defaultregnat
Unless `--precise` is passed, make `nix why-depends` only show the dependencies between the store paths, without introspecting them to find the actual references. This also makes it ~3x faster
2022-01-18Add a test for 'nix store copy-log' and 'nix log'Eelco Dolstra
2022-01-18Add a simple test for `nix why-depends`regnat
2022-01-18Merge pull request #5720 from tomberek/flake_searchThéophane Hufschmitt
flakes: search up to git or filesystem boundary
2022-01-14Check that we don't search past a git repoAlexander Bantyev
2022-01-14Add more tests for flake upward searchingAlexander Bantyev
2022-01-11Merge pull request #5898 from layus/repair-path-linksEelco Dolstra
Make --repair-path also repair corrupt optimised links
2022-01-11Make --repair-path also repair corrupt optimised linksGuillaume Maudoux
There already existed a smoke test for the link content length, but it appears that there exists some corruptions pernicious enough to replace the file content with zeros, and keeping the same length. --repair-path now goes as far as checking the content of the link, making it true to its name and actually repairing the path for such coruption cases.
2022-01-10Merge branch 'readfile' of https://github.com/abbradar/nixEelco Dolstra
2022-01-09Add test for readFile keeping contextNikolay Amiantov
2022-01-06Merge pull request #5546 from NixOS/allow-paths-in-flake-local-optionsEelco Dolstra
allow paths in flake local options
2022-01-04Remove non-method mk<X> functionsEelco Dolstra
2022-01-03add zipAttrsWith primoppennae
nixpkgs can save a good bit of eval memory with this primop. zipAttrsWith is used quite a bit around nixpkgs (eg in the form of recursiveUpdate), but the most costly application for this primop is in the module system. it improves the implementation of zipAttrsWith from nixpkgs by not checking an attribute multiple times if it occurs more than once in the input list, allocates less values and set elements, and just avoids many a temporary object in general. nixpkgs has a more generic version of this operation, zipAttrsWithNames, but this version is only used once so isn't suitable for being the base of a new primop. if it were to be used more we should add a second primop instead.
2022-01-03Merge pull request #5839 from tweag/balsoft/yet-another-follows-bugfixEelco Dolstra
flake.cc: computeLocks: Only verify overrides when they could change
2021-12-28Add a test that nix repl --show-trace actually shows the traceAlexander Bantyev
2021-12-28flake.cc: computeLocks: Only verify overrides when they could changeAlexander Bantyev
When we check for disappeared overrides, we can get "false positives" for follows and overrides which are defined in the dependencies of the flake we are locking, since they are not parsed by parseFlakeInputs. However, at that point we already know that the overrides couldn't have possible been changed if the input itself hasn't changed (since we check that oldLock->originalRef == *input.ref for the input's parent). So, to prevent this, only perform this check when it was possible that the flake changed (e.g. the flake we're locking, or a new input, or the input has changed and mustRefetch == true).
2021-12-23Merge branch 'master' into flake_searchtomberek
2021-12-23Properly return false on `builtins.pathExists /someNonAllowedPath`regnat
Follow-up from https://github.com/NixOS/nix/pull/5807 to fix https://github.com/NixOS/nix/pull/5807#issuecomment-1000135394
2021-12-21Fix IFD with CA derivationsregnat
Rewrite the string taken by the IFD-like primops to contain the actual output paths of the derivations rather than the placeholders Fix #5805
2021-12-17Merge pull request #5047 from symphorien/fix-nix-channelThéophane Hufschmitt
nix-channel: use nix-env -i --remove-all to upgrade
2021-12-17Allow paths in flake local settingsregnat
Fix #5505
2021-12-17Test the update of multiple channelsregnat
Make sure that `nix-channel --update` won’t accidentaly remove one
2021-12-16Add a test case for builtins.groupBySilvan Mosberger
2021-12-14Merge pull request #5623 from yorickvP/fix-5621Théophane Hufschmitt
flakes: fix boolean and int nixConfig values
2021-12-14Add a test for boolean config options in flakesregnat
2021-12-13Re-allow inputs.x.url = "/path/to/file"Eelco Dolstra
2021-12-13gc-non-blocking.sh: Don't hang indefinitely if the GC roots server crashesEelco Dolstra
2021-12-09Properly take the last assignment in the REPLregnat
When a variable is assigned in the REPL, make sure to remove any possible reference to the old one so that we correctly pick the new one afterwards Fix #5706
2021-12-07Inline fileEelco Dolstra
2021-12-06nix repl: add :logAlexander Bantyev
Add a :log command that shows logs for a derivation. Closes https://github.com/NixOS/nix/issues/3504 Co-authored-by: Taeer Bar-Yam <taeer@bar-yam.me>
2021-12-03flakes: search up to git or filesystem boundaryTom Bereknyei
While parsing a flakeref, upon not finding a flake.nix, search upwards until git or filesystem boundary.
2021-12-02Flakes: computeLocks: pass correct LockParent when reusing oldLockAlexander Bantyev
Previously, when we were attempting to reuse the old lockfile information in the computeLocks function, we have passed the parent of the current input to the next computeLocks call. This was incorrect, since the follows are resolved relative to the parent. This caused issues when we tried to reuse oldLock but couldn't for some reason (read: mustRefetch is true), in that case the follows were resolved incorrectly. Fix this by passing the correct parent, and adding some tests to prevent this particular regression from happening again. Closes https://github.com/NixOS/nix/issues/5697
2021-11-28Make libcpuid dependency optional with --disable-cpuidAlexander Sosedkin
2021-11-26Make `nix-shell` work when nixpkgs is content-addressedregnat
Fix #5259
2021-11-25Fix the error when accessing a forbidden path in pure evalregnat
If we’re in pure eval mode, then tell that in the error message rather than (wrongly) speaking about restricted mode. Fix https://github.com/NixOS/nix/issues/5611
2021-11-24Make lists be comparableSilvan Mosberger
Makes lists comparable using lexicographic comparison. Increments builtins.langVersion in order for this change to be detectable
2021-11-18Fix testing the other daemonJohn Ericson
The eventual PATH entry needs the `.../bin` or we will not use the right daemon.
2021-11-18Test that untrusted config is ignored without --accept-flake-configEelco Dolstra
2021-11-18Merge branch 'accept_conf' of https://github.com/tomberek/nixEelco Dolstra
2021-11-12Add a test for the `--accept-flake-config` optionregnat
2021-11-11Flakes: refetch the input when a follows disappearsAlexander Bantyev
When an input follows disappears, we can't just reuse the old lock file entries since we may be missing some required ones. Refetch the input when this happens. Closes https://github.com/NixOS/nix/issues/5289
2021-11-08Merge pull request #5504 from NixOS/flake-options-and-daemonEelco Dolstra
Make the flake options work when using the daemon
2021-11-08Merge pull request #5506 from NixOS/fix-post-hook-test-with-different-daemonEelco Dolstra
Make the post-build-hook use the daemon Nix package
2021-11-05Merge pull request #5476 from NixOS/ca/fix-build-in-nix-replThéophane Hufschmitt
Fix `nix repl`’s building of CA derivations
2021-11-05Make the flake options work when using the daemonregnat
When setting flake-local options (with the `nixConfig` field), forward these options to the daemon in case we’re using one. This is necessary in particular for options like `binary-caches` or `post-build-hook` to make sense. Fix <https://github.com/NixOS/nix/commit/343239fc8a1993f707a990c2cd54a41f1fa3de99#r44356843>
2021-11-05Make the post-build-hook use the daemon Nix packageregnat
Having the `post-build-hook` use `nix` from the client package can lead to a deadlock in case there’s a db migration to do between both, as a `nix` command running inside the hook will run as root (and as such will bypass the daemon), so might trigger a db migration, which will get stuck trying to get a global lock on the DB (as the daemon that ran the hook already has a lock on it).
2021-11-05Fix `nix repl`’s building of CA derivationsregnat
When running a `:b` command in the repl, after building the derivations query the store for its outputs rather than just assuming that they are known in the derivation itself (which isn’t true for CA derivations) Fix #5328
2021-11-04Fix function-trace test caseEelco Dolstra
2021-10-28Merge remote-tracking branch 'origin/master' into non-blocking-gcEelco Dolstra