about summary refs log tree commit diff
path: root/src/libutil/util.cc
AgeCommit message (Collapse)AuthorFilesLines
2014-02-26 Remove another unused functionEelco Dolstra1-19/+0
2014-02-26 Remove unused functionEelco Dolstra1-28/+0
2013-11-14 Remove nix-setuid-helperEelco Dolstra1-13/+0
AFAIK, nobody uses it, it's not maintained, and it has no tests.
2013-08-26 Fix typos, especially those that end up in the Nix manualIvan Kozik1-2/+2
2013-08-19 Store Nix integers as longsEelco Dolstra1-8/+0
So on 64-bit systems, integers are now 64-bit. Fixes #158.
2013-07-30 killUser: Don't let the child kill itself on AppleShea Levy1-0/+13
The kill(2) in Apple's libc follows POSIX semantics, which means that kill(-1, SIGKILL) will kill the calling process too. Since nix has no way to distinguish between the process successfully killing everything and the process being killed by a rogue builder in that case, it can't safely conclude that killUser was successful. Luckily, the actual kill syscall takes a parameter that determines whether POSIX semantics are followed, so we can call that syscall directly and avoid the issue on Apple. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-12 Garbage collector: Don't follow symlinks arbitrarilyEelco Dolstra1-0/+9
Only indirect roots (symlinks to symlinks to the Nix store) are now supported.
2013-06-20 Don't keep "disabled" substituters runningEelco Dolstra1-0/+1
For instance, it's pointless to keep copy-from-other-stores running if there are no other stores, or download-using-manifests if there are no manifests. This also speeds things up because we don't send queries to those substituters.
2013-01-03 Remove tabsEelco Dolstra1-44/+44
2013-01-03 Clear any immutable bits in the Nix storeEelco Dolstra1-3/+0
Doing this once makes subsequent operations like garbage collecting more efficient since we don't have to call makeMutable() first.
2012-11-26 Make "nix-build -A <derivation>.<output>" do the right thingEelco Dolstra1-1/+13
For example, given a derivation with outputs "out", "man" and "bin": $ nix-build -A pkg produces ./result pointing to the "out" output; $ nix-build -A pkg.man produces ./result-man pointing to the "man" output; $ nix-build -A pkg.all produces ./result, ./result-man and ./result-bin; $ nix-build -A pkg.all -A pkg2 produces ./result, ./result-man, ./result-bin and ./result-2.
2012-11-15 Don't use std::cerr in a few placesEelco Dolstra1-15/+20
Slightly scared of using std::cerr in a vforked process...
2012-11-15 Add some debug codeEelco Dolstra1-1/+1
2012-11-09 Use vfork() instead of fork() if availableEelco Dolstra1-3/+11
Hopefully this reduces the chance of hitting ‘unable to fork: Cannot allocate memory’ errors. vfork() is used for everything except starting builders.
2012-11-09 Remove some redundant close() callsEelco Dolstra1-10/+8
They are unnecessary because we set the close-on-exec flag.
2012-11-09 Remove the quickExit functionEelco Dolstra1-9/+3
2012-09-28 Handle octal escapes in /proc/self/mountinfoEelco Dolstra1-0/+15
2012-09-19 Templatise tokenizeString()Eelco Dolstra1-2/+5
2012-08-27 Merge branch 'master' into no-manifestsEelco Dolstra1-15/+10
2012-08-20 In the chroot, make all mounted filesystems privateEelco Dolstra1-2/+2
This is required on systemd, which mounts filesystems as "shared" subtrees. Changes to shared trees in a private mount namespace are propagated to the outside world, which is bad.
2012-08-01 Drop the block count in the garbage collectorEelco Dolstra1-13/+8
2012-08-01 DohEelco Dolstra1-1/+1
2012-08-01 Report substituter errors to clients of the Nix daemonEelco Dolstra1-1/+8
2012-07-26 Set permissions on temporary build directories to 0700Eelco Dolstra1-2/+2
Fixes #39.
2012-06-25 When using chroots, use a private PID namespaceEelco Dolstra1-2/+5
In a private PID namespace, processes have PIDs that are separate from the rest of the system. The initial child gets PID 1. Processes in the chroot cannot see processes outside of the chroot. This improves isolation between builds. However, processes on the outside can see processes in the chroot and send signals to them (if they have appropriate rights). Since the builder gets PID 1, it serves as the reaper for zombies in the chroot. This might turn out to be a problem. In that case we'll need to have a small PID 1 process that sits in a loop calling wait().
2012-03-05 Set the close-on-exec flag on file descriptorsEelco Dolstra1-0/+12
2012-02-15 On Linux, make the Nix store really read-only by using the immutable bitEelco Dolstra1-0/+3
I was bitten one time too many by Python modifying the Nix store by creating *.pyc files when run as root. On Linux, we can prevent this by setting the immutable bit on files and directories (as in ‘chattr +i’). This isn't supported by all filesystems, so it's not an error if setting the bit fails. The immutable bit is cleared by the garbage collector before deleting a path. The only tricky aspect is in optimiseStore(), since it's forbidden to create hard links to an immutable file. Thus optimiseStore() temporarily clears the immutable bit before creating the link.
2012-02-09 Use data() instead of c_str() where appropriateEelco Dolstra1-3/+3
2011-12-22 * In the garbage collector, delete invalid paths before deletingEelco Dolstra1-1/+9
unreachable paths. This matters when using --max-freed etc.: unreachable paths could become reachable again, so it's nicer to keep them if there is "real" garbage to be deleted. Also, don't use readDirectory() but read the Nix store and delete invalid paths in parallel. This reduces GC latency on very large Nix stores.
2010-12-13 * nix-instantiate: return exit status 100 to denote a permanent buildEelco Dolstra1-1/+2
failure. The build hook can use this to distinguish between transient and permanent failures on the remote side.
2010-12-13 * createDirs(path): if path already exists, make sure it's aEelco Dolstra1-20/+22
directory. * Provide a C++ wrapper around lstat().
2010-10-04 * Sync with the trunk.Eelco Dolstra1-1/+10
2010-10-04 * In printMsg(), ignore failing writes to stderr if we're in anEelco Dolstra1-1/+10
exception handler, otherwise throw an exception. We need to ignore write errors in exception handlers to ensure that cleanup code runs to completion if the other side of stderr has been closed unexpectedly.
2010-08-27 * Experimental feature: allow a derivation to tell the build hook thatEelco Dolstra1-0/+11
it requires a certain feature on the build machine, e.g. requiredSystemFeatures = [ "kvm" ]; We need this in Hydra to make sure that builds that require KVM support are forwarded to machines that have KVM support. Probably this should also be enforced for local builds.
2010-08-04 * Sync with the trunk.Eelco Dolstra1-0/+1
2010-06-24 src/libutil/util.cc: include <limit.h> to ensure that PATH_MAX is definedPeter Simons1-0/+1
2010-05-12 * Sync with the trunk.Eelco Dolstra1-47/+41
2010-04-20 * Sync with the trunk.Eelco Dolstra1-4/+6
2010-04-19 * Don't use the ATerm library for parsing/printing .drv files.Eelco Dolstra1-0/+41
2010-04-12 * Remove some obsolete functions.Eelco Dolstra1-47/+0
2010-03-19 * Clean up error messages in killUser().Eelco Dolstra1-4/+6
2010-02-24 * Don't use fdatasync since it doesn't work on Snow Leopard.Eelco Dolstra1-1/+1
* Don't refer to config.h in util.hh, because config.h is not installed (http://hydra.nixos.org/build/303053).
2010-02-24 * Remove the fdatasync check since it's no longer needed.Eelco Dolstra1-2/+1
2010-02-10 Don't rely on `PATH_MAX' on GNU.Ludovic Courtès1-0/+10
2010-02-02 * Remove most Cygwin-specific code. Cygwin 1.7 implements advisoryEelco Dolstra1-12/+0
POSIX locks, and simulates Unix-style file deletion semantics sufficiently. Note that this means that Nix won't work on Cygwin 1.5 anymore.
2010-01-29 * Added an option "fsync-metadata" to fsync() changes toEelco Dolstra1-11/+3
/nix/var/nix/db. * Removed the function writeStringToFile since it does (almost) the same thing as writeFile.
2009-11-24 * Templatise getIntArg / string2Int.Eelco Dolstra1-16/+0
2009-11-24 * In the garbage collector, don't count files with a link count > 1 inEelco Dolstra1-2/+4
the "bytes/blocks freed" statistics.
2009-06-30 * Don't show trace information by default (`--show-trace' to enable).Eelco Dolstra1-1/+1
NixOS evaluation errors in particular look intimidating and generally aren't very useful. Ideally the builtins.throw messages should be self-contained.
2009-03-28 * Simplify communication with the hook a bit (don't use fileEelco Dolstra1-0/+27
descriptors 3/4, just use stdin/stderr).