aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2012-12-20Yet another rewrite of the garbage collectorEelco Dolstra
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-19If gc-keep-derivations is set, only keep the actual deriverEelco Dolstra
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-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-12-13fix use-after-free bug in mkString(Value&, Symbol&)Stuart Pernsteiner
2012-12-12Allow setting the profile location using $NIX_PROFILEEelco Dolstra
Fixes #69.
2012-12-11On SQLITE_BUSY, wait a random amount of timeEelco Dolstra
If all contending processes wait a fixed amount of time (100 ms), there is a good probability that they'll just collide again.
2012-12-04Tiny optimisation in the filter primopEelco Dolstra
2012-12-04nix-env: Install all outputs of a derivationEelco Dolstra
If you explicitly install a package, presumably you want all of it. So symlink all outputs in the user environment.
2012-12-03Fix the ‘--prebuilt-only’ flagEelco Dolstra
2012-12-03WhitespaceEelco Dolstra
2012-11-28nix-env -q --out-path: Support multiple outputsEelco Dolstra
We now print all output paths of a package, e.g. openssl-1.0.0i bin=/nix/store/gq2mvh0wb9l90djvsagln3aqywqmr6vl-openssl-1.0.0i-bin;man=/nix/store/7zwf5r5hsdarl3n86dasvb4chm2xzw9n-openssl-1.0.0i-man;/nix/store/cj7xvk7fjp9q887359j75pw3pzjfmqf1-openssl-1.0.0i or (in XML mode) <item attrPath="openssl" name="openssl-1.0.0i" system="x86_64-linux"> <output name="bin" path="/nix/store/gq2mvh0wb9l90djvsagln3aqywqmr6vl-openssl-1.0.0i-bin" /> <output name="man" path="/nix/store/7zwf5r5hsdarl3n86dasvb4chm2xzw9n-openssl-1.0.0i-man" /> <output name="out" path="/nix/store/cj7xvk7fjp9q887359j75pw3pzjfmqf1-openssl-1.0.0i" /> </item>
2012-11-27Optionally ignore null-valued derivation attributesEelco Dolstra
This allows adding attributes like attr = if stdenv.system == "bla" then something else null; without changing the resulting derivation on non-<bla> platforms. We once considered adding a special "ignore" value for this purpose, but using null seems more elegant.
2012-11-27Add builtin constants ‘langVersion’ and ‘nixVersion’Eelco Dolstra
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-26queryMissing(): Handle partially valid derivationsEelco Dolstra
2012-11-26nix-instantiate: Fix read-only evaluationEelco 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-20nix-store -r: Add ‘--ignore-unknown’ flagEelco Dolstra
This flag causes paths that do not have a known substitute to be quietly ignored. This is mostly useful for Charon, allowing it to speed up deployment by letting a machine use substitutes for all substitutable paths, instead of uploading them. The latter is frequently faster, e.g. if the target machine has a fast Internet connection while the source machine is on a slow ADSL line.
2012-11-19nix-store -r: Don't quietly ignore missing pathsEelco Dolstra
2012-11-15Revert "prim_toPath: Actually make the string a path"Eelco Dolstra
This reverts commit 2980d1fba97069805c3649c5d99d0356bce6c303. It causes a regression in NixOS evaluation: string `/nix/store/ya3s5gmj3b28170fpbjhgsk8wzymkpa1-pommed-1.39/etc/pommed.conf' cannot refer to other paths
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-15Add some debug codeEelco Dolstra
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 definition of non-existant functionEelco Dolstra
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-11-09Remove a Darwin hack that should no longer be neededEelco Dolstra
2012-11-09Fix a segfault when auto-calling a "a@{...}" functionEelco Dolstra
Since the called function can return its argument attribute set (e.g. "a"), the latter should not be allocated on the stack. Reported by Shea.
2012-11-09Don't start copy-from-other-stores if $NIX_OTHER_STORES is unsetEelco Dolstra
Slight optimisation.
2012-11-09Remove unnecessary call to closeMostFDs()Eelco Dolstra
We have close-on-exec on all FDs now, and there is no security risk in passing open FDs to substituters anyway.
2012-11-06canonicalizePathMetaData: Fall-back to utimes if lutimes fails due to ENOSYSShea Levy
2012-10-23If hashes do not match, print them in base-32 for SHA-1/SHA-256Eelco Dolstra
Fixes #57.
2012-10-23prim_toPath: Actually make the string a pathShea Levy
2012-10-11Shorten the names of temporary build directoriesEelco Dolstra
2012-10-04getDerivation(): Don't always quietly ignore assertion failureEelco Dolstra
Ignoring assertion failures makes some sense for nix-env -qa, but not for nix-instantiate/nix-build or hydra-eval-jobs.
2012-10-04XML writer: flush after newlinesEelco Dolstra
This is useful for hydra-eval-jobs.
2012-10-04nix-store --verify: Continue on errorsEelco Dolstra
2012-10-04Fix regular expressionEelco Dolstra
http://hydra.nixos.org/build/3123177
2012-10-03Rename nix-worker to nix-daemonEelco Dolstra
2012-10-03Drop support for running nix-worker in "slave" modeEelco Dolstra
AFAIK nobody uses this, setuid binaries are evil, and there is no good reason why people can't just run the daemon.
2012-10-03Remove bin2cEelco Dolstra
2012-10-03When ‘--help’ is given, just run ‘man’ to show the manual pageEelco Dolstra
I.e. do what git does. I'm too lazy to keep the builtin help text up to date :-) Also add ‘--help’ to various commands that lacked it (e.g. nix-collect-garbage).
2012-10-03nix-env: Support ‘--repair’ flagEelco Dolstra
2012-10-03Add a ‘--repair’ flag to nix-instantiateEelco Dolstra
This allows repairing corrupted derivations and other source files.
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.