about summary refs log tree commit diff
path: root/src/libutil/util.hh
AgeCommit message (Collapse)AuthorFilesLines
2015-11-16 AutoDelete: Add default constructor with deletion disabledShea Levy1-0/+2
2015-11-09 Fix namespace issueEelco Dolstra1-2/+2
2015-10-29 int2String() -> std::to_string()Eelco Dolstra1-7/+0
2015-10-01 nix-prefetch-url: Rewrite in C++Eelco Dolstra1-0/+1
2015-07-20 Support systemd log severity prefixesEelco Dolstra1-1/+2
This is mostly useful for hydra-queue-runner.
2015-07-17 OCD: foreach -> C++11 ranged forEelco Dolstra1-7/+0
2015-06-17 Support URLs in $NIX_PATHEelco Dolstra1-0/+5
This didn't work (despite claims in the manual), because the colon in "http://" was parsed as a element separator. So handle "://" specially.
2015-06-09 Use std::vector::data()Eelco Dolstra1-1/+1
2015-04-09 Implement caching of fetchurl/fetchTarball resultsEelco Dolstra1-0/+7
ETags are used to prevent redownloading unchanged files.
2015-02-10 Add base64 encoder/decoderEelco Dolstra1-0/+5
2015-02-04 Use libsodium instead of OpenSSL for binary cache signingEelco Dolstra1-1/+1
Sodium's Ed25519 signatures are much shorter than OpenSSL's RSA signatures. Public keys are also much shorter, so they're now specified directly in the nix.conf option ‘binary-cache-public-keys’. The new command ‘nix-store --generate-binary-cache-key’ generates and prints a public and secret key.
2014-12-12 Fix some memory leaksEelco Dolstra1-0/+5
2014-12-12 Ensure we're writing to stderr in the builderEelco Dolstra1-0/+1
http://hydra.nixos.org/build/17862041
2014-12-10 Use vforkEelco Dolstra1-2/+10
2014-11-19 nix-daemon: Call exit(), not _exit()Eelco Dolstra1-1/+1
This was preventing destructors from running. In particular, it was preventing the deletion of the temproot file for each worker process. It may also have been responsible for the excessive WAL growth on Hydra (due to the SQLite database not being closed properly). Apparently broken by accident in 8e9140cfdef9dbd1eb61e4c75c91d452ab5e4a74.
2014-10-03 Remove some duplicate codeEelco Dolstra1-0/+2
2014-08-21 Use PR_SET_PDEATHSIG to ensure child cleanupEelco Dolstra1-1/+2
2014-08-20 Add some colorEelco Dolstra1-0/+12
2014-08-04 Get rid of "killing <pid>" message for unused build hooksEelco Dolstra1-1/+1
2014-08-01 Eliminate redundant copyEelco Dolstra1-0/+2
2014-08-01 Make readDirectory() return inode / file typeEelco Dolstra1-1/+10
2014-07-31 Restore default SIGPIPE handler before invoking ‘man’Eelco Dolstra1-0/+4
Fixes NixOS/nixpkgs#3410.
2014-07-10 Refactoring: Move all fork handling into a higher-order functionEelco Dolstra1-0/+7
C++11 lambdas ftw.
2014-07-10 Remove maybeVforkEelco Dolstra1-3/+0
2014-05-21 nix-store -l: Fetch build logs from the InternetEelco Dolstra1-0/+2
If a build log is not available locally, then ‘nix-store -l’ will now try to download it from the servers listed in the ‘log-servers’ option in nix.conf. For instance, if you have: log-servers = http://hydra.nixos.org/log then it will try to get logs from http://hydra.nixos.org/log/<base name of the store path>. So you can do things like: $ nix-store -l $(which xterm) and get a log even if xterm wasn't built locally.
2014-04-08 If a .drv cannot be parsed, show its pathEelco Dolstra1-0/+2
Otherwise you just get ‘expected string `Derive(['’ which isn't very helpful.
2014-03-28 Don't interpret strings as format stringsEelco Dolstra1-3/+3
Ludo reported this error: unexpected Nix daemon error: boost::too_few_args: format-string refered to more arguments than were passed coming from this line: printMsg(lvlError, run.program + ": " + string(err, 0, p)); The problem here is that the string ends up implicitly converted to a Boost format() object, so % characters are treated specially. I always assumed (wrongly) that strings are converted to a format object that outputs the string as-is. Since this assumption appears in several places that may be hard to grep for, I've added some C++ type hackery to ensures that the right thing happens. So you don't have to worry about % in statements like printMsg(lvlError, "foo: " + s); or throw Error("foo: " + s);
2014-02-27 Set up a minimal /dev in chrootsEelco Dolstra1-0/+3
Not bind-mounting the /dev from the host also solves the problem with /dev/shm being a symlink to something not in the chroot.
2014-02-26 Remove another unused functionEelco Dolstra1-3/+0
2014-02-26 Remove unused functionEelco Dolstra1-4/+0
2013-11-14 Remove nix-setuid-helperEelco Dolstra1-4/+0
AFAIK, nobody uses it, it's not maintained, and it has no tests.
2013-08-19 Store Nix integers as longsEelco Dolstra1-1/+6
So on 64-bit systems, integers are now 64-bit. Fixes #158.
2013-07-12 Garbage collector: Don't follow symlinks arbitrarilyEelco Dolstra1-0/+4
Only indirect roots (symlinks to symlinks to the Nix store) are now supported.
2013-01-03 Remove tabsEelco Dolstra1-2/+2
2012-11-26 Make "nix-build -A <derivation>.<output>" do the right thingEelco Dolstra1-0/+1
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-1/+3
Slightly scared of using std::cerr in a vforked process...
2012-11-09 Use vfork() instead of fork() if availableEelco Dolstra1-0/+3
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 the quickExit functionEelco Dolstra1-4/+0
2012-09-28 Handle octal escapes in /proc/self/mountinfoEelco Dolstra1-0/+6
2012-09-19 Templatise tokenizeString()Eelco Dolstra1-1/+1
2012-08-27 Merge branch 'master' into no-manifestsEelco Dolstra1-3/+5
2012-08-20 In the chroot, make all mounted filesystems privateEelco Dolstra1-1/+1
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-12 Add some basic profiling support to the evaluatorEelco Dolstra1-0/+3
Setting the environment variable NIX_COUNT_CALLS to 1 enables some basic profiling in the evaluator. It will count calls to functions and primops as well as evaluations of attributes. For example, to see where evaluation of a NixOS configuration spends its time: $ NIX_SHOW_STATS=1 NIX_COUNT_CALLS=1 ./src/nix-instantiate/nix-instantiate '<nixos>' -A system --readonly-mode ... calls to 39 primops: 239532 head 233962 tail 191252 hasAttr ... calls to 1595 functions: 224157 `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/lists.nix:17:19' 221767 `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/lists.nix:17:14' 221767 `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/lists.nix:17:10' ... evaluations of 7088 attributes: 167377 undefined position 132459 `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/attrsets.nix:119:41' 47322 `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/attrsets.nix:13:21' ...
2012-08-01 Drop the block count in the garbage collectorEelco Dolstra1-2/+1
2012-08-01 Report substituter errors to clients of the Nix daemonEelco Dolstra1-0/+4
2012-07-26 Set permissions on temporary build directories to 0700Eelco Dolstra1-1/+1
Fixes #39.
2012-07-18 Use "#pragma once" to prevent repeated header file inclusionEelco Dolstra1-5/+1
2012-03-05 Set the close-on-exec flag on file descriptorsEelco Dolstra1-0/+3
2011-12-22 * In the garbage collector, delete invalid paths before deletingEelco Dolstra1-0/+1
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 * createDirs(path): if path already exists, make sure it's aEelco Dolstra1-0/+4
directory. * Provide a C++ wrapper around lstat().