aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2020-04-16Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-04-15Merge pull request #3458 from zimbatm/nix-user-conf-dirEelco Dolstra
NIX_USER_CONF_FILES
2020-04-14add NIX_USER_CONF_FILESzimbatm
Motivation: maintain project-level configuration files. Document the whole situation a bit better so that it corresponds to the implementation, and add NIX_USER_CONF_FILES that allows overriding which user files Nix will load during startup.
2020-04-14Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-04-10Add test case for temporary directories on darwinBruce Toll
A test case for correct handling of temporary directory deletion that was added to check.sh as part of PR #2689 was initially disabled for Darwin because of a directory permission issue in PR #2688. Now that the issue in PR #2688 is fixed, this commit enables the test case for Darwin.
2020-04-10Fix nix-build --check -K in sandbox w/o rootBruce Toll
Temporarily add user-write permission to build directory so that it can be moved out of the sandbox to the store with a .check suffix. This is necessary because the build directory has already had its permissions set read-only, but write permission is required to update the directory's parent link to move it out of the sandbox. Updated the related --check "derivation may not be deterministic" messages to consistently use the real store paths. Added test for non-root sandbox nix-build --check -K to demonstrate issue and help prevent regressions.
2020-04-10Remove flake 'edition' fieldEelco Dolstra
Future editions of flakes or the Nix language can be supported by renaming flake.nix (e.g. flake-v2.nix). This avoids a bootstrap problem where we don't know which grammar to use to parse flake*.nix. It also allows a project to support multiple flake editions, in theory.
2020-04-09Delete temporary directory on successful buildBruce Toll
With --check and the --keep-failed (-K) flag, the temporary directory was being retained regardless of whether the build was successful and reproducible. This removes the temporary directory, as expected, on a reproducible check build. Added tests to verify that temporary build directories are not retained unnecessarily, particularly when using --check with --keep-failed.
2020-04-09Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-04-08Merge pull request #3468 from Infinisil/functionArgsPositionsEelco Dolstra
Make function arguments retain position info
2020-04-07Merge branch 'flakes' of github.com:NixOS/nix into flakesEelco Dolstra
2020-04-07Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-04-07Merge branch 'fetchgit-recursive' of https://github.com/blitz/nixEelco Dolstra
2020-04-07Backport libfetchers from the flakes branchEelco Dolstra
This provides a pluggable mechanism for defining new fetchers. It adds a builtin function 'fetchTree' that generalizes existing fetchers like 'fetchGit', 'fetchMercurial' and 'fetchTarball'. 'fetchTree' takes a set of attributes, e.g. fetchTree { type = "git"; url = "https://example.org/repo.git"; ref = "some-branch"; rev = "abcdef..."; } The existing fetchers are just wrappers around this. Note that the input attributes to fetchTree are the same as flake input specifications and flake lock file entries. All fetchers share a common cache stored in ~/.cache/nix/fetcher-cache-v1.sqlite. This replaces the ad hoc caching mechanisms in fetchGit and download.cc (e.g. ~/.cache/nix/{tarballs,git-revs*}). This also adds support for Git worktrees (c169ea59049f861aaba429f48b828d0820b74d1d).
2020-04-03Fix tests.githubFlakes evaluationEelco Dolstra
2020-04-03getFlake: In pure mode, check that the argument is an immutable flakerefEelco Dolstra
2020-04-02Make function arguments retain position infoSilvan Mosberger
This allows querying the location of function arguments. E.g. builtins.unsafeGetAttrPos "x" (builtins.functionArgs ({ x }: null)) => { column = 57; file = "/home/infinisil/src/nix/inst/test.nix"; line = 1; }
2020-03-30Makefile cleanupEelco Dolstra
2020-03-30Remove global -I flagsEelco Dolstra
(cherry picked from commit 2c692a3b144523bca68dd6de618124ba6c9bb332)
2020-03-30Remove global -I flagsEelco Dolstra
2020-03-29tests/fetchGitSubmodules.sh: more checksBjørn Forsman
2020-03-29fetchGit: fix submodule output attributeBjørn Forsman
Before this change it would be false for all evaluations but the first. Now it follows the input argument (as it should).
2020-03-29tests/fetchGitSubmodules: add more testsBjørn Forsman
2020-03-29Fix typo in submodule testJulian Stecklina
2020-03-29Rename fetchGit fetchSubmodules to just submodulesJulian Stecklina
2020-03-29Add more test for git submodule functionalityJulian Stecklina
2020-03-29Add git submodule fixes from @bjornforJulian Stecklina
This fixes fetching repositories with no submodules and also cleans up .git files in checkouts.
2020-03-29Add test for fetchGit submodule supportJulian Stecklina
2020-03-27Add test for circular flake dependenciesEelco Dolstra
2020-03-27Improve lock file generationEelco Dolstra
This is now done in a single pass. Also fixes some issues when updating flakes with circular dependencies. Finally, when using '--recreate-lock-file --commit-lock-file', the commit message now correctly shows the differences.
2020-03-24Misc changes from the flakes branchEelco Dolstra
2020-03-24Pretty-print 'nix why-depends' / 'nix-store -q --tree' outputEelco Dolstra
Extracted from 678301072f05b650dc15c5edb4c25f08f0d6cace.
2020-03-20Fix GitHub VM testEelco Dolstra
2020-03-19Register flake-registry.json as a GC root againEelco Dolstra
2020-03-19downloadFile(): Use expired file if the download failsEelco Dolstra
2020-03-18tarball.cc: Use ETagsEelco Dolstra
2020-03-17Git: Use unified caching systemEelco Dolstra
2020-03-17Require shallow clones to be requested explicitlyEelco Dolstra
If you do a fetchTree on a Git repository, whether the result contains a revCount attribute should not depend on whether that repository happens to be a shallow clone or not. That would complicate caching a lot and would be semantically messy. So applying fetchTree/fetchGit to a shallow repository is now an error unless you pass the attribute 'shallow = true'. If 'shallow = true', we don't return revCount, even if the repository is not actually shallow. Note that Nix itself is not doing shallow clones at the moment. But it could do so as an optimisation if the user specifies 'shallow = true'. Issue #2988.
2020-03-17Unified fetcher caching systemEelco Dolstra
2020-03-16Add a test for shallow Git clonesEelco Dolstra
Also, don't return a revCount anymore for shallow or dirty Git trees, since it's incorrect. Closes #2988.
2020-03-16Fix re-running the fetchGit.sh testEelco Dolstra
2020-03-12Change the lock file to a graphEelco Dolstra
This enables support for cycles between flakes.
2020-03-11Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-03-11Move some corepkgs into the nix binaryEelco Dolstra
2020-03-09Move calling flakes into a Nix helper function (call-flake.nix)Eelco Dolstra
2020-03-04Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-03-04Add test for foldl'Eelco Dolstra
2020-02-20fetchTree: Use a feature flagEelco Dolstra
2020-02-19builtins.fetchGit: Fix build when fetching a git worktreeMaximilian Bosch
Worktrees[1] are a feature of git which allow you to check out a ref in a different directory. While playing around with flakes I realized that git repositories in a worktree checkout break when trying to build a flake: ``` $ git worktree add ../nixpkgs-flakes nixpkgs-flakes $ cd ../nixpkgs-flakes $ nix build .#hello error: opening directory '/home/ma27/Projects/nixpkgs-flakes/.git/refs/heads': Not a directory ``` This issue has been fixed by determining with `git rev-parse --git-common-dir` where the actual `.git` directory is. Please note that this issue only exists on the `flakes` branch, fetching worktree checkouts with Nix master seems to work fine. [1] https://git-scm.com/docs/git-worktree
2020-02-12Test narHash mismatchEelco Dolstra