aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
AgeCommit message (Collapse)Author
2008-11-19* Primop builtins.storePath for declaring a store path as aEelco Dolstra
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 Dolstra
(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 Dolstra
2008-08-25* Minor simplification.Eelco Dolstra
2008-08-14Fixing an obvious typo in override code. I do not know whether it works ↵Michael Raskin
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 Dolstra
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 Dolstra
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 Dolstra
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 Dolstra
2008-08-14* Refactoring: combine functions that take an attribute set andEelco Dolstra
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 Dolstra
2008-07-24* Print a better error message when a non-derivation attribute set isEelco Dolstra
coerced to a string.
2008-07-11* Generalised the dependencyClosure primop to builtins.genericClosure,Eelco Dolstra
which is hopefully more useful. * New primops: length, mul, div.
2008-07-01* Export the nix-env derivation name parsing and version comparisonEelco Dolstra
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-04First attempt to update Nix SDF grammar to match the actual bison grammarSander van der Burg
2008-05-21* GCC 4.3.0 (Fedora 9) compatibility fixes. Reported by Gour andEelco Dolstra
Armijn Hemel.
2008-03-20* Note that the SDF grammar isn't used.Eelco Dolstra
2008-02-21* checkVarDefs: don't check in closed terms, which don't haveEelco Dolstra
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 Dolstra
'' '${foo}' '' where the antiquote should work as expected, instead of giving the string "'${foo}'".
2008-01-20Probably fixed __exprToStringMichael Raskin
2008-01-15Fixed exportBuildReferenceGraphMichael Raskin
2008-01-04* New primop `unsafeDiscardStringContext' to get rid of stringEelco Dolstra
contexts. Needed to prevent unnecessary dependencies when building the NixOS manual.
2007-12-31* More release notes.Eelco Dolstra
2007-12-06* Syntax to escape '', ${.Eelco Dolstra
2007-11-30* Added a new kind of multi-line string literal delimited by twoEelco Dolstra
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 Dolstra
2007-10-31* Documented multi-user Nix.Eelco Dolstra
2007-10-26* "trace" primop: write the trace to standard error.Eelco Dolstra
2007-10-09* listToAttrs: the list now should consist of {name, value} attributeEelco Dolstra
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 Dolstra
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 Dolstra
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-18primop functions listToAttrs (+test), __isAttrs, __trace addedMarc Weber
new configuration style proposal in lib/default-unstable.nix
2007-08-07* Don't allocate input files on the stack.Eelco Dolstra
2007-05-16* New builtin function "isFunction". You're not supposed to use itEelco Dolstra
;-) * 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 Dolstra
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 Dolstra
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 Dolstra
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 Dolstra
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 Dolstra
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 Dolstra
the Nix expression evaluator.
2007-02-02* nix-env now maintains meta info (from the `meta' derivationEelco Dolstra
attribute) about installed packages in user environments. Thus, an operation like `nix-env -q --description' shows useful information not only on available packages but also on installed packages. * nix-env now passes the entire manifest as an argument to the Nix expression of the user environment builder (not just a list of paths), so that in particular the user environment builder has access to the meta attributes. * New operation `--set-flag' in nix-env to change meta info of installed packages. This will be useful to pass per-package policies to the user environment builder (e.g., how to resolve collision or whether to disable a package (NIX-80)) or upgrade policies in nix-env (e.g., that a package should be "masked", that is, left untouched by upgrade actions). Example: $ nix-env --set-flag enabled false ghc-6.4
2007-01-29* computeStorePathForText: take the references into account whenEelco Dolstra
computing the store path (NIX-77). This is an important security property in multi-user Nix stores. Note that this changes the store paths of derivations (since the derivation aterms are added using addTextToStore), but not most outputs (unless they use builtins.toFile).
2007-01-29* Don't capitalise the primop functions.Eelco Dolstra
2007-01-29* Organise primops.cc a bit better.Eelco Dolstra
2007-01-29New primitives:Eelco Dolstra
* `sub' to subtract two numbers. * `stringLength' to get the length of a string. * `substring' to get a substring of a string. These should be enough to allow most string operations to be expressed.
2007-01-29* filterSource: pass strings to the predicate function instead ofEelco Dolstra
paths. Paths can have unexpected semantics.
2007-01-15* Handle multiple indirect symlinks when loading a Nix expression.Eelco Dolstra
2007-01-15* builtins.filterSource: pass the type of the file ("regular",Eelco Dolstra
"directory", "symlink") as the second argument to the filter predicate.
2007-01-14* Option --argstr for passing string arguments easily. (NIX-75)Eelco Dolstra
2007-01-13* Canonicalise ASTs in `nix-instantiate --eval': remove positionEelco Dolstra
info, sort attribute sets.