about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2014-02-17 RefactoringEelco Dolstra1-29/+36
2014-02-17 When using a build hook, only copy missing pathsEelco Dolstra1-9/+6
2014-02-17 Move some code aroundEelco Dolstra1-92/+82
In particular, do replacing of valid paths during repair later. This prevents us from replacing a valid path after the build fails.
2014-02-17 nix-store --gc --max-freed: Support a unit specifierEelco Dolstra2-4/+19
E.g. "--max-freed 10G" means "free ten gigabytes".
2014-02-17 Heuristically detect if a build may have failed due to a full diskEelco Dolstra2-5/+28
This will allow Hydra to detect that a build should not be marked as "permanently failed", allowing it to be retried later.
2014-02-14 download-via-ssh: Use readStorePathEelco Dolstra2-5/+13
2014-02-14 download-via-ssh: Show where we're downloading fromEelco Dolstra1-1/+3
2014-02-14 Minor style fixesEelco Dolstra4-6/+14
2014-02-12 Indendation fixShea Levy1-21/+19
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-12 Remove relic of old codeShea Levy1-2/+0
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-12 error messages start in lowercaseShea Levy2-3/+3
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-12 Remove using declarations from download-via-sshShea Levy1-20/+16
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-10 nix-store --serve: Use a versioned protocolShea Levy4-34/+102
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-10 Move StoreApi::serve into opServeShea Levy3-39/+29
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-10 Pass in params by const refShea Levy2-2/+2
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-10 Clarify commentShea Levy1-1/+2
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08 Add download-via-ssh substituterShea Levy5-0/+167
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-08 nix-store --serve: Flush out after every loopShea Levy2-2/+3
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08 nix-store --serve: Use dump instead of exportShea Levy3-12/+7
Also remove signing support Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08 nix-store --serve: Don't fail if asked for info about non-valid pathShea Levy1-0/+2
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08 nix-store --serve: Don't loop foreverShea Levy1-26/+25
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-08 Add the nix-store --serve commandShea Levy3-0/+55
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-07 nix-instantiate --eval-only --read-write-mode: Don't depend on orderingShea Levy1-9/+8
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-07 Rename --no-readonly-mode --read-write-modeShea Levy1-1/+1
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-07 nix-instantiate: Add a --no-readonly-mode flagShea Levy1-0/+3
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-03 Fix assertion failure in ‘nix-store --load-db’Eelco Dolstra1-1/+12
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-01 Give a friendly error message if the DB directory is not writableEelco Dolstra1-2/+6
Previously we would say "error: setting synchronous mode: unable to open database file" which isn't very helpful.
2014-02-01 More "make dist" fixesEelco Dolstra1-0/+2
2014-02-01 Fix "make dist"Eelco Dolstra3-5/+7
2014-02-01 Remove AutomakefilesEelco Dolstra13-201/+0
2014-02-01 Update Makefile variable namesEelco Dolstra12-13/+13
2014-01-30 Rename Makefile -> local.mkEelco Dolstra12-0/+0
2014-01-30 Install nix-worker symlinkEelco Dolstra1-0/+2
2014-01-21 Fix some clang warningsEelco Dolstra6-18/+12
2014-01-21 Fix building against Bison 3.0.2Eelco Dolstra1-1/+1
2014-01-21 Merge branch 'master' into makeEelco Dolstra11-76/+262
Conflicts: src/libexpr/eval.cc
2014-01-21 Remove unused typeEelco Dolstra1-1/+0
2014-01-14 Bare dynamic attrs: Match interpolation semanticsShea Levy1-1/+1
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-14 Allow "bare" dynamic attrsShea Levy2-0/+3
Now, in addition to a."${b}".c, you can write a.${b}.c (applicable wherever dynamic attributes are valid). Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-09 Generate schema.sql.hhEelco Dolstra1-0/+5
2014-01-09 Update MakefilesEelco Dolstra13-27/+14
2014-01-08 Fix checking of NAR hashesEelco Dolstra1-0/+1
*headdesk* *headdesk* *headdesk* So since commit 22144afa8d9f8968da351618a1347072a93bd8aa, Nix hasn't actually checked whether the content of a downloaded NAR matches the hash specified in the manifest / NAR info file. Urghhh...
2014-01-06 Merge branch 'dynamic-attrs-no-sugar' of github.com:shlevy/nixEelco Dolstra4-63/+225
2014-01-06 wordingDomen Kožar1-1/+1
2013-12-31 Don't use any syntactic sugar for dynamic attrsShea Levy4-128/+68
This doesn't change any functionality but moves some behavior out of the parser and into the evaluator in order to simplify the code. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-12-31 Fold dynamic binds handling into addAttrShea Levy1-55/+35
Since addAttr has to iterate through the AttrPath we pass it, it makes more sense to just iterate through the AttrNames in addAttr instead. As an added bonus, this allows attrsets where two dynamic attribute paths have the same static leading part (see added test case for an example that failed previously). Signed-off-by: Shea Levy <shea@shealevy.com>
2013-12-31 Dynamic attrsShea Levy4-23/+238
This adds new syntax for attribute names: * attrs."${name}" => getAttr name attrs * attrs ? "${name}" => isAttrs attrs && hasAttr attrs name * attrs."${name}" or def => if attrs ? "${name}" then attrs."${name}" else def * { "${name}" = value; } => listToAttrs [{ inherit name value; }] Of course, it's a bit more complicated than that. The attribute chains can be arbitrarily long and contain combinations of static and dynamic parts (e.g. attrs."${foo}".bar."${baz}" or qux), which is relatively straightforward for the getAttrs/hasAttrs cases but is more complex for the listToAttrs case due to rules about duplicate attribute definitions. For attribute sets with dynamic attribute names, duplicate static attributes are detected at parse time while duplicate dynamic attributes are detected when the attribute set is forced. So, for example, { a = null; a.b = null; "${"c"}" = true; } will be a parse-time error, while { a = {}; "${"a"}".b = null; c = true; } will be an eval-time error (technically that case could theoretically be detected at parse time, but the general case would require full evaluation). Moreover, duplicate dynamic attributes are not allowed even in cases where they would be with static attributes ({ a.b.d = true; a.b.c = false; } is legal, but { a."${"b"}".d = true; a."${"b"}".c = false; } is not). This restriction might be relaxed in the future in cases where the static variant would not be an error, but it is not obvious that that is desirable. Finally, recursive attribute sets with dynamic attributes have the static attributes in scope but not the dynamic ones. So rec { a = true; "${"b"}" = a; } is equivalent to { a = true; b = true; } but rec { "${"a"}" = true; b = a; } would be an error or use a from the surrounding scope if it exists. Note that the getAttr, getAttr or default, and hasAttr are all implemented purely in the parser as syntactic sugar, while attribute sets with dynamic attribute names required changes to the AST to be implemented cleanly. This is an alternative solution to and closes #167 Signed-off-by: Shea Levy <shea@shealevy.com>
2013-12-31 Add the ExprBuiltin Expr type to the ASTShea Levy4-9/+36
Certain desugaring schemes may require the parser to use some builtin function to do some of the work (e.g. currently `throw` is used to lazily cause an error if a `<>`-style path is not in the search path) Unfortunately, these names are not reserved keywords, so an expression that uses such a syntactic sugar will not see the expected behavior (see tests/lang/eval-okay-redefine-builtin.nix for an example). This adds the ExprBuiltin AST type, which when evaluated uses the value from the rootmost variable scope (which of course is initialized internally and can't shadow any of the builtins). Signed-off-by: Shea Levy <shea@shealevy.com>
2013-12-20 DohEelco Dolstra1-1/+1
2013-12-20 nix-env --set-flag: Barf if a selector doesn't match any installed packageEelco Dolstra1-5/+13
Fixes #184.