aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
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
2014-02-01Update Makefile variable namesEelco Dolstra
2014-01-30Rename Makefile -> local.mkEelco Dolstra
2014-01-30Install nix-worker symlinkEelco Dolstra
2014-01-21Fix some clang warningsEelco Dolstra
2014-01-21Fix building against Bison 3.0.2Eelco Dolstra
2014-01-21Merge branch 'master' into makeEelco Dolstra
Conflicts: src/libexpr/eval.cc
2014-01-21Remove unused typeEelco Dolstra
2014-01-14Bare dynamic attrs: Match interpolation semanticsShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-14Allow "bare" dynamic attrsShea Levy
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-09Generate schema.sql.hhEelco Dolstra
2014-01-09Update MakefilesEelco Dolstra
2014-01-08Fix checking of NAR hashesEelco Dolstra
*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-06Merge branch 'dynamic-attrs-no-sugar' of github.com:shlevy/nixEelco Dolstra
2014-01-06wordingDomen Kožar
2013-12-31Don't use any syntactic sugar for dynamic attrsShea Levy
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-31Fold dynamic binds handling into addAttrShea Levy
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-31Dynamic attrsShea Levy
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-31Add the ExprBuiltin Expr type to the ASTShea Levy
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-20DohEelco Dolstra
2013-12-20nix-env --set-flag: Barf if a selector doesn't match any installed packageEelco Dolstra
Fixes #184.
2013-12-20nix-shell: Don't warn about the lack of a GC rootEelco Dolstra
2013-12-20nix-shell: Handle --option correctlyEelco Dolstra
Fixes #181.
2013-12-10Bump language version for new storePath featureShea Levy
This will allow e.g. channel expressions to use builtins.storePath IFF it is safe to do so without knowing if the path is valid yet. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-12-10builtins.storePath: Try to substitute the path if it is not yet validShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-12-10Garbage collector: Release locks on temporary root filesEelco Dolstra
This allows processes waiting for such locks to proceed during the trash deletion phase of the garbage collector.
2013-12-05Print a trace message if a build fails due to the platform being unknownEelco Dolstra
2013-12-02Install bsdiff and bspatch in $(libexecdir)/nixEelco Dolstra
2013-11-25Add support for ‘make installcheck’Eelco Dolstra
2013-11-25Rename Makefile.new -> MakefileEelco Dolstra
2013-11-25Add a Makefile for bsdiffEelco Dolstra
2013-11-23Use libnix as a prefix for all Nix librariesEelco Dolstra
In particular "libutil" was always a problem because it collides with Glibc's libutil. Even if we install into $(libdir)/nix, the linker sometimes got confused (e.g. if a program links against libstore but not libutil, then ld would report undefined symbols in libstore because it was looking at Glibc's libutil).
2013-11-23Add Makefile for nix-log2xmlEelco Dolstra
2013-11-24Disallow undefined symbols in dynamic libraries by defaultEelco Dolstra
This encourages that each library declares its own dependencies properly.
2013-11-23Drop the dependency on libgc in libmainEelco Dolstra
Instead, libexpr now depends on libgc. This means commands like nix-store that don't do any evaluation no longer require libgc.
2013-11-23Initialise Boehm GC only onceEelco Dolstra
2013-11-23Allow (dynamic) libraries to depend on other librariesEelco Dolstra
2013-11-23Implement basic ‘make install’Eelco Dolstra
2013-11-23Improve building dynamic librariesEelco Dolstra
They now get a correct RPATH.
2013-11-22Support building dynamic librariesEelco Dolstra
2013-11-22Fix building without Boehm GCEelco Dolstra