aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build.cc
AgeCommit message (Collapse)Author
2013-05-10In trace messages, don't print the output pathEelco Dolstra
This doesn't work if there is no output named "out". Hydra didn't use it anyway.
2013-05-09Communicate build timeouts to HydraEelco Dolstra
2013-05-09build-remote.pl: Enforce timeouts locallyEelco Dolstra
Don't pass --timeout / --max-silent-time to the remote builder. Instead, let the local Nix process terminate the build if it exceeds a timeout. The remote builder will be killed as a side-effect. This gives better error reporting (since the timeout message from the remote side wasn't properly propagated) and handles non-Nix problems like SSH hangs.
2013-04-23Fix --timeoutEelco Dolstra
I'm not sure if it has ever worked correctly. The line "lastWait = after;" seems to mean that the timer was reset every time a build produced log output. Note that the timeout is now per build, as documented ("the maximum number of seconds that a builder can run").
2013-04-23Nix daemon: respect build timeout from the clientEelco Dolstra
2013-04-04Complain if /homeless-shelter existsEelco Dolstra
2013-03-08Revert "Prevent config.h from being clobbered"Eelco Dolstra
This reverts commit 28bba8c44f484eae38e8a15dcec73cfa999156f6.
2013-03-07Prevent config.h from being clobberedEelco Dolstra
2013-02-26Security: Don't allow builders to change permissions on files they don't ownEelco Dolstra
It turns out that in multi-user Nix, a builder may be able to do ln /etc/shadow $out/foo Afterwards, canonicalisePathMetaData() will be applied to $out/foo, causing /etc/shadow's mode to be set to 444 (readable by everybody but writable by nobody). That's obviously Very Bad. Fortunately, this fails in NixOS's default configuration because /nix/store is a bind mount, so "ln" will fail with "Invalid cross-device link". It also fails if hard-link restrictions are enabled, so a workaround is: echo 1 > /proc/sys/fs/protected_hardlinks The solution is to check that all files in $out are owned by the build user. This means that innocuous operations like "ln ${pkgs.foo}/some-file $out/" are now rejected, but that already failed in chroot builds anyway.
2013-02-19Enable chroot support on old glibc versions.Ludovic Courtès
2013-01-17Store build logs in /nix/var/log/nix/drvs/<XX>Eelco Dolstra
...where <XX> is the first two characters of the derivation. Otherwise /nix/var/log/nix/drvs may become so large that we run into all sorts of weird filesystem limits/inefficiences. For instance, ext3/ext4 filesystems will barf with "ext4_dx_add_entry:1551: Directory index full!" once you hit a few million files.
2013-01-03Clear any immutable bits in the Nix storeEelco Dolstra
Doing this once makes subsequent operations like garbage collecting more efficient since we don't have to call makeMutable() first.
2013-01-02If a substitute closure is incomplete, build dependencies, then retry the ↵Eelco Dolstra
substituter Issue #77.
2013-01-02Automatically fall back if the references of a substitute are not substitutableEelco Dolstra
Fixes #77.
2012-12-29Allow mounting a path in a different location in the chrootEelco Dolstra
Fixes #24.
2012-12-19Kill the build hook rather than shutting it down cleanlyEelco Dolstra
Waiting for the hook to shut down cleanly sometimes seems to lead to hangs.
2012-12-18Revert brain fartEelco Dolstra
This reverts commit cc511fd65b7b6de9e87e72fb4bed16fc7efeb8b7.
2012-12-18Check for potential infinite select() loops when buildingEelco Dolstra
2012-11-26Only substitute wanted outputs of a derivationEelco Dolstra
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-26Make "nix-build -A <derivation>.<output>" do the right thingEelco Dolstra
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-15Disable use of vfork()Eelco Dolstra
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-15Don't use std::cerr in a few placesEelco Dolstra
Slightly scared of using std::cerr in a vforked process...
2012-11-09Use vfork() instead of fork() if availableEelco Dolstra
Hopefully this reduces the chance of hitting ‘unable to fork: Cannot allocate memory’ errors. vfork() is used for everything except starting builders.
2012-11-09Remove some redundant close() callsEelco Dolstra
They are unnecessary because we set the close-on-exec flag.
2012-11-09Remove the quickExit functionEelco Dolstra
2012-10-23If hashes do not match, print them in base-32 for SHA-1/SHA-256Eelco Dolstra
Fixes #57.
2012-10-11Shorten the names of temporary build directoriesEelco Dolstra
2012-10-03nix-env: Support ‘--repair’ flagEelco Dolstra
2012-10-03Handle repairing paths that are in build-chroot-dirsEelco Dolstra
2012-10-03When repairing a derivation, check and repair the entire output closureEelco Dolstra
If we find a corrupted path in the output closure, we rebuild the derivation that produced that particular path.
2012-10-02Add a --repair flag to ‘nix-store -r’ to repair derivation outputsEelco Dolstra
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-02Add operation ‘nix-store --repair-path’Eelco Dolstra
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-28Handle octal escapes in /proc/self/mountinfoEelco Dolstra
2012-09-28Print a more descriptive error message if setting up the build environment failsEelco Dolstra
2012-09-19Remove setting of the immutable bitEelco Dolstra
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-19Templatise tokenizeString()Eelco Dolstra
2012-09-18Keep build directory if not all expected outputs were producedEelco Dolstra
Fixes issue #123 in Nixpkgs.
2012-09-13In startBuilder(), only print the new paths we're buildingEelco Dolstra
2012-09-12Build hook: Pass the timeout to the remote builderEelco Dolstra
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.
2012-09-11Fix "non-zero padding" errorEelco Dolstra
Probably it's not a good idea to pass a temporary object to StringSource.
2012-09-11Support building a derivation if some outputs are already valid (non-chroot ↵Eelco Dolstra
case) This uses scary hash rewriting. Fixes #21.
2012-09-11Remove debug lineEelco Dolstra
2012-09-11Support building a derivation if some outputs are already validEelco Dolstra
This handles the chroot and build hook cases, which are easy. Supporting the non-chroot-build case will require more work (hash rewriting!). Issue #21.
2012-08-27Fix stupid type error in calling std::maxEelco Dolstra
2012-08-27Merge branch 'master' into no-manifestsEelco Dolstra
2012-08-20Check if MS_PRIVATE is definedEelco Dolstra
http://hydra.nixos.org/build/2955671
2012-08-20In the chroot, make all mounted filesystems privateEelco Dolstra
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-20Don't bind-mount /proc since we mount our ownEelco Dolstra
2012-08-19Fix 1755 permission on temporary directories left behind by ‘-K’Eelco Dolstra
2012-08-01Drop the block count in the garbage collectorEelco Dolstra