about summary refs log tree commit diff
path: root/src/libexpr
AgeCommit message (Collapse)AuthorFilesLines
2009-03-18 * Unify exportReferencesGraph and exportBuildReferencesGraph, and makeEelco Dolstra1-12/+18
sure that it works as expected when you pass it a derivation. That is, we have to make sure that all build-time dependencies are built, and that they are all in the input closure (otherwise remote builds might fail, for example). This is ensured at instantiation time by adding all derivations and their sources to inputDrvs and inputSrcs.
2009-03-06 (no commit message)Eelco Dolstra1-1/+1
2009-02-05 added primop functions __isBool, __isString, __isIntMarc Weber1-0/+25
2009-01-27 Add the "addErrorContext" builtin to add more information in the stack trace.Nicolas Pierron1-0/+14
2009-01-12 * Make Nix build with Bison 2.4.Eelco Dolstra1-0/+1
2008-12-04 (no commit message)Eelco Dolstra1-3/+4
2008-12-04 * Dirty hack to make nix-push work properly on derivations: theEelco Dolstra1-8/+23
derivation should be a source rather than a derivation dependency of the call to the NAR derivation. Otherwise the derivation (and all its dependencies) will be built as a side-effect, which may not even succeed.
2008-12-03 * Pass HashType values instead of strings.Eelco Dolstra1-3/+3
2008-12-03 * Made addToStore() a lot more efficient: it no longer reads the pathEelco Dolstra1-3/+1
being copied 3 times in the worst case. It doesn't run in constant space, but it didn't do that anyway.
2008-12-03 * Unify the treatment of sources copied to the store, and recursiveEelco Dolstra1-22/+26
SHA-256 outputs of fixed-output derivations. I.e. they now produce the same store path: $ nix-store --add x /nix/store/j2fq9qxvvxgqymvpszhs773ncci45xsj-x $ nix-store --add-fixed --recursive sha256 x /nix/store/j2fq9qxvvxgqymvpszhs773ncci45xsj-x the latter being the same as the path that a derivation derivation { name = "x"; outputHashAlgo = "sha256"; outputHashMode = "recursive"; outputHash = "..."; ... }; produces. This does change the output path for such fixed-output derivations. Fortunately they are quite rare. The most common use is fetchsvn calls with SHA-256 hashes. (There are a handful of those is Nixpkgs, mostly unstable development packages.) * Documented the computation of store paths (in store-api.cc).
2008-11-19 * Primop builtins.storePath for declaring a store path as aEelco Dolstra1-0/+22
dependency. `storePath /nix/store/bla' gives exactly the same result as `toPath /nix/store/bla', except that the former includes /nix/store/bla in the dependency context of the string. Useful in some generated Nix expressions like nix-push, which now finally does the right thing wrt distributed builds. (Previously the path to be packed wasn't an explicit dependency, so it wouldn't be copied to the remote machine.)
2008-08-26 * Require that __overrides is defined as a non-recursive attributeEelco Dolstra1-1/+1
(which means it can only be defined via "inherit"), otherwise we get scoping bugs, since __overrides can't be recursive (or at least, it would be hard).
2008-08-25 * Evaluate attributes in sorted order for better determinism.Eelco Dolstra1-7/+16
2008-08-25 * Minor simplification.Eelco Dolstra1-9/+6
2008-08-14 Fixing an obvious typo in override code. I do not know whether it works ↵Michael Raskin1-1/+1
correctly after the change, but at least it ca nbe compiled now.
2008-08-14 * Another experimental feature: a way to truly override attributes inEelco Dolstra2-2/+25
a rec. This will be very useful to allow end-user customisation of all-packages.nix, for instance globally overriding GCC or some other dependency. The // operator doesn't cut it: you could replace the "gcc" attribute, but all other attributes would continue to reference the original value due to the substitution semantics of rec. The syntax is a bit hacky but this is to allow backwards compatibility.
2008-08-14 * Added an experimental feature suggested by Andres: ellipses ("...")Eelco Dolstra7-18/+37
in attribute set pattern matches. This allows defining a function that takes *at least* the listed attributes, while ignoring additional attributes. For instance, {stdenv, fetchurl, fuse, ...}: stdenv.mkDerivation { ... }; defines a function that requires an attribute set that contains the specified attributes but ignores others. The main advantage is that we can then write in all-packages.nix aefs = import ../bla/aefs pkgs; instead of aefs = import ../bla/aefs { inherit stdenv fetchurl fuse; }; This saves a lot of typing (not to mention not having to update all-packages.nix with purely mechanical changes). It saves as much typing as the "args: with args;" style, but has the advantage that the function arguments are properly declared (not implicit in what the body of the "with" uses).
2008-08-14 * @-patterns as in Haskell. For instance, in a function definitionEelco Dolstra5-46/+74
f = args @ {x, y, z}: ...; `args' refers to the argument as a whole, which is further pattern-matched against the attribute set pattern {x, y, z}.
2008-08-14 * "pattern" non-terminal.Eelco Dolstra1-5/+8
2008-08-14 * Refactoring: combine functions that take an attribute set andEelco Dolstra7-135/+165
functions that take a single argument (plain lambdas) into one AST node (Function) that contains a Pattern node describing the arguments. Current patterns are single lazy arguments (VarPat) and matching against an attribute set (AttrsPat). This refactoring allows other kinds of patterns to be added easily, such as Haskell-style @-patterns, or list pattern matching.
2008-08-11 * Removed the "valid values" feature. Nobody uses it anyway.Eelco Dolstra5-70/+18
2008-07-24 * Print a better error message when a non-derivation attribute set isEelco Dolstra1-3/+10
coerced to a string.
2008-07-11 * Generalised the dependencyClosure primop to builtins.genericClosure,Eelco Dolstra1-137/+55
which is hopefully more useful. * New primops: length, mul, div.
2008-07-01 * Export the nix-env derivation name parsing and version comparisonEelco Dolstra4-16/+191
logic through the `parseDrvName' and `compareVersions' primops. This will allow expressions to easily check whether some dependency is a specific needed version or falls in some version range. See tests/lang/eval-okay-versions.nix for examples.
2008-06-04 First attempt to update Nix SDF grammar to match the actual bison grammarSander van der Burg1-2/+4
2008-05-21 * GCC 4.3.0 (Fedora 9) compatibility fixes. Reported by Gour andEelco Dolstra2-0/+4
Armijn Hemel.
2008-03-20 * Note that the SDF grammar isn't used.Eelco Dolstra1-0/+3
2008-02-21 * checkVarDefs: don't check in closed terms, which don't haveEelco Dolstra1-1/+5
undefined variables by definition. This matters for the implementation of "with", which does a call to checkVarDefs to see if the body of the with has no undefined variables. (It can't be checked at parse time because you don't know which variables are in the "with" attribute set.) If we check closed terms, then we check not just the with body but also the substituted terms, which are typically very large. This is the cause of the poor nix-env performance on Nixpkgs lately. It didn't happen earlier because "with" wasn't used very often in the past. This fix improves nix-env performance roughly 60x on current Nixpkgs. nix-env -qa is down from 29.3s to 0.5s on my laptop, and nix-env -qa --out-path is down from 229s to 3.39s. Not bad for a 1-line fix :-)
2008-02-05 * Fix the parsing ofEelco Dolstra1-1/+5
'' '${foo}' '' where the antiquote should work as expected, instead of giving the string "'${foo}'".
2008-01-20 Probably fixed __exprToStringMichael Raskin1-1/+4
2008-01-15 Fixed exportBuildReferenceGraphMichael Raskin1-0/+18
2008-01-04 * New primop `unsafeDiscardStringContext' to get rid of stringEelco Dolstra1-0/+10
contexts. Needed to prevent unnecessary dependencies when building the NixOS manual.
2007-12-31 * More release notes.Eelco Dolstra1-2/+2
2007-12-06 * Syntax to escape '', ${.Eelco Dolstra1-0/+12
2007-11-30 * Added a new kind of multi-line string literal delimited by twoEelco Dolstra3-3/+122
single quotes. Example (from NixOS): job = '' start on network-interfaces start script rm -f /var/run/opengl-driver ${if videoDriver == "nvidia" then "ln -sf ${nvidiaDrivers} /var/run/opengl-driver" else if cfg.driSupport then "ln -sf ${mesa} /var/run/opengl-driver" else "" } rm -f /var/log/slim.log end script ''; This style has two big advantages: - \, ' and " aren't special, only '' and ${. So you get a lot less escaping in shell scripts / configuration files in Nixpkgs/NixOS. The delimiter '' is rare in scripts (and can usually be written as ""). ${ is also fairly rare. Other delimiters such as <<...>>, {{...}} and <|...|> were also considered but this one appears to have the fewest drawbacks (thanks Martin). - Indentation is intelligently stripped so that multi-line strings can follow the nesting structure of the containing Nix expression. E.g. in the example above 6 spaces are stripped from the start of each line. This prevents unnecessary indentation in generated files (which sometimes even breaks things). See tests/lang/eval-okay-ind-string.nix for some examples.
2007-11-21 * New primop `readFile' to get the contents of a file as a string.Eelco Dolstra1-0/+12
2007-10-31 * Documented multi-user Nix.Eelco Dolstra1-0/+3
2007-10-26 * "trace" primop: write the trace to standard error.Eelco Dolstra1-6/+7
2007-10-09 * listToAttrs: the list now should consist of {name, value} attributeEelco Dolstra1-28/+29
sets instead of {attr, value}. "name" is better than "attr" because the *combination* of the two forms the attribute.
2007-09-18 * Pass various options to the worker so that flags like -K or -j workEelco Dolstra1-2/+1
in multi-user Nix (NIX-72). * Client/worker: exchange a protocol version number for future compatibility.
2007-09-17 * nix-env: allow ~/.nix-defexpr to be a directory. If it is, then theEelco Dolstra1-2/+2
Nix expressions in that directory are combined into an attribute set {file1 = import file1; file2 = import file2; ...}, i.e. each Nix expression is an attribute with the file name as the attribute name. Also recurses into directories. * nix-env: removed the "--import" (-I) option which set the ~/.nix-defexpr symlink. * nix-channel: don't use "nix-env --import", instead symlink ~/.nix-defexpr/channels. So finally nix-channel --update doesn't override any default Nix expressions but combines with them. This means that you can have (say) a local Nixpkgs SVN tree and use it as a default for nix-env: $ ln -s .../path-to-nixpkgs-tree ~/.nix-defexpr/nixpkgs_svn and be subscribed to channels (including Nixpkgs) at the same time. (If there is any ambiguity, the -A flag can be used to disambiguate, e.g. "nix-env -i -A nixpkgs_svn.pan".)
2007-08-18 primop functions listToAttrs (+test), __isAttrs, __trace addedMarc Weber1-0/+53
new configuration style proposal in lib/default-unstable.nix
2007-08-07 * Don't allocate input files on the stack.Eelco Dolstra1-14/+2
2007-05-16 * New builtin function "isFunction". You're not supposed to use itEelco Dolstra2-1/+14
;-) * Channels: fix channels that are plain lists of derivations (like strategoxt-unstable) instead of functions (like nixpkgs-unstable). This fixes the error message "error: the left-hand side of the function call is neither a function nor a primop (built-in operation) but a list".
2007-05-15 * Allow empty argument lists in function definitions (e.g., `{}:Eelco Dolstra1-0/+1
bla'). Also allow trailing commas (`{x, y,}: ...') as a unintented consequence. Hopefully the reduce/reduce conflict won't cause any problems.
2007-05-01 * Give unpacked channels more sensible names than 0, 1, ... They nowEelco Dolstra1-3/+12
get the basename of the channel URL (e.g., nixpkgs-unstable). The top-level Nix expression of the channel is now an attribute set, the attributes of which are the individual channels (e.g., {nixpkgs_unstable = ...; strategoxt_unstable = ...}). This makes attribute paths ("nix-env -qaA" and "nix-env -iA") more sensible, e.g., "nix-env -iA nixpkgs_unstable.subversion".
2007-05-01 * nix-env -i: instead of breaking package ties by version, break themEelco Dolstra2-0/+10
by priority and version install. That is, if there are multiple packages with the same name, then pick the package with the highest priority, and only use the version if there are multiple packages with the same priority. This makes it possible to mark specific versions/variant in Nixpkgs more or less desirable than others. A typical example would be a beta version of some package (e.g., "gcc-4.2.0rc1") which should not be installed even though it is the highest version, except when it is explicitly selected (e.g., "nix-env -i gcc-4.2.0rc1"). * Idem for nix-env -u, only the semantics are a bit trickier since we also need to take into account the priority of the currently installed package (we never upgrade to a lower priority, unless --always is given).
2007-04-16 * New primop "throw <string>" to throw an error. This is like abort,Eelco Dolstra3-0/+13
only thrown errors are caught by the top-level derivation evaluation in nix-env -qa / -i.
2007-02-27 * Greatly reduced the amount of stack space used by the Nix expressionEelco Dolstra1-188/+274
evaluator. This was important because the NixOS expressions started to hit 2 MB default stack size on Linux. GCC is really dumb about stack space: it just adds up all the local variables and temporaries of every scope into one huge stack frame. This is really bad for deeply recursive functions. For instance, every `throw Error(format("error message"))' causes a format object of a few hundred bytes to be allocated on the stack. As a result, every recursive call to evalExpr2() consumed 4680 bytes. By splitting evalExpr2() and by moving the exception-throwing code out of the main functions, evalExpr2() now only consumes 40 bytes. Similar for evalExpr().
2007-02-27 * When NIX_SHOW_STATS=1, show the amount of stack space consumed byEelco Dolstra1-2/+10
the Nix expression evaluator.