aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
AgeCommit message (Collapse)Author
2012-02-09Fix error messageEelco Dolstra
This fixes the error message error: file `' was not found in the Nix search path (add it using $NIX_PATH or -I)
2012-02-04* Inline some functions and get rid of the indirection throughEelco Dolstra
EvalState::eval(). This gives a 12% speedup on ‘nix-instantiate /etc/nixos/nixos/ -A system --readonly-mode’ (from 1.01s to 0.89s).
2012-02-04* Print elapsed evaluation time.Eelco Dolstra
2012-01-26* Fix importing a derivation. This gave a segfault.Eelco Dolstra
2012-01-19* Allow comparisons between derivations by comparing the outPathEelco Dolstra
attributes.
2012-01-19* Add some debug output to print the derivation name once it's known.Eelco Dolstra
This makes it easier to pinpoint the source of a crash.
2012-01-07* Don't create thunks for simple constants (integers, strings, paths)Eelco Dolstra
and allocate them only once. * Move Value and related functions into value.hh.
2012-01-04* Remove dead code.Eelco Dolstra
2012-01-04* Don't use dynamic_cast, it's very slow. "nix-instantiateEelco Dolstra
/etc/nixos/nixos -A system" spent about 10% of its time in dynamic_cast.
2012-01-03* Drop the inefficient "Path" suffix in output attribute names.Eelco Dolstra
2012-01-03* Move the implementation of the ‘derivation’ primop into a separateEelco Dolstra
file.
2011-12-21* The ‘foo.drvPath’ feature was already broken in read-only mode.Eelco Dolstra
Since it's rarely used and fixing it is too much work right now, just document it.
2011-12-21* Simplify the context handling logic.Eelco Dolstra
2011-12-16* Sync with the trunk.Eelco Dolstra
2011-12-02* Move parseHash16or32 into libutil, and use in nix-hash.Eelco Dolstra
2011-12-01* Allow '<nixexpr>' syntax to be used in nix-instantiate, nix-buildEelco Dolstra
and nix-env, e.g., $ nix-env -f '<nixpkgs>' -i patchelf or $ nix-build '<nixos/tests>' -A login.test
2011-11-06There's no need to mess with drvPath at allShea Levy
2011-11-06Fix faulty reversion of my changes to unsafeDiscardOutputDependencyShea Levy
2011-11-06Respect all outputs passed to the derivation, not just the last oneShea Levy
2011-11-06Remove the unused sCurrentOutput symbolShea Levy
2011-11-06Embed output name into the context of the *OutPath attributes and extract it ↵Shea Levy
for input derivations Multiple outputs test passes!
2011-11-06Include all outputs of derivations in the closure of explicitly-passed ↵Shea Levy
derivation paths This required adding a queryOutputDerivationNames function in the store API
2011-11-06The 'insert output between = signs' approach was not helpfulShea Levy
2011-11-06Merge from trunkShea Levy
2011-10-27* In printValueAsXML, handle the case where a "type" attribute is notEelco Dolstra
a string. This happens in the NixOS option system. * Remove a bogus comparison of a unsigned integer with -1.
2011-09-16Remove the current output metadata from the string for ↵Shea Levy
unsaveDiscardOutputDependency
2011-09-16Add information about which output is active to drvPath's contextShea Levy
This will break things that depend on being able to just strip away an equals sign, so those have to be updated next
2011-09-16Add an sCurrentOutput member to EvalStateShea Levy
2011-09-16Add a currentOutput attribute to derivations keep track of which output is ↵Shea Levy
active
2011-09-14First attempt at the output-as-derivation semanticsShea Levy
For each output, this adds a corresponding attribute to the derivation that is the same as the derivation except for outPath, which is set to the path specific to that output. Additionally, an "all" attribute is added that is a list of all of the output derivations. This has to be done outside of derivationStrict as each output is itself a derivation that contains itself (and all other outputs) as an attribute. The derivation itself is equivalent to the first output in the outputs list (or "out" if that list isn't set).
2011-08-31* Eliminate all uses of the global variable ‘store’ from libstore.Eelco Dolstra
This should also fix: nix-instantiate: ./../boost/shared_ptr.hpp:254: T* boost::shared_ptr<T>::operator->() const [with T = nix::StoreAPI]: Assertion `px != 0' failed. which was caused by hashDerivationModulo() calling the ‘store’ object (during store upgrades) before openStore() assigned it.
2011-08-06* Cache the result of file evaluation (i.e, memoize evalFile()). ThisEelco Dolstra
prevents files from being evaluated and stored as values multiple times. For instance, evaluation of the ‘system’ attribute in NixOS causes ‘nixpkgs/pkgs/lib/lists.nix’ to be evaluated 2019 times. Caching gives a modest speedup and a decent memory footprint reduction (e.g., from 1.44s to 1.28s, and from 81 MiB to 59 MiB with GC_INITIAL_HEAP_SIZE=100000 on my system).
2011-08-06* Handle the case where the search path element is a regular file.Eelco Dolstra
2011-08-06* Remove a debug statement.Eelco Dolstra
2011-08-06* Add the Nix corepkgs to the end of the search path. This makes itEelco Dolstra
possible for other Nix expressions to use corepkgs (mostly useful for the buildenv function).
2011-08-06* Allow redirections in search path entries. E.g. if you have aEelco Dolstra
directory /home/eelco/src/stdenv-updates that you want to use as the directory for import such as with (import <nixpkgs> { }); then you can say $ nix-build -I nixpkgs=/home/eelco/src/stdenv-updates
2011-08-06* Add a Nix expression search path feature. Paths between angleEelco Dolstra
brackets, e.g. import <nixpkgs/pkgs/lib> are resolved by looking them up relative to the elements listed in the search path. This allows us to get rid of hacks like import "${builtins.getEnv "NIXPKGS_ALL"}/pkgs/lib" The search path can be specified through the ‘-I’ command-line flag and through the colon-separated ‘NIX_PATH’ environment variable, e.g., $ nix-build -I /etc/nixos ... If a file is not found in the search path, an error message is lazily thrown.
2011-08-06* Refactoring: move parseExprFromFile() and parseExprFromString() intoEelco Dolstra
the EvalState class.
2011-07-20* Don't allow derivations with fixed and non-fixed outputs.Eelco Dolstra
2011-07-20* Fix a huuuuge security hole in the Nix daemon. It didn't check thatEelco Dolstra
derivations added to the store by clients have "correct" output paths (meaning that the output paths are computed by hashing the derivation according to a certain algorithm). This means that a malicious user could craft a special .drv file to build *any* desired path in the store with any desired contents (so long as the path doesn't already exist). Then the attacker just needs to wait for a victim to come along and install the compromised path. For instance, if Alice (the attacker) knows that the latest Firefox derivation in Nixpkgs produces the path /nix/store/1a5nyfd4ajxbyy97r1fslhgrv70gj8a7-firefox-5.0.1 then (provided this path doesn't already exist) she can craft a .drv file that creates that path (i.e., has it as one of its outputs), add it to the store using "nix-store --add", and build it with "nix-store -r". So the fake .drv could write a Trojan to the Firefox path. Then, if user Bob (the victim) comes along and does $ nix-env -i firefox $ firefox he executes the Trojan injected by Alice. The fix is to have the Nix daemon verify that derivation outputs are correct (in addValidPath()). This required some refactoring to move the hash computation code to libstore.
2011-07-18* Support multiple outputs. A derivation can declare multiple outputsEelco Dolstra
by setting the ‘outputs’ attribute. For example: stdenv.mkDerivation { name = "aterm-2.5"; src = ...; outputs = [ "out" "tools" "dev" ]; configureFlags = "--bindir=$(tools)/bin --includedir=$(dev)/include"; } This derivation creates three outputs, named like this: /nix/store/gcnqgllbh01p3d448q8q6pzn2nc2gpyl-aterm-2.5 /nix/store/gjf1sgirwfnrlr0bdxyrwzpw2r304j02-aterm-2.5-tools /nix/store/hp6108bqfgxvza25nnxfs7kj88xi2vdx-aterm-2.5-dev That is, the symbolic name of the output is suffixed to the store path (except for the ‘out’ output). Each path is passed to the builder through the corresponding environment variable, e.g., ${tools}. The main reason for multiple outputs is to allow parts of a package to be distributed and garbage-collected separately. For instance, most packages depend on Glibc for its libraries, but don't need its header files. If these are separated into different store paths, then a package that depends on the Glibc libraries only causes the libraries and not the headers to be downloaded. The main problem with multiple outputs is that if one output exists while the others have been garbage-collected (or never downloaded in the first place), and we want to rebuild the other outputs, then this isn't possible because we can't clobber a valid output (it might be in active use). This currently gives an error message like: error: derivation `/nix/store/1s9zw4c8qydpjyrayxamx2z7zzp5pcgh-aterm-2.5.drv' is blocked by its output paths There are two solutions: 1) Do the build in a chroot. Then we don't need to overwrite the existing path. 2) Use hash rewriting (see the ASE-2005 paper). Scary but it should work. This is not finished yet. There is not yet an easy way to refer to non-default outputs in Nix expressions. Also, mutually recursive outputs aren't detected yet and cause the garbage collector to crash.
2011-07-13* Allow attribute names to be strings. Based on theEelco Dolstra
allow-arbitrary-strinsg-in-names patch by Marc Weber.
2011-07-13* Allow a default value in attribute selection by writingEelco Dolstra
x.y.z or default (as originally proposed in https://mail.cs.uu.nl/pipermail/nix-dev/2009-September/002989.html). For instance, an expression like stdenv.lib.attrByPath ["features" "ckSched"] false args can now be written as args.features.ckSched or false
2011-07-06* Change the right-hand side of the ‘.’ operator from an attribute toEelco Dolstra
an attribute path. This is a refactoring to support default values.
2011-07-06* In the ‘?’ operator, allow attribute paths. For instance, you canEelco Dolstra
write ‘attrs ? a.b’ to test whether ‘attrs’ has an attribute ‘a’ containing an attribute ‘b’. This is more convenient than ‘attrs ? a && attrs.a ? b’. Slight change in the semantics: it's no longer an error if the left-hand side of ‘?’ is not an attribute set. In that case it just returns false. So, ‘null ? foo’ no longer throws an error.
2011-02-10* Don't allocate a big initial GC address space on machines withEelco Dolstra
little RAM. Even if the memory isn't actually used, it can cause problems with the overcommit heuristics in the kernel. So use a VM space of 25% of RAM, up to 384 MB.
2011-02-09* Don't call GC_expand_hp unless we're actually using the garbageEelco Dolstra
collector.
2011-02-09Use $BDW_GC_LIBS instead of a custom variable.Ludovic Courtès
2011-01-14* builtins.substring: if "start" is beyond the end of the string,Eelco Dolstra
return the empty string.
2010-11-25* DrvInfo contains pointers to expressions, so DrvInfos should beEelco Dolstra
traced by the garbage collector. Otherwise "nix-env -u" can crash randomly.