aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2022-02-24testS: poll more eagerly for the daemon start/stopregnat
Polling every 1 second means that even the simplest test takes at least 2 seconds. We can reasonably poll 1/10 of that to make things much quicker (esp. given that most of the time 0.1s is enough for the daemon to be started or stopped)
2022-02-24Sort the tests by wall timeregnat
The tests are scheduled in the order they appear, so running the long ones first slightly improves the scheduling. On my machine, this decreases the time of `make install` from 40s to 36s
2022-02-23add sourcehut integration testGabriel Fontes
2022-02-22Replace defaultBla.$system with bla.$system.defaultEelco Dolstra
This also simplifies some InstallableFlake logic and fixes 'nix bundle' parsing its installable twice. Fixes #5532.
2022-02-19git fetcher: distinguish errors more preciselyMartin Schwaighofer
2022-02-19git fetcher: invoke diff instead of diff-indexMartin Schwaighofer
diff-index operates on the view that git has of the working tree, which might be outdated. The higher-level diff command does this automatically. This change also adds handling for submodules. fixes #4140 Alternative fixes would be invoking update-index before diff-index or matching more closely what require_clean_work_tree from git-sh-setup.sh does, but both those options make it more difficult to reason about correctness.
2022-02-19git fetcher: improve check for valid repositoryMartin Schwaighofer
The .git/refs/heads directory might be empty for a valid usable git repository. This often happens in CI environments, which might only fetch commits, not branches. Therefore instead we let git itself check if HEAD points to something that looks like a commit. fixes #5302
2022-02-06Merge pull request #6042 from pennae/fix-repl-aEelco Dolstra
fix nix repl not overriding existing bindings in :a
2022-02-04fix nix repl not overriding existing bindings in :apennae
previously :a would override old bindings of a name with new values if the added set contained names that were already bound. in nix 2.6 this doesn't happen any more, which is potentially confusing. fixes #6041
2022-02-03Merge branch 'master' into bundler_drvtomberek
2022-02-02Merge pull request #6036 from tweag/balsoft/and-yet-another-follows-bugfixEelco Dolstra
Flake follows: resolve all follows to absolute
2022-02-02Flake follows: resolve all follows to absoluteAlexander Bantyev
It's not possible in general to know in computeLocks, relative to which path the follows was intended to be. So, we always resolve follows to their absolute states when we encounter them (which can either be in parseFlakeInput or computeLocks' fake input population). Fixes https://github.com/NixOS/nix/issues/6013 Fixes https://github.com/NixOS/nix/issues/5609 Fixes https://github.com/NixOS/nix/issues/5697 (again)
2022-02-02Merge branch 'parser-improvements' of https://github.com/pennae/nixEelco Dolstra
2022-01-28Merge branch 'master' into bundler_drvtomberek
2022-01-28bundler: tests various combinations of referring to installablesTom Bereknyei
2022-01-28bundler: revert default behavior to use defaultAppTom Bereknyei
Bundlers are now responsible for correctly handling their inputs which are no longer constrained to be (Drv->Drv)->Drv->Drv, but can be of type (attrset->Drv)->attrset->Drv.
2022-01-27Don’t require `NIX_PATH` entries to be valid pathsregnat
It’s totally valid to have entries in `NIX_PATH` that aren’t valid paths (they can even be arbitrary urls or `channel:<channel-name>`). Fix #5998 and #5980
2022-01-26Fix the `store ping` testregnat
2022-01-26Add some tests for `nix store ping`regnat
Always good to have :)
2022-01-25Fix parsing of variable names that are a suffix of '__curPos'regnat
Follow-up from #5969 Fix #5982
2022-01-25bundler: add tests and change defaults to use a derivationTom Bereknyei
2022-01-24Fix parsing of variable names that are a prefix of '__curPos'Eelco Dolstra
Fixes $ nix-instantiate --parse -E 'x: with x; _' (x: (with x; __curPos))
2022-01-24Add a test for nix-assertion failures in nix-envEelco Dolstra
2022-01-24Merge pull request #5945 from afishhh/masterThéophane Hufschmitt
Make `nix search` highlight all regexes and matches
2022-01-24Merge pull request #5963 from FlorianFranzen/test-flake-gitEelco Dolstra
tests: skip flake search test if no git is present
2022-01-24Merge pull request #5875 from hercules-ci/fix-large-drv-field-stack-overflowEelco Dolstra
Fix segfault or stack overflow caused by large derivation fields
2022-01-22tests: skip flake search test if no git is presentFlorian Franzen
2022-01-21Merge pull request #5942 from NixOS/5912-quieter-nix-why-dependsEelco Dolstra
Make `nix why-depends` quieter by default
2022-01-20Add some tests for multiple regex/match highlighting in `nix search`Hubert Głuchowski
2022-01-19defer formals duplicate check for incresed efficiency all roundpennae
if we defer the duplicate argument check for lambda formals we can use more efficient data structures for the formals set, and we can get rid of the duplication of formals names to boot. instead of a list of formals we've seen and a set of names we'll keep a vector instead and run a sort+dupcheck step before moving the parsed formals into a newly created lambda. this improves performance on search and rebuild by ~1%, pure parsing gains more (about 4%). this does reorder lambda arguments in the xml output, but the output is still stable. this shouldn't be a problem since argument order is not semantically important anyway. before nix search --no-eval-cache --offline ../nixpkgs hello Time (mean ± σ): 8.550 s ± 0.060 s [User: 6.470 s, System: 1.664 s] Range (min … max): 8.435 s … 8.666 s 20 runs nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 346.7 ms ± 2.1 ms [User: 312.4 ms, System: 34.2 ms] Range (min … max): 343.8 ms … 353.4 ms 20 runs nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.720 s ± 0.031 s [User: 2.415 s, System: 0.231 s] Range (min … max): 2.662 s … 2.780 s 20 runs after nix search --no-eval-cache --offline ../nixpkgs hello Time (mean ± σ): 8.462 s ± 0.063 s [User: 6.398 s, System: 1.661 s] Range (min … max): 8.339 s … 8.542 s 20 runs nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 329.1 ms ± 1.4 ms [User: 296.8 ms, System: 32.3 ms] Range (min … max): 326.1 ms … 330.8 ms 20 runs nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.687 s ± 0.035 s [User: 2.392 s, System: 0.228 s] Range (min … max): 2.626 s … 2.754 s 20 runs
2022-01-19Fix segfault or stack overflow caused by large derivation fieldsRobert Hensing
This removes a dynamic stack allocation, making the derivation unparsing logic robust against overflows when large strings are added to a derivation. Overflow behavior depends on the platform and stack configuration. For instance, x86_64-linux/glibc behaves as (somewhat) expected: $ (ulimit -s 20000; nix-instantiate tests/lang/eval-okay-big-derivation-attr.nix) error: stack overflow (possible infinite recursion) $ (ulimit -s 40000; nix-instantiate tests/lang/eval-okay-big-derivation-attr.nix) error: expression does not evaluate to a derivation (or a set or list of those) However, on aarch64-darwin: $ nix-instantiate big-attr.nix ~ zsh: segmentation fault nix-instantiate big-attr.nix This indicates a slight flaw in the single stack protection page approach that is not encountered with normal stack frames.
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