about summary refs log tree commit diff
path: root/src/libutil/util.hh
AgeCommit message (Collapse)AuthorFilesLines
2007-05-01 * Set a terminate() handler to ensure that we leave the BDBEelco Dolstra1-0/+5
environment cleanly even when an exception is thrown from a destructor. We still crash, but we don't take all other Nix processes with us.
2007-03-19 * Terminate build hooks and substitutes with a TERM signal, not a KILLEelco Dolstra1-0/+2
signal. This is necessary because those processes may have joined the BDB environment, so they have to be given a chance to clean up. (NIX-85)
2007-02-21 * `nix-store --import': import an archive created by `nix-storeEelco Dolstra1-1/+1
--export' into the Nix store, and optionally check the cryptographic signatures against /nix/etc/nix/signing-key.pub. (TODO: verify against a set of public keys.)
2007-02-21 * `nix-store --export --sign': sign the Nix archive using the RSA keyEelco Dolstra1-1/+2
in /nix/etc/nix/signing-key.sec
2006-12-12 * New primop builtins.filterSource, which can be used to filter filesEelco Dolstra1-2/+2
from a source directory. All files for which a predicate function returns true are copied to the store. Typical example is to leave out the .svn directory: stdenv.mkDerivation { ... src = builtins.filterSource (path: baseNameOf (toString path) != ".svn") ./source-dir; # as opposed to # src = ./source-dir; } This is important because the .svn directory influences the hash in a rather unpredictable and variable way.
2006-12-07 * Move setuidCleanup() to libutil.Eelco Dolstra1-0/+4
2006-12-07 * Move killUser() to libutil so that the setuid helper can use it.Eelco Dolstra1-0/+5
2006-12-04 * Daemon mode (`nix-worker --daemon'). Clients connect to the serverEelco Dolstra1-0/+17
via the Unix domain socket in /nix/var/nix/daemon.socket. The server forks a worker process per connection. * readString(): use the heap, not the stack. * Some protocol fixes.
2006-12-03 * Some hackery to propagate the worker's stderr and exceptions to theEelco Dolstra1-0/+2
client.
2006-12-02 * Remove most of the old setuid code.Eelco Dolstra1-4/+0
* Much simpler setuid code for the worker in slave mode.
2006-12-02 * Remove SwitchToOriginalUser, we're not going to need it anymore.Eelco Dolstra1-6/+0
2006-11-24 * Doh! Path sizes need to be computed recursively of course.Eelco Dolstra1-0/+3
(NIX-70)
2006-09-04 * Move setuid stuff to libutil.Eelco Dolstra1-3/+3
* Install libexpr header files.
2006-09-04 * Use a proper namespace.Eelco Dolstra1-54/+5
* Optimise header file usage a bit. * Compile the parser as C++.
2006-08-29 * Fix the ~ operator.Eelco Dolstra1-0/+2
2006-08-26 * Refactoring.Eelco Dolstra1-0/+1
2006-07-20 * Call find-runtime-roots.pl from the garbage collector to preventEelco Dolstra1-0/+14
running applications etc. from being garbage collected.
2006-07-06 * Allow the canonical system name to be specified at runtime in theEelco Dolstra1-4/+0
Nix config file.
2006-03-08 * Some refactoring of the exception handling code so that we can catchEelco Dolstra1-5/+9
Nix expression assertion failures.
2006-01-08 * Resolve all symlink components in the location of the temporaryEelco Dolstra1-2/+4
build directory (TMPDIR, i.e., /tmp). Fixes NIX-26.
2005-12-15 * `nix-store --gc' prints out the number of bytes freed on stdoutEelco Dolstra1-1/+4
(even when it is interrupted by a signal).
2005-09-22 * Parse multi-valued options.Eelco Dolstra1-0/+4
2005-03-24 * Create missing log and temproots directories automatically (reportedEelco Dolstra1-0/+3
by Rob).
2005-02-11 * Refactoring to support different installation sources in nix-env.Eelco Dolstra1-0/+8
* Set the references for the user environment manifest properly. * Don't copy the manifest (this was accidental). * Don't store derivation paths in the manifest (maybe this should be made optional). This cleans up the semantics of nix-env, which were weird. * Hash on the output paths of activated components, not on derivation paths. This is because we don't know the derivation path of already installed components anymore, and it allows the installation of components by store path (skipping Nix expressions entirely). * Query options `--out-path' and `--drv-path' to show the output and derivation paths of components, respectively (the latter replaces the `--expr' query).
2005-02-09 * Automatically upgrade <= 0.7 Nix stores to the new schema (so thatEelco Dolstra1-0/+3
existing user environments continue to work). * `nix-store --verify': detect incomplete closures.
2005-02-01 * A GC setting `gc-keep-outputs' to specify whether output paths ofEelco Dolstra1-0/+4
derivations should be kept.
2005-02-01 * nix-build: use an indirection scheme to make it easier for users toEelco Dolstra1-0/+2
get rid of GC roots. Nix-build places a symlink `result' in the current directory. Previously, removing that symlink would not remove the store path being linked to as a GC root. Now, the GC root created by nix-build is actually a symlink in `/nix/var/nix/gcroots/auto' to `result'. So if that symlink is removed the GC root automatically becomes invalid (since it can no longer be resolved). The root itself is not automatically removed - the garbage collector should delete dangling roots.
2005-01-31 * Start of concurrent garbage collection. Processes write temporaryEelco Dolstra1-1/+2
roots to a per-process temporary file in /nix/var/nix/temproots while holding a write lock on that file. The garbage collector acquires read locks on all those files, thus blocking further progress in other Nix processes, and reads the sets of temporary roots.
2005-01-27 * Make lock removal safe by signalling to blocked processes that theEelco Dolstra1-0/+1
lock they are waiting on has become stale (we do this by writing a meaningless token to the unlinked file).
2004-09-10 * Operation `--delete-generations' to delete generations of aEelco Dolstra1-0/+4
profile. Arguments are either generation number, or `old' to delete all non-current generations. Typical use: $ nix-env --delete-generations old $ nix-collect-garbage * istringstream -> string2Int.
2004-09-09 * A very dirty hack to make setuid installations a bit nicer to use.Eelco Dolstra1-0/+10
Previously there was the problem that all files read by nix-env etc. should be reachable and readable by the Nix user. So for instance building a Nix expression in your home directory meant that the home directory should have at least g+x or o+x permission so that the Nix user could reach the Nix expression. Now we just switch back to the original user just prior to reading sources and the like. The places where this happens are somewhat arbitrary, however. Any scope that has a live SwitchToOriginalUser object in it is executed as the original user. * Back out r1385. setreuid() sets the saved uid to the new real/effective uid, which prevents us from switching back to the original uid. setresuid() doesn't have this problem (although the manpage has a bug: specifying -1 for the saved uid doesn't leave it unchanged; an explicit value must be specified).
2004-06-22 * Put WEXITSTATUS stuff somewhere else.Eelco Dolstra1-0/+2
2004-06-22 * Wrapper class around pids.Eelco Dolstra1-0/+18
2004-06-22 * Refactoring.Eelco Dolstra1-0/+5
2004-06-20 * Refactoring.Eelco Dolstra1-0/+5
2004-06-15 * Refactoring.Eelco Dolstra1-0/+9
2004-05-12 * An quick and dirty hack to support distributed builds.Eelco Dolstra1-0/+3
2004-03-27 * Disallow the Nix store or any of its parents from being symlinks.Eelco Dolstra1-5/+8
This is because the contents of these symlinks are not incorporated into the hashes of derivations, and could therefore cause a mismatch between the build system and the target system. E.g., if `/nix/store' is a symlink to `/data/nix/store', then a builder could expand this path and store the result. If on the target system `/nix/store' is not a symlink, or is a symlink that points somewhere else, we have a dangling pointer. The trigger for this change is that gcc 3.3.3 does exactly that (it applies realpath() to some files, such as libraries, which causes our impurity checker to bail out.) An annoying side-effect of this change is that it makes it harder to move the Nix store to a different file system. On Linux, bind mounts can be used instead of symlink for this purpose (e.g., `mount -o bind /data/nix/store /nix/store').
2004-03-22 * Some more nesting.Eelco Dolstra1-0/+1
2004-03-22 * Nix now has three different formats for the log information itEelco Dolstra1-1/+9
writes to stderr: - `pretty': the old nested style (default) - `escapes': uses escape codes to indicate nesting and message level; can be processed using `log2xml' - `flat': just plain text, no nesting These can be set using `--log-type TYPE' or the NIX_LOG_TYPE environment variable.
2004-01-15 * Catch SIGINT to terminate cleanly when the user tries to interruptEelco Dolstra1-0/+13
Nix. This is to prevent Berkeley DB from becoming wedged. Unfortunately it is not possible to throw C++ exceptions from a signal handler. In fact, you can't do much of anything except change variables of type `volatile sig_atomic_t'. So we set an interrupt flag in the signal handler and check it at various strategic locations in the code (by calling checkInterrupt()). Since this is unlikely to cover all cases (e.g., (semi-)infinite loops), sometimes SIGTERM may now be required to kill Nix.
2004-01-05 * Implemented Eelco V.'s `nix-env -I' command to specify the defaultEelco Dolstra1-0/+4
path of the Nix expression to be used with the import, upgrade, and query commands. For instance, $ nix-env -I ~/nixpkgs/pkgs/system/i686-linux.nix $ nix-env --query --available [aka -qa] sylpheed-0.9.7 bison-1.875 pango-1.2.5 subversion-0.35.1 ... $ nix-env -i sylpheed $ nix-env -u subversion There can be only one default at a time. * If the path to a Nix expression is a symlink, follow the symlink prior to resolving relative path references in the expression.
2003-12-22 * Upgrade operation in `nix-env'. For instance, you can sayEelco Dolstra1-1/+2
nix-env -u foo.nix strategoxt to replace the installed `strategoxt' derivation with the one from `foo.nix', if the latter has a higher version number. This is a no-op if `strategoxt' is not installed. Wildcards are also accepted, so nix-env -u foo.nix '*' will replace any installed derivation with newer versions from `foo.nix', if available. The notion of "version number" is somewhat ad hoc, but should be useful in most cases, as evidenced by the following unit tests for the version comparator: TEST("1.0", "2.3", -1); TEST("2.1", "2.3", -1); TEST("2.3", "2.3", 0); TEST("2.5", "2.3", 1); TEST("3.1", "2.3", 1); TEST("2.3.1", "2.3", 1); TEST("2.3.1", "2.3a", 1); TEST("2.3pre1", "2.3", -1); TEST("2.3pre3", "2.3pre12", -1); TEST("2.3a", "2.3c", -1); TEST("2.3pre1", "2.3c", -1); TEST("2.3pre1", "2.3q", -1); (-1 = less, 0 = equal, 1 = greater) * A new verbosity level `lvlInfo', between `lvlError' and `lvlTalkative'. This is the default for `nix-env', so without any `-v' flags users should get useful output, e.g., $ nix-env -u foo.nix strategoxt upgrading `strategoxt-0.9.2' to `strategoxt-0.9.3'
2003-11-22 * Fix the garbage collector.Eelco Dolstra1-0/+5
2003-11-19 * nix-env: a tool to manage user environments.Eelco Dolstra1-0/+4
* Replace all directory reading code by a generic readDirectory() function.
2003-11-18 * Source tree refactoring.Eelco Dolstra1-0/+168