aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
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-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-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
2021-10-26Make experimental-features a proper typeregnat
Rather than having them plain strings scattered through the whole codebase, create an enum containing all the known experimental features. This means that - Nix can now `warn` when an unkwown experimental feature is passed (making it much nicer to spot typos and spot deprecated features) - It’s now easy to remove a feature altogether (once the feature isn’t experimental anymore or is dropped) by just removing the field for the enum and letting the compiler point us to all the now invalid usages of it.
2021-10-15Revert "Fix referrers test"Eelco Dolstra
This reverts commit e31a48366f19d5fa452df6273e817a4ea5516e50. Unnecessary after 0be8cc1466f317e33977590510bac4b18471f0ce.
2021-10-15Add a test for the non-blocking GCEelco Dolstra
2021-10-15Disable the eval-store test when using the daemonregnat
Using the daemon will break most of the assumptions of this test, so it’s as simple to just disable it
2021-10-15Fix test against old daemonEelco Dolstra
2021-10-14Fix the min bound for the structured-attrs testregnat
The min bound written corresponds to the date of the commit that introduced the change, but it only got merged on master some weeks later. Since the version is essentially the commit date, that means that there’s a whole range of commits on master (including the current `nixUnstable`) that have a higher version but don’t contain the required change.
2021-10-14Fix the `isDaemonNewer` checkregnat
- Don’t hardcode the “newer” version - Remove an ill-placed `return`
2021-10-14pathInfoCache: Use the entire base name as the cache keyEelco Dolstra
This fixes a bug in the garbage collector where if a path /nix/store/abcd-foo is valid, but we do a isValidPath("/nix/store/abcd-foo.lock") first, then a negative entry for /nix/store/abcd is added to pathInfoCache, so /nix/store/abcd-foo is subsequently considered invalid and deleted.
2021-10-13Fix referrers testEelco Dolstra
This test broke the assumption that the hash parts of store paths are unique.
2021-10-13tests/multiple-outputs.sh: Assert empty storeEelco Dolstra
2021-10-13Non-blocking garbage collectorEelco Dolstra
The garbage collector no longer blocks other processes from adding/building store paths or adding GC roots. To prevent the collector from deleting store paths just added by another process, processes need to connect to the garbage collector via a Unix domain socket to register new temporary roots.
2021-10-12Add compression level for NARsTom Bereknyei
Based off on @dtzWill's #2276
2021-10-07Adds a test for nss preload mechanismArthur Gautier
This tests for the fix implemented in #5224 Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-10-07Allow builtins.{path,filterSource} on paths with a contextEelco Dolstra
We now build the context (so this has the side-effect of making builtins.{path,filterSource} work on derivations outputs, if IFD is enabled) and then check that the path has no references (which is what we really care about).
2021-10-06Add a test for builtins.path in a flakeEelco Dolstra
2021-10-06Make Mercurial optional for the flakes testsEelco Dolstra
2021-10-01Merge pull request #5167 from Ma27/keep-failed-on-ssh-remote-buildEelco Dolstra
nix-store --serve: pass on `settings.keepFailed` from SSH store
2021-09-29Merge pull request #5295 from Ma27/bmcheck-fod-mismatchEelco Dolstra
build: also throw hash-mismatch errors if `buildMode == bmCheck`
2021-09-27build: also throw hash-mismatch errors if `buildMode == bmCheck`Maximilian Bosch
This actually bit me quite recently in `nixpkgs` because I assumed that `nix-build --check` would also error out if hashes don't match anymore[1] and so I wrongly assumed that I couldn't reproduce the mismatch error. The fix is rather simple, during the output registration a so-called `delayedException` is instantiated e.g. if a FOD hash-mismatch occurs. However, in case of `nix-build --check` (or `--rebuild` in case of `nix build`), the code-path where this exception is thrown will never be reached. By adding that check to the if-clause that causes an early exit in case of `bmCheck`, the issue is gone. Also added a (previously failing) test-case to demonstrate the problem. [1] https://github.com/NixOS/nixpkgs/pull/139238, the underlying issue was that `nix-prefetch-git` returns different hashes than `fetchgit` because the latter one fetches submodules by default.
2021-09-27Fix 'error: reading a line: Input/output error' in startBuilder()Eelco Dolstra
With -vvvv, the ProgressBar was polluting the stderr of the child, messing up its \2 message to the parent.
2021-09-22Revert "Merge pull request #4922 from nrdxp/default-submodules"Eelco Dolstra
This reverts commit 6678e98411cd3bfe8143a4ba1b35d1451babce32, reversing changes made to 90b2dd570cbd8313a8cf45b3cf66ddef2bb06e07.