about summary refs log tree commit diff
path: root/src/libutil/serialise.hh
AgeCommit message (Collapse)AuthorFilesLines
2018-08-21 Improve 'coroutine has finished' error messageEelco Dolstra1-1/+5
2018-05-21 serialise: fix buffer size used, hide method for internal use onlyWill Dietz1-3/+6
Fixes #2169.
2018-05-02 Fix some random -Wconversion warningsEelco Dolstra1-2/+2
2018-03-16 Reduce substitution memory consumptionEelco Dolstra1-0/+23
copyStorePath() now pipes the output of srcStore->narFromPath() directly into dstStore->addToStore(). The sink used by the former is converted into a source usable by the latter using boost::coroutine2. This is based on [1]. This reduces the maximum resident size of $ nix build --store ~/my-nix/ /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1 --substituters file:///tmp/binary-cache-xz/ --no-require-sigs from 418592 KiB to 53416 KiB. (The previous commit also reduced the runtime from ~4.2s to ~3.4s, not sure why.) A further improvement will be to download files into a Sink. [1] https://github.com/NixOS/nix/compare/master...Mathnerd314:dump-fix-coroutine#diff-dcbcac55a634031f9cc73707da6e4b18 Issue #1969.
2018-03-16 decompress(): Use a Source and SinkEelco Dolstra1-1/+17
This allows decompression to happen in O(1) memory.
2017-10-23 Pass all settings to build-remoteEelco Dolstra1-1/+21
This ensures that command line flags such as --builders get passed correctly.
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-1/+1
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-03-01 RemoteStore::addToStore(): Send NAR rather than string containing NAREelco Dolstra1-4/+5
This allows the NAR to be streamed in the future (though we're not doing that yet).
2017-03-01 Handle importing NARs containing files greater than 4 GiBEelco Dolstra1-4/+50
Also templatize readInt() to work for various integer types.
2017-02-07 Move SavingSourceAdapter to serialise.hhEelco Dolstra1-0/+15
2016-11-26 Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra1-2/+2
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25 Get rid of unicode quotes (#1140)Guillaume Maudoux1-2/+2
2016-07-13 FdSink: Restore move constructor/assignmentShea Levy1-0/+2
2016-07-13 Make Buffered{Source,Sink} move-safeShea Levy1-6/+6
2016-05-04 Do compression in a sinkEelco Dolstra1-0/+10
2016-03-04 Eliminate some large string copyingEelco Dolstra1-1/+3
2016-02-26 FdSource: track number of bytes readEelco Dolstra1-4/+6
2016-02-24 Remove bad daemon connections from the poolEelco Dolstra1-6/+17
This is necessary for long-running processes like hydra-queue-runner: if a nix-daemon worker is killed, we need to stop reusing that connection.
2015-09-03 Implement buildDerivation() via the daemonEelco Dolstra1-0/+1
2015-07-20 More cleanupEelco Dolstra1-16/+27
2015-07-17 Allow remote builds without sending the derivation closureEelco Dolstra1-0/+8
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.
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 Dolstra1-4/+3
I.e. if you have a derivation with src = ./huge-directory; you'll get a warning that this is not a good idea.
2013-08-26 Fix typos, especially those that end up in the Nix manualIvan Kozik1-1/+1
2013-06-07 Process stderr from substituters while doing have/info queriesEelco Dolstra1-0/+2
2012-07-18 Use "#pragma once" to prevent repeated header file inclusionEelco Dolstra1-5/+1
2011-12-16 * importPath() -> importPaths(). Because of buffering of the inputEelco Dolstra1-2/+2
stream it's now necessary for the daemon to process the entire sequence of exported paths, rather than letting the client do it.
2011-12-16 * Avoid expensive conversions from char arrays to STL strings.Eelco Dolstra1-0/+2
2011-12-16 * Make the import operation through the daemon much more efficientEelco Dolstra1-17/+14
(way fewer roundtrips) by allowing the client to send data in bigger chunks. * Some refactoring.
2011-12-16 * Clean up exception handling.Eelco Dolstra1-1/+1
2011-12-15 * Refactoring: move sink/source buffering into separate classes.Eelco Dolstra1-41/+55
* Buffer the HashSink. This speeds up hashing a bit because it prevents lots of calls to the hash update functions (e.g. nix-hash went from 9.3s to 8.7s of user time on the closure of my /var/run/current-system).
2011-12-15 * Buffer reads in FdSource. Together with write buffering, thisEelco Dolstra1-9/+9
significantly cuts down the number of syscalls (e.g., for "nix-store -qR /var/run/current-system" via the daemon, it reduced the number of syscalls in the client from 29134 to 4766 and in the daemon from 44266 to 20666).
2011-12-14 * Buffer writes in FdSink. This significantly reduces the number ofEelco Dolstra1-6/+13
system calls / context switches when dumping a NAR and in the worker protocol.
2009-03-22 * NAR archives: handle files larger than 2^32 bytes. Previously itEelco Dolstra1-0/+3
would just silently store only (fileSize % 2^32) bytes. * Use posix_fallocate if available when unpacking archives. * Provide a better error message when trying to unpack something that isn't a NAR archive.
2008-12-11 * Open the connection to the daemon lazily (on demand) so thatEelco Dolstra1-2/+2
read-only operations (like nix-env -qa) work properly when the daemon isn't running.
2008-12-03 * A simple API for parsing NAR archives.Eelco Dolstra1-2/+2
2008-06-18 * Some refactoring: put the GC options / results in separate structs.Eelco Dolstra1-0/+2
* The garbage collector now also prints the number of blocks freed.
2006-12-12 * New primop builtins.filterSource, which can be used to filter filesEelco Dolstra1-0/+27
from a source directory. All files for which a predicate function returns true are copied to the store. Typical example is to leave out the .svn directory: stdenv.mkDerivation { ... src = builtins.filterSource (path: baseNameOf (toString path) != ".svn") ./source-dir; # as opposed to # src = ./source-dir; } This is important because the .svn directory influences the hash in a rather unpredictable and variable way.
2006-11-30 * More remote operations.Eelco Dolstra1-1/+3
* Added new operation hasSubstitutes(), which is more efficient than querySubstitutes().size() > 0.
2006-11-30 * When NIX_REMOTE is set to "slave", fork off nix-worker in slaveEelco Dolstra1-0/+10
mode. Presumably nix-worker would be setuid to the Nix store user. The worker performs all operations on the Nix store and database, so the caller can be completely unprivileged. This is already much more secure than the old setuid scheme, since the worker doesn't need to do Nix expression evaluation and so on. Most importantly, this means that it doesn't need to access any user files, with all resulting security risks; it only performs pure store operations. Once this works, it is easy to move to a daemon model that forks off a worker for connections established through a Unix domain socket. That would be even more secure.
2006-11-30 * Skeleton of the privileged worker program.Eelco Dolstra1-0/+71
* Some refactoring: put the NAR archive integer/string serialisation code in a separate file so it can be reused by the worker protocol implementation.