about summary refs log tree commit diff
path: root/src/libutil
AgeCommit message (Collapse)AuthorFilesLines
2014-07-16 Get rid of a compiler warningEelco Dolstra1-1/+2
2014-07-16 Be more strict about file names in NARsEelco Dolstra1-1/+6
2014-07-16 Handle case collisions on case-insensitive systemsEelco Dolstra2-75/+100
When running NixOps under Mac OS X, we need to be able to import store paths built on Linux into the local Nix store. However, HFS+ is usually case-insensitive, so if there are directories with file names that differ only in case, then importing will fail. The solution is to add a suffix ("~nix~case~hack~<integer>") to colliding files. For instance, if we have a directory containing xt_CONNMARK.h and xt_connmark.h, then the latter will be renamed to "xt_connmark.h~nix~case~hack~1". If a store path is dumped as a NAR, the suffixes are removed. Thus, importing and exporting via a case-insensitive Nix store is round-tripping. So when NixOps calls nix-copy-closure to copy the path to a Linux machine, you get the original file names back. Closes #119.
2014-07-10 Fix broken Pid constructorEelco Dolstra1-5/+2
2014-07-10 Refactoring: Move all fork handling into a higher-order functionEelco Dolstra2-54/+60
C++11 lambdas ftw.
2014-07-10 Remove maybeVforkEelco Dolstra2-11/+1
2014-07-09 Fix compilation error on some versions of GCCEelco Dolstra1-2/+2
src/libexpr/primops.cc:42:8: error: looser throw specifier for 'virtual nix::InvalidPathError::~InvalidPathError()' src/libexpr/nixexpr.hh:12:1: error: overriding 'virtual nix::EvalError::~EvalError() noexcept (true)' http://hydra.nixos.org/build/12385750
2014-06-12 Don't use member initialisersEelco Dolstra1-4/+4
They're a little bit too recent (only supported since GCC 4.7). http://hydra.nixos.org/build/11851475
2014-06-12 Fix bogus warnings about dumping large pathsEelco Dolstra1-2/+2
Also, yay for C++11 non-static initialisers.
2014-06-10 Print a warning when loading a large path into memoryEelco Dolstra2-4/+30
I.e. if you have a derivation with src = ./huge-directory; you'll get a warning that this is not a good idea.
2014-05-21 nix-store -l: Fetch build logs from the InternetEelco Dolstra2-1/+3
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 Dolstra2-1/+3
Otherwise you just get ‘expected string `Derive(['’ which isn't very helpful.
2014-04-03 Tweak error messageEelco Dolstra1-1/+1
2014-03-28 Don't interpret strings as format stringsEelco Dolstra3-23/+32
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-03-12 Remove unnecessary null pointer checksEelco Dolstra1-2/+2
Fixes #225.
2014-02-27 Set up a minimal /dev in chrootsEelco Dolstra3-2/+11
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 And another oneEelco Dolstra2-41/+2
2014-02-26 Remove another unused functionEelco Dolstra2-22/+0
2014-02-26 Remove unused functionEelco Dolstra2-32/+0
2014-02-01 Remove AutomakefilesEelco Dolstra1-18/+0
2014-02-01 Update Makefile variable namesEelco Dolstra1-1/+1
2014-01-30 Rename Makefile -> local.mkEelco Dolstra1-0/+0
2014-01-09 Update MakefilesEelco Dolstra1-2/+2
2013-11-25 Rename Makefile.new -> MakefileEelco Dolstra1-0/+0
2013-11-23 Use libnix as a prefix for all Nix librariesEelco Dolstra1-0/+2
In particular "libutil" was always a problem because it collides with Glibc's libutil. Even if we install into $(libdir)/nix, the linker sometimes got confused (e.g. if a program links against libstore but not libutil, then ld would report undefined symbols in libstore because it was looking at Glibc's libutil).
2013-11-23 Allow (dynamic) libraries to depend on other librariesEelco Dolstra1-1/+1
2013-11-22 Support building dynamic librariesEelco Dolstra1-2/+2
2013-11-22 Drop the dependency on AutomakeEelco Dolstra1-1/+3
2013-11-22 Rename $(here) to $(d) for brevity, and remove trailing slashEelco Dolstra1-4/+5
2013-11-22 New non-recursive, plain Make-based build systemEelco Dolstra1-0/+10
2013-11-14 Remove nix-setuid-helperEelco Dolstra2-17/+0
AFAIK, nobody uses it, it's not maintained, and it has no tests.
2013-09-17 RestoreSink: Slightly reduce the number of concurrent FDsEelco Dolstra1-0/+1
2013-09-06 Don't apply the CPU affinity hack to nix-shell (and other Perl programs)Eelco Dolstra1-6/+5
As discovered by Todd Veldhuizen, the shell started by nix-shell has its affinity set to a single CPU. This is because nix-shell connects to the Nix daemon, which causes the affinity hack to be applied. So we turn this off for Perl programs.
2013-08-26 Fix typos, especially those that end up in the Nix manualIvan Kozik2-3/+3
2013-08-19 Store Nix integers as longsEelco Dolstra2-9/+6
So on 64-bit systems, integers are now 64-bit. Fixes #158.
2013-08-07 Fix build on non-LinuxEelco Dolstra1-0/+2
http://hydra.nixos.org/build/5662914
2013-08-07 Run the daemon worker on the same CPU as the clientEelco Dolstra3-2/+65
On a system with multiple CPUs, running Nix operations through the daemon is significantly slower than "direct" mode: $ NIX_REMOTE= nix-instantiate '<nixos>' -A system real 0m0.974s user 0m0.875s sys 0m0.088s $ NIX_REMOTE=daemon nix-instantiate '<nixos>' -A system real 0m2.118s user 0m1.463s sys 0m0.218s The main reason seems to be that the client and the worker get moved to a different CPU after every call to the worker. This patch adds a hack to lock them to the same CPU. With this, the overhead of going through the daemon is very small: $ NIX_REMOTE=daemon nix-instantiate '<nixos>' -A system real 0m1.074s user 0m0.809s sys 0m0.098s
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 Dolstra2-0/+13
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-06-07 Process stderr from substituters while doing have/info queriesEelco Dolstra2-0/+8
2013-01-03 Remove tabsEelco Dolstra2-46/+46
2013-01-03 Clear any immutable bits in the Nix storeEelco Dolstra4-64/+2
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 Dolstra2-1/+14
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 Dolstra2-16/+23
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 Dolstra2-3/+14
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 Dolstra2-13/+3
2012-10-23 If hashes do not match, print them in base-32 for SHA-1/SHA-256Eelco Dolstra2-0/+9
Fixes #57.