aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2014-03-05Revert "Make ifs and asserts tail-recursive"Eelco Dolstra
This reverts commit 273322c7732093a354e86df82cf75d6604b8bce8.
2014-02-27Set up a private /dev/pts in the chrootEelco Dolstra
2014-02-27Set up a minimal /dev in chrootsEelco Dolstra
Not bind-mounting the /dev from the host also solves the problem with /dev/shm being a symlink to something not in the chroot.
2014-02-27Correctly detect infinite recursion in function applicationEelco Dolstra
If we're evaluating some application ‘v = f x’, we can't store ‘f’ temporarily in ‘v’, because if ‘f x’ refers to ‘v’, it will get ‘f’ rather than an infinite recursion error. Unfortunately, this breaks the tail call optimisation introduced in c897bac54954373f63511702731fe2cb23c0c98e. Fixes #217.
2014-02-27Fix deadlock in SubstitutionGoalEelco Dolstra
We were relying on SubstitutionGoal's destructor releasing the lock, but if a goal is a top-level goal, the destructor won't run in a timely manner since its reference count won't drop to zero. So release it explicitly. Fixes #178.
2014-02-26And another oneEelco Dolstra
2014-02-26Remove another unused functionEelco Dolstra
2014-02-26Remove unused functionEelco Dolstra
2014-02-26nix-store -r: Respect --add-root for non-derivationsEelco Dolstra
Fixes #68. Fixes #117.
2014-02-26Warn about missing -I pathsEelco Dolstra
Fixes #121. Note that we don't warn about missing $NIX_PATH entries because it's intended that some may be missing (cf. the default $NIX_PATH on NixOS, which includes paths like /etc/nixos/nixpkgs for backward compatibility).
2014-02-26Simplify getting use-ssh-substituter from untrusted usersEelco Dolstra
2014-02-26Only start download-via-ssh if it's enabledEelco Dolstra
2014-02-26Add use-ssh-substituter setting.Shea Levy
It defaults to false and can be overridden by RemoteStore. Untested currently, just quickly put this together
2014-02-19nix-instantiate: Allow --dry-run as a synonym for --readonly-modeEelco Dolstra
--dry-run is more consistent with nix-env and nix-store.
2014-02-19nix-instantiate: Rename --eval-only to --eval, --parse-only to --parseEelco Dolstra
2014-02-19nix-instantiate: Add a flag --expr / -E to read expressions from the command ↵Eelco Dolstra
line This is basically a shortcut for ‘echo 'expr...' | nix-instantiate -’. Also supported by nix-build and nix-shell.
2014-02-18lexer-tab.o and parser-tab.o require each other's headersShea Levy
2014-02-18Slight simplificationEelco Dolstra
2014-02-18Add a flag ‘--check’ to verify build determinismEelco Dolstra
The flag ‘--check’ to ‘nix-store -r’ or ‘nix-build’ will cause Nix to redo the build of a derivation whose output paths are already valid. If the new output differs from the original output, an error is printed. This makes it easier to test if a build is deterministic. (Obviously this cannot catch all sources of non-determinism, but it catches the most common one, namely the current time.) For example: $ nix-build '<nixpkgs>' -A patchelf ... $ nix-build '<nixpkgs>' -A patchelf --check error: derivation `/nix/store/1ipvxsdnbhl1rw6siz6x92s7sc8nwkkb-patchelf-0.6' may not be deterministic: hash mismatch in output `/nix/store/4pc1dmw5xkwmc6q3gdc9i5nbjl4dkjpp-patchelf-0.6.drv' The --check build fails if not all outputs are valid. Thus the first call to nix-build is necessary to ensure that all outputs are valid. The current outputs are left untouched: the new outputs are either put in a chroot or diverted to a different location in the store using hash rewriting.
2014-02-17Make --repair work on DarwinEelco Dolstra
Mac OS X doesn't allow renaming a read-only directory. http://hydra.nixos.org/build/9113895
2014-02-17RefactoringEelco Dolstra
2014-02-17When using a build hook, only copy missing pathsEelco Dolstra
2014-02-17Move some code aroundEelco Dolstra
In particular, do replacing of valid paths during repair later. This prevents us from replacing a valid path after the build fails.
2014-02-17nix-store --gc --max-freed: Support a unit specifierEelco Dolstra
E.g. "--max-freed 10G" means "free ten gigabytes".
2014-02-17Heuristically detect if a build may have failed due to a full diskEelco Dolstra
This will allow Hydra to detect that a build should not be marked as "permanently failed", allowing it to be retried later.
2014-02-14download-via-ssh: Use readStorePathEelco Dolstra
2014-02-14download-via-ssh: Show where we're downloading fromEelco Dolstra
2014-02-14Minor style fixesEelco Dolstra
2014-02-12Indendation fixShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-12Remove relic of old codeShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-12error messages start in lowercaseShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-12Remove using declarations from download-via-sshShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-10nix-store --serve: Use a versioned protocolShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-10Move StoreApi::serve into opServeShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-10Pass in params by const refShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-10Clarify commentShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08Add download-via-ssh substituterShea Levy
This substituter connects to a remote host, runs nix-store --serve there, and then forwards substituter commands on to the remote host and sends their results to the calling program. The ssh-substituter-hosts option can be specified as a list of hosts to try. This is an initial implementation and, while it works, it has some limitations: * Only the first host is used * There is no caching of query results (all queries are sent to the remote machine) * There is no informative output (such as progress bars) * Some failure modes may cause unhelpful error messages * There is no concept of trusted-ssh-substituter-hosts Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08nix-store --serve: Flush out after every loopShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08nix-store --serve: Use dump instead of exportShea Levy
Also remove signing support Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08nix-store --serve: Don't fail if asked for info about non-valid pathShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08nix-store --serve: Don't loop foreverShea Levy
nix-store --export takes a tmproot, which can only release by exiting. Substituters don't currently work in a way that could take advantage of the looping, anyway. Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08Add the nix-store --serve commandShea Levy
This is essentially the substituter API operating on the local store, which will be used by the ssh substituter. It runs in a loop rather than just taking one command so that in the future nix will be able to keep one connection open for multiple instances of the substituter. Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-07nix-instantiate --eval-only --read-write-mode: Don't depend on orderingShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-07Rename --no-readonly-mode --read-write-modeShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-07nix-instantiate: Add a --no-readonly-mode flagShea Levy
This allows running nix-instantiate --eval-only without performing the evaluation in readonly mode, letting features like import from derivation and automatic substitution of builtins.storePath paths work. Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-03Fix assertion failure in ‘nix-store --load-db’Eelco Dolstra
Namely: nix-store: derivations.cc:242: nix::Hash nix::hashDerivationModulo(nix::StoreAPI&, nix::Derivation): Assertion `store.isValidPath(i->first)' failed. This happened because of the derivation output correctness check being applied before the references of a derivation are valid.
2014-02-01Give a friendly error message if the DB directory is not writableEelco Dolstra
Previously we would say "error: setting synchronous mode: unable to open database file" which isn't very helpful.
2014-02-01More "make dist" fixesEelco Dolstra
2014-02-01Fix "make dist"Eelco Dolstra
2014-02-01Remove AutomakefilesEelco Dolstra