aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2021-07-31nix-shell -p: pass --arg values as nixpkgs paramsldesgoui
2021-07-27Remove the right socket before starting the daemonregnat
For some reason, an old socket occasionally stays here on OSX, causing the subsequent tests to fail
2021-07-27Allow running all the tests with the daemonregnat
When `NIX_DAEMON_PACKAGE` is set, make all the tests use the Nix daemon. That way we can test every piece of Nix functionality both with and without the daemon. Tests for which using the daemon isn’t possible or doesn’t make sens can selectively be disabled with `needLocalStore`
2021-07-27Add --eval-store testEelco Dolstra
2021-07-21Merge branch 'balsoft/no-registries' of https://github.com/serokell/nixEelco Dolstra
2021-07-20Properly lock the builds of CA derivationsregnat
Make sure that we can’t build the same derivation twice at the same time. Fix https://github.com/NixOS/nix/issues/5029
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-16Forward the whole Nix config to the repl subprocessesregnat
Fill `NIX_CONFIG` with the value of the current Nix configuration before calling the nix subprocesses in the repl That way the whole configuration (including the possible `experimental-features`, a possibly `--store` option or whatever) will be made available. This is required for example to make `nix repl` work with a custom `--store`
2021-07-12Merge branch 'master' into structured-attrs-shellMaximilian Bosch
Conflicts: src/nix/develop.cc src/nix/get-env.sh tests/shell.nix
2021-07-09nix print-dev-env: Add --json flagEelco Dolstra
2021-07-09nix develop: Add a test for bash functionsEelco Dolstra
2021-07-09Add test for #4992Eelco Dolstra
2021-07-09nix develop: Add a test for arraysEelco Dolstra
2021-07-08Merge pull request #4988 from NixOS/fetchgit-name-attributeEelco Dolstra
Add a name attribute to the fetchers
2021-07-08Forbid the `name` attribute for fetchTreeregnat
We need to support it for the “old” fetch* functions for backwards compatibility, but we don’t need it for fetchTree (as it’s a new function). Given that changing the `name` messes-up the content hashing, we can just forbid passing a custom `name` argument to it
2021-07-07Add tests/dummyEelco Dolstra
2021-07-07tests/check.sh: Fix a raceEelco Dolstra
Fixes this random failure: error: hash mismatch in fixed-output derivation '/tmp/nix-shell.EUgAVU/nix-test/tests/check/store/sfps3l3c5n7dabpx34kigxnfhmrwk2h6-dummy.drv': specified: sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= got: sha256-0qhPS4tlCTfsj3PNi+LHSt1akRumTfJ0WO2CKdqASiY= which happens because multiple tests were writing to ./dummy.
2021-07-07Merge branch 'balsoft/registry' of https://github.com/serokell/nixEelco Dolstra
2021-07-06allow fetchMercurial to take a `name` argumentregnat
2021-07-06allow fetchTarball to take a `name` argumentregnat
2021-07-06Allow `fetchGit` to take a `name` argumentregnat
Fix #3388
2021-07-05Fix devShell handling of env values including @ and %Michael Fellinger
2021-07-02Add tests for --registry and second arg for nix registry pinAlexander Bantyev
2021-06-28Merge pull request #4937 from NixOS/ca/make-the-tests-usefulEelco Dolstra
Make the CA tests actually test something
2021-06-25tests: Get rid of some result symlinksEelco Dolstra
Fixes error: cannot create symlink '/home/eelco/Dev/nix/tests/result'; already exists
2021-06-24Make CA derivations compatible with recursive Nixregnat
Add an access-control list to the realisations in recursive-nix (similar to the already existing one for store paths), so that we can build content-addressed derivations in the restricted store. Fix #4353
2021-06-24Make the post-build-hook also run for unresolved CA derivationsregnat
Fix #4837
2021-06-23Fix the CA gc testregnat
Broken by https://github.com/NixOS/nix/issues/4936
2021-06-23Make the CA tests actuall test CA derivationsregnat
Fix a mistake in config.nix that was preventing `NIX_TESTS_CA_BY_DEFAULT` from having any meaningful effect
2021-06-23Merge pull request #4839 from NixOS/ca/gracefully-handle-duplicate-realisationsEelco Dolstra
Gracefully handle duplicate realisations
2021-06-23Merge pull request #4908 from NixOS/ca/fix-nix-developEelco Dolstra
Make `nix develop` work with CA derivations
2021-06-23Merge pull request #4842 from NixOS/ca/fix-nix-shellEelco Dolstra
Make `nix-shell` support content-addressed derivations
2021-06-23Add a test for the “two glibc” issueregnat
2021-06-23Merge pull request #4838 from NixOS/ca/recursively-substitute-realisationsEelco Dolstra
Recursively substitute the realisations
2021-06-23Merge pull request #4906 from NixOS/collect-garbage-caEelco Dolstra
Make `computeFSClosure` ca-aware
2021-06-23Merge pull request #4905 from NixOS/ca-derivations-machine-featureEelco Dolstra
Add a ca-derivations required machine feature
2021-06-22Prefix env vars for attrs.* files with NIX_Maximilian Bosch
2021-06-22Add testcase for `nix develop` with `__structuredAttrs`Maximilian Bosch
2021-06-22Set environment variables for .attrs.json & .attrs.shMaximilian Bosch
This way no derivation has to expect that these files are in the `cwd` during the build. This is problematic for `nix-shell` where these files would have to be inserted into the nix-shell's `cwd` which can become problematic with e.g. recursive `nix-shell`. To remain backwards-compatible, the location inside the build sandbox will be kept, however using these files directly should be deprecated from now on.
2021-06-22Source complete env in `nix-shell` with `__structuredAttrs = true;`Maximilian Bosch
This is needed to push the adoption of structured attrs[1] forward. It's now checked if a `__json` exists in the environment-map of the derivation to be openend in a `nix-shell`. Derivations with structured attributes enabled also make use of a file named `.attrs.json` containing every environment variable represented as JSON which is useful for e.g. `exportReferencesGraph`[2]. To provide an environment similar to the build sandbox, `nix-shell` now adds a `.attrs.json` to `cwd` (which is mostly equal to the one in the build sandbox) and removes it using an exit hook when closing the shell. To avoid leaking internals of the build-process to the `nix-shell`, the entire logic to generate JSON and shell code for structured attrs was moved into the `ParsedDerivation` class. [1] https://nixos.mayflower.consulting/blog/2020/01/20/structured-attrs/ [2] https://nixos.org/manual/nix/unstable/expressions/advanced-attributes.html#advanced-attributes
2021-06-21Remove a possible existing store path when building CA derivationsregnat
In case a previous interrupted build left a garbage path laying around, remove it before trying to move the path to its final location. Fix #4858
2021-06-15Add a test for the gc with CA derivationsregnat
Also add a small architecture to easily run CA-enabled tests
2021-06-11Make `nix develop` work with CA derivationsregnat
Fix #4823
2021-06-11Make `nix-shell` support content-addressed derivationsregnat
Resolve the derivation before trying to load its environment − essentially reproducing what the build loop does − so that we can effectively access our dependencies (and not just their placeholders). Fix #4821
2021-06-11Add a ca-derivations required machine featureregnat
Make ca-derivations require a `ca-derivations` machine feature, and ca-aware builders expose it. That way, a network of builders can mix ca-aware and non-ca-aware machines, and the scheduler will send them in the right place.
2021-06-02Let `nix flake check` keep going when keep-going is setregnat
When the `keep-going` option is set to `true`, make `nix flake check` continue as much as it can before failing. The UI isn’t perfect as-it-is as all the lines currently start with a mostly useless `error (ignored): error:` prefix, but I’m not sure what the best output would be, so I’ll leave it as-it-is for the time being (This is a bit hijacking the `keep-going` flag as it’s supposed to be a build-time only thing. But I think it’s faire to reuse it here). Fix https://github.com/NixOS/nix/issues/4450
2021-06-01Check the CA hash when importing stuff in the local storeregnat
When adding a path to the local store (via `LocalStore::addToStore`), ensure that the `ca` field of the provided `ValidPathInfo` does indeed correspond to the content of the path. Otherwise any untrusted user (or any binary cache) can add arbitrary content-addressed paths to the store (as content-addressed paths don’t need a signature).
2021-05-29Add .tar.zst support for TarballInputSchemeTimothy Klim
2021-05-26Recursively substitute the realisationsregnat
Make sure that whenever we substitute a realisation, we also substitute its entire closure
2021-05-17Add a test for `nix run` with CA derivationsregnat