about summary refs log tree commit diff
path: root/src/libstore
AgeCommit message (Collapse)AuthorFilesLines
2012-12-20 nix-store -q --roots: Respect the gc-keep-outputs/gc-keep-derivations settingsEelco Dolstra7-24/+59
So if a path is not garbage solely because it's reachable from a root due to the gc-keep-outputs or gc-keep-derivations settings, ‘nix-store -q --roots’ now shows that root.
2012-12-20 Yet another rewrite of the garbage collectorEelco Dolstra2-131/+138
But this time it's *obviously* correct! No more segfaults due to infinite recursions for sure, etc. Also, move directories to /nix/store/trash instead of renaming them to /nix/store/bla-gc-<pid>. Then we can just delete /nix/store/trash at the end.
2012-12-19 If gc-keep-derivations is set, only keep the actual deriverEelco Dolstra1-1/+1
This prevents zillions of derivations from being kept, and fixes an infinite recursion in the garbage collector (due to an obscure cycle that can occur with fixed-output derivations).
2012-12-19 Kill the build hook rather than shutting it down cleanlyEelco Dolstra1-7/+1
Waiting for the hook to shut down cleanly sometimes seems to lead to hangs.
2012-12-18 Revert brain fartEelco Dolstra1-2/+0
This reverts commit cc511fd65b7b6de9e87e72fb4bed16fc7efeb8b7.
2012-12-18 Check for potential infinite select() loops when buildingEelco Dolstra1-0/+2
2012-12-11 On SQLITE_BUSY, wait a random amount of timeEelco Dolstra1-1/+1
If all contending processes wait a fixed amount of time (100 ms), there is a good probability that they'll just collide again.
2012-11-27 Add builtin constants ‘langVersion’ and ‘nixVersion’Eelco Dolstra3-0/+7
The integer constant ‘langVersion’ denotes the current language version. It gets increased every time a language feature is added/changed/removed. It's currently 1. The string constant ‘nixVersion’ contains the current Nix version, e.g. "1.2pre2980_9de6bc5".
2012-11-26 queryMissing(): Handle partially valid derivationsEelco Dolstra1-5/+6
2012-11-26 Only substitute wanted outputs of a derivationEelco Dolstra4-21/+77
If a derivation has multiple outputs, then we only want to download those outputs that are actuallty needed. So if we do "nix-build -A openssl.man", then only the "man" output should be downloaded. Likewise if another package depends on ${openssl.man}. The tricky part is that different derivations can depend on different outputs of a given derivation, so we may need to restart the corresponding derivation goal if that happens.
2012-11-26 Make "nix-build -A <derivation>.<output>" do the right thingEelco Dolstra4-7/+38
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 Disable use of vfork()Eelco Dolstra1-1/+1
vfork() is just too weird. For instance, in this build: http://hydra.nixos.org/build/3330487 the value fromHook.writeSide becomes corrupted in the parent, even though the child only reads from it. At -O0 the problem goes away. Probably the child is overriding some spilled temporary variable. If I get bored I may implement using posix_spawn() instead.
2012-11-15 Don't use std::cerr in a few placesEelco Dolstra2-11/+9
Slightly scared of using std::cerr in a vforked process...
2012-11-09 Use vfork() instead of fork() if availableEelco Dolstra3-19/+33
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 definition of non-existant functionEelco Dolstra1-2/+0
2012-11-09 Remove some redundant close() callsEelco Dolstra2-8/+0
They are unnecessary because we set the close-on-exec flag.
2012-11-09 Remove the quickExit functionEelco Dolstra2-5/+5
2012-11-09 Remove a Darwin hack that should no longer be neededEelco Dolstra1-7/+0
2012-11-09 Don't start copy-from-other-stores if $NIX_OTHER_STORES is unsetEelco Dolstra1-1/+2
Slight optimisation.
2012-11-09 Remove unnecessary call to closeMostFDs()Eelco Dolstra1-1/+0
We have close-on-exec on all FDs now, and there is no security risk in passing open FDs to substituters anyway.
2012-11-06 canonicalizePathMetaData: Fall-back to utimes if lutimes fails due to ENOSYSShea Levy1-0/+2
2012-10-23 If hashes do not match, print them in base-32 for SHA-1/SHA-256Eelco Dolstra1-1/+1
Fixes #57.
2012-10-11 Shorten the names of temporary build directoriesEelco Dolstra1-1/+1
2012-10-04 nix-store --verify: Continue on errorsEelco Dolstra1-2/+4
2012-10-04 Fix regular expressionEelco Dolstra1-1/+1
http://hydra.nixos.org/build/3123177
2012-10-03 Drop support for running nix-worker in "slave" modeEelco Dolstra1-55/+3
AFAIK nobody uses this, setuid binaries are evil, and there is no good reason why people can't just run the daemon.
2012-10-03 Remove bin2cEelco Dolstra2-1/+3
2012-10-03 nix-env: Support ‘--repair’ flagEelco Dolstra1-2/+4
2012-10-03 Add a ‘--repair’ flag to nix-instantiateEelco Dolstra7-21/+25
This allows repairing corrupted derivations and other source files.
2012-10-03 Handle repairing paths that are in build-chroot-dirsEelco Dolstra1-0/+7
2012-10-03 When repairing a derivation, check and repair the entire output closureEelco Dolstra3-6/+91
If we find a corrupted path in the output closure, we rebuild the derivation that produced that particular path.
2012-10-02 Add a --repair flag to ‘nix-store -r’ to repair derivation outputsEelco Dolstra6-63/+113
With this flag, if any valid derivation output is missing or corrupt, it will be recreated by using a substitute if available, or by rebuilding the derivation. The latter may use hash rewriting if chroots are not available.
2012-10-02 nix-store --verify: Add an option ‘--repair’ to repair all ↵Eelco Dolstra2-8/+24
missing/corrupt paths Also, return a non-zero exit code if errors remain after verifying/repairing.
2012-10-02 Add operation ‘nix-store --repair-path’Eelco Dolstra2-28/+71
This operation allows fixing corrupted or accidentally deleted store paths by redownloading them using substituters, if available. Since the corrupted path cannot be replaced atomically, there is a very small time window (one system call) during which neither the old (corrupted) nor the new (repaired) contents are available. So repairing should be used with some care on critical packages like Glibc.
2012-09-28 Handle octal escapes in /proc/self/mountinfoEelco Dolstra1-2/+3
2012-09-28 Print a more descriptive error message if setting up the build environment failsEelco Dolstra1-3/+14
2012-09-25 Make the store writable before creating /nix/store/.linksEelco Dolstra1-2/+1
2012-09-25 Merge branch 'readonly-store'Eelco Dolstra6-99/+92
2012-09-25 Include <sys/types.h> for off_tEelco Dolstra1-0/+1
Reported by "gio" on IRC.
2012-09-19 Remove setting of the immutable bitEelco Dolstra3-70/+33
Using the immutable bit is problematic, especially in conjunction with store optimisation. For instance, if the garbage collector deletes a file, it has to clear its immutable bit, but if the file has additional hard links, we can't set the bit afterwards because we don't know the remaining paths. So now that we support having the entire Nix store as a read-only mount, we may as well drop the immutable bit. Unfortunately, we have to keep the code to clear the immutable bit for backwards compatibility.
2012-09-19 Support having /nix/store as a read-only bind mountEelco Dolstra2-0/+41
It turns out that the immutable bit doesn't work all that well. A better way is to make the entire Nix store a read-only bind mount, i.e. by doing $ mount --bind /nix/store /nix/store $ mount -o remount,ro,bind /nix/store (This would typically done in an early boot script, before anything from /nix/store is used.) Since Nix needs to be able to write to the Nix store, it now detects if /nix/store is a read-only bind mount and then makes it writable in a private mount namespace.
2012-09-19 Templatise tokenizeString()Eelco Dolstra4-29/+18
2012-09-18 Keep build directory if not all expected outputs were producedEelco Dolstra1-3/+3
Fixes issue #123 in Nixpkgs.
2012-09-13 RemoteStore::connectToDaemon(): Set close-on-exec flagEelco Dolstra1-0/+1
This ensures that "nix-build --run-env" doesn't keep a connection to the worker open, preventing it from exiting.
2012-09-13 Vacuum the SQLite DB after running the garbage collectorEelco Dolstra3-0/+12
2012-09-13 Delete paths in a component in topologically sorted orderEelco Dolstra1-1/+3
The outputs of a derivation can refer to each other (even though they cannot have cycles), so they have to be deleted in the right order. http://hydra.nixos.org/build/3026118
2012-09-13 Disable auto store optimisation for nowEelco Dolstra1-1/+1
I've seen operations like "nix-store --import" take much longer on one system. So default to off until I've investigated this a bit further.
2012-09-13 In startBuilder(), only print the new paths we're buildingEelco Dolstra1-2/+3
2012-09-12 Handle gc-keep-outputs and gc-keep-derivations both enabledEelco Dolstra1-94/+97
If the options gc-keep-outputs and gc-keep-derivations are both enabled, you can get a cycle in the liveness graph. There was a hack to handle this, but it didn't work with multiple-output derivations, causing the garbage collector to fail with errors like ‘error: cannot delete path `...' because it is in use by `...'’. The garbage collector now handles strongly connected components in the liveness graph as a unit and decides whether to delete all or none of the paths in an SCC.
2012-09-12 Build hook: Pass the timeout to the remote builderEelco Dolstra1-1/+1
Note that this will only work if the client has a very recent Nix version (post 15e1b2c223494ecb5efefc3ea0e3b926a6b1d7dc), otherwise the --option flag will just be ignored. Fixes #50.