about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2011-12-01 * Allow '<nixexpr>' syntax to be used in nix-instantiate, nix-buildEelco Dolstra4-3/+15
and nix-env, e.g., $ nix-env -f '<nixpkgs>' -i patchelf or $ nix-build '<nixos/tests>' -A login.test
2011-12-01 * Slight improvement.Eelco Dolstra1-3/+2
2011-12-01 * When doing "nix-store --add-fixed" without "--recursive" via the NixEelco Dolstra3-6/+16
daemon (which is an error), print a nicer error message than "Connection reset by peer" or "broken pipe". * In the daemon, log errors that occur during request parameter processing.
2011-11-29 * Get rid of some superfluous error messages if a substituter fails.Eelco Dolstra2-16/+7
* Say "fetch" instead of "substitute".
2011-11-23 * Add an API function exportPaths() that provides the functionality ofEelco Dolstra4-6/+19
‘nix-store --export’. * Add a Perl module that provides the functionality of ‘nix-copy-closure --to’. This is used by build-remote.pl so it no longer needs to start a separate nix-copy-closure process. Also, it uses the Perl API to do the export, so it doesn't need to start a separate nix-store process either. As a result, nix-copy-closure and build-remote.pl should no longer fail on very large closures due to an "Argument list too long" error. (Note that having very many dependencies in a single derivation can still fail because the environment can become too large. Can't be helped though.)
2011-11-22 * Move initialisation of variables like nixConfDir from libmain toEelco Dolstra5-33/+45
libstore so that the Perl bindings can use it as well. It's vital that the Perl bindings use the configuration file, because otherwise nix-copy-closure will fail with a ‘database locked’ message if the value of ‘use-sqlite-wal’ is changed from the default.
2011-11-21 nix: add /etc/hosts with localhost entry to chroot builds.Rob Vermaas1-0/+3
2011-11-07 * Boldly make SQLite WAL mode the default again. Hopefully theEelco Dolstra1-4/+3
intermittent problems are gone by now. WAL mode is preferrable because it does way fewer fsyncs.
2011-10-27 * In printValueAsXML, handle the case where a "type" attribute is notEelco Dolstra1-3/+6
a string. This happens in the NixOS option system. * Remove a bogus comparison of a unsigned integer with -1.
2011-09-12 * Ouch. A store upgrade could cause a substituter to be triggered,Eelco Dolstra3-5/+6
causing a deadlock.
2011-09-06 * Added a command ‘nix-store --verify-paths PATHS’ to check whetherEelco Dolstra4-7/+35
the contents of any of the given store paths have been modified. E.g. $ nix-store --verify-path $(nix-store -qR /var/run/current-system) path `/nix/store/m2smyiwbxidlprfxfz4rjlvz2c3mg58y-etc' was modified! expected hash `fc87e271c5fdf179b47939b08ad13440493805584b35e3014109d04d8436e7b8', got `20f1a47281b3c0cbe299ce47ad5ca7340b20ab34246426915fce0ee9116483aa' All paths are checked; the exit code is 1 if any path has been modified, 0 otherwise.
2011-08-31 * Eliminate all uses of the global variable ‘store’ from libstore.Eelco Dolstra15-89/+95
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 Dolstra2-11/+22
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 Dolstra1-1/+2
2011-08-06 * Remove a debug statement.Eelco Dolstra1-1/+0
2011-08-06 * Add the Nix corepkgs to the end of the search path. This makes itEelco Dolstra1-0/+2
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 Dolstra2-6/+25
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 Dolstra8-6/+76
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 Dolstra10-52/+37
the EvalState class.
2011-07-20 * Don't allow derivations with fixed and non-fixed outputs.Eelco Dolstra1-43/+38
2011-07-20 * Fix a huuuuge security hole in the Nix daemon. It didn't check thatEelco Dolstra9-81/+180
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 Dolstra1-45/+84
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 Dolstra1-0/+2
allow-arbitrary-strinsg-in-names patch by Marc Weber.
2011-07-13 * Allow a default value in attribute selection by writingEelco Dolstra5-21/+43
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 Dolstra4-18/+33
an attribute path. This is a refactoring to support default values.
2011-07-06 * In the ‘?’ operator, allow attribute paths. For instance, you canEelco Dolstra4-24/+47
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-06-30 Add support for the `build-timeout' and `--timeout' options.Ludovic Courtès4-4/+38
2011-04-19 * Handle error messages from the Nix worker containing the `%'Eelco Dolstra1-1/+1
character. (Nix/216)
2011-04-11 * `nix-env -ub' (`--prebuilt-only') didn't really work because itEelco Dolstra1-17/+20
checked too soon whether substitutes are available. That is, it did so for every available package, rather than those matching installed packages. This was very slow and subject to assertion failures. So do the check much later. Idem for `nix-env -qab' and `nix-env -ib'.
2011-02-10 * Don't allocate a big initial GC address space on machines withEelco Dolstra1-11/+24
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 Dolstra2-12/+18
collector.
2011-02-09 Use $BDW_GC_LIBS instead of a custom variable.Ludovic Courtès2-2/+2
2011-02-09 * Sync with the trunk.Eelco Dolstra1-2/+0
2011-02-05 * Clang compatibility fix. Clang actually checks template definitionsEelco Dolstra1-1/+1
when they are defined
2011-01-14 Remove useless <config.h> inclusion from public header.Ludovic Courtès1-2/+0
2011-01-14 * builtins.substring: if "start" is beyond the end of the string,Eelco Dolstra1-1/+1
return the empty string.
2010-12-17 * Do a short sleep after SQLITE_BUSY.Eelco Dolstra1-0/+11
2010-12-17 * Propagate the "100" exit status for failed builds through the NixEelco Dolstra3-5/+9
daemon.
2010-12-14 * I forgot to catch SQLiteBusy in registerValidPaths(). SoEelco Dolstra1-38/+31
registerValidPaths() now handles busy errors and registerValidPath() is simply a wrapper around it.
2010-12-13 * nix-instantiate: return exit status 100 to denote a permanent buildEelco Dolstra4-7/+22
failure. The build hook can use this to distinguish between transient and permanent failures on the remote side.
2010-12-13 * Create /nix/var/nix/db if it's missing.Eelco Dolstra1-0/+1
2010-12-13 * createDirs(path): if path already exists, make sure it's aEelco Dolstra2-20/+26
directory. * Provide a C++ wrapper around lstat().
2010-12-13 * Update some comments.Eelco Dolstra2-4/+3
2010-12-08 * Ignore the result of sqlite3_reset().Eelco Dolstra1-3/+4
2010-12-06 * `nix-store --verify --check-contents': don't hold the global GC lockEelco Dolstra2-11/+49
while checking the contents, since this operation can take a very long time to finish. Also, fill in missing narSize fields in the DB while doing this.
2010-12-05 * Retry a transaction if SQLite returns SQLITE_BUSY. This can happenEelco Dolstra1-61/+83
even with a very long busy timeout, because SQLITE_BUSY is also returned to resolve deadlocks. This should get rid of random "database is locked" errors. This is kind of hard to test though. * Fix a horrible bug in deleteFromStore(): deletePathWrapped() should be called after committing the transaction, not before, because the commit might not succeed.
2010-11-29 * Quick hack around one of the pathological cases in bsdiffEelco Dolstra1-0/+1
(namely, when there is a long region of 0s). On one 86 MiB case, this cut patch generation time from 44m to 2m.
2010-11-25 * Sync with the trunk.Eelco Dolstra1-0/+4
2010-11-25 * DrvInfo contains pointers to expressions, so DrvInfos should beEelco Dolstra1-0/+4
traced by the garbage collector. Otherwise "nix-env -u" can crash randomly.
2010-11-17 * Before a build, show the disk space that the downloaded store pathsEelco Dolstra8-12/+18
will approximately require.