about summary refs log tree commit diff
path: root/src/libstore/misc.hh
AgeCommit message (Collapse)AuthorFilesLines
2015-07-17 Allow remote builds without sending the derivation closureEelco Dolstra1-2/+2
Previously, to build a derivation remotely, we had to copy the entire closure of the .drv file to the remote machine, even though we only need the top-level derivation. This is very wasteful: the closure can contain thousands of store paths, and in some Hydra use cases, include source paths that are very large (e.g. Git/Mercurial checkouts). So now there is a new operation, StoreAPI::buildDerivation(), that performs a build from an in-memory representation of a derivation (BasicDerivation) rather than from a on-disk .drv file. The only files that need to be in the Nix store are the sources of the derivation (drv.inputSrcs), and the needed output paths of the dependencies (as described by drv.inputDrvs). "nix-store --serve" exposes this interface. Note that this is a privileged operation, because you can construct a derivation that builds any store path whatsoever. Fixing this will require changing the hashing scheme (i.e., the output paths should be computed from the other fields in BasicDerivation, allowing them to be verified without access to other derivations). However, this would be quite nice because it would allow .drv-free building (e.g. "nix-env -i" wouldn't have to write any .drv files to disk). Fixes #173.
2015-06-04 Allow substitutes for builds that have preferLocalBuild setEelco Dolstra1-0/+2
Not substituting builds with "preferLocalBuild = true" was a bad idea, because it didn't take the cost of dependencies into account. For instance, if we can't substitute a fetchgit call, then we have to download/build git and all its dependencies. Partially reverts 5558652709f27e8a887580b77b93c705659d7a4b and adds a new derivation attribute "allowSubstitutes" to specify whether a derivation may be substituted.
2013-06-20 Don't set $preferLocalBuild and $requiredSystemFeatures in buildersEelco Dolstra1-1/+1
With C++ std::map, doing a comparison like ‘map["foo"] == ...’ has the side-effect of adding a mapping from "foo" to the empty string if "foo" doesn't exist in the map. So we ended up setting some environment variables by accident.
2013-06-20 Don't substitute derivations that have preferLocalBuild setEelco Dolstra1-0/+2
In particular this means that "trivial" derivations such as writeText are not substituted, reducing the number of GET requests to the binary cache by about 200 on a typical NixOS configuration.
2012-12-20 nix-store -q --roots: Respect the gc-keep-outputs/gc-keep-derivations settingsEelco Dolstra1-2/+2
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-07-18 Use "#pragma once" to prevent repeated header file inclusionEelco Dolstra1-5/+1
2011-08-31 * Eliminate all uses of the global variable ‘store’ from libstore.Eelco Dolstra1-3/+3
This should also fix: nix-instantiate: ./../boost/shared_ptr.hpp:254: T* boost::shared_ptr<T>::operator->() const [with T = nix::StoreAPI]: Assertion `px != 0' failed. which was caused by hashDerivationModulo() calling the ‘store’ object (during store upgrades) before openStore() assigned it.
2010-11-17 * Before a build, show the disk space that the downloaded store pathsEelco Dolstra1-1/+1
will approximately require.
2010-01-25 * Made `nix-store -qR --include-outputs' much faster if there areEelco Dolstra1-1/+2
multiple paths specified on the command line (from O(n * m) to O(n + m), where n is the number of arguments and m is the size of the closure).
2008-08-04 * nix-env --dry-run: show the total size of the substituterEelco Dolstra1-1/+2
downloads.
2008-08-04 * querySubstitutablePathInfo: work properly when run via the daemon.Eelco Dolstra1-1/+1
* --dry-run: print the paths that we don't know how to build/substitute.
2006-09-04 * Use a proper namespace.Eelco Dolstra1-0/+6
* Optimise header file usage a bit. * Compile the parser as C++.
2006-03-06 * `nix-env (-i|-u) --dry-run' now shows exactly which missing pathsEelco Dolstra1-0/+32
will be built or substituted.