about summary refs log tree commit diff
path: root/src/nix-prefetch-url/nix-prefetch-url.cc
AgeCommit message (Collapse)AuthorFilesLines
2018-11-09 nix-prefetch-url: Stop progress bar before printing resultsEelco Dolstra1-0/+2
2018-10-26 nix-prefetch-url: progressbarWill Dietz1-0/+7
2018-10-26 Merge all nix-* binaries into nixEelco Dolstra1-6/+8
These are all symlinks to 'nix' now, reducing the installed size by about ~1.7 MiB.
2018-07-12 nix-prefetch-url: Download file in constant memoryEelco Dolstra1-7/+17
Before: $ command time nix-prefetch-url https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.17.6.tar.xz 1.19user 1.02system 0:41.96elapsed 5%CPU (0avgtext+0avgdata 182720maxresident)k After: 1.38user 1.05system 0:39.73elapsed 6%CPU (0avgtext+0avgdata 16204maxresident)k Note however that addToStore() can still take a lot of memory (e.g. RemoteStore::addToStore() is constant space, but LocalStore::addToStore() isn't; that's fixed by https://github.com/edolstra/nix/commit/c94b4fc7ee0c7b322a5f3c7ee784063b47a11d98 though). Fixes #1400.
2018-06-12 Move EvalState from the stack to the heapEelco Dolstra1-14/+14
EvalState contains a few counters (e.g. nrValues) that increase quickly enough that they end up being interpreted as pointers by the garbage collector. Moving it to the heap makes them invisible to the garbage collector. This reduces the max RSS doing 100 evaluations of nixos.tests.firefox.x86_64-linux.drvPath from 455 MiB to 292 MiB. Note: ideally, allocations would be much further up in the 64-bit address space to reduce the odds of an integer being misinterpreted as a pointer. Maybe we can use some linker magic to move the .bss segment to a higher address.
2018-02-08 Add plugins to make Nix more extensible.Shea Levy1-0/+2
All plugins in plugin-files will be dlopened, allowing them to statically construct instances of the various Register* types Nix supports.
2017-10-24 nix: Respect -I, --arg, --argstrEelco Dolstra1-10/+11
Also, random cleanup to argument handling.
2017-09-18 Don't remove Content-Encoding in fetchurl / nix-prefetch-urlEelco Dolstra1-1/+3
Fixes #1568.
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-8/+8
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-04 Support base-64 hashesEelco Dolstra1-1/+1
Also simplify the Hash API. Fixes #1437.
2017-03-15 runProgram(): Distinguish between empty input and no inputEelco Dolstra1-2/+2
For example, if we call brotli with an empty input, it shouldn't read from the caller's stdin.
2016-11-26 Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra1-9/+9
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-9/+9
2016-09-21 printMsg(lvlError, ...) -> printError(...) etc.Eelco Dolstra1-3/+3
2016-09-14 Enable HTTP/2 supportEelco Dolstra1-1/+1
The binary cache store can now use HTTP/2 to do lookups. This is much more efficient than HTTP/1.1 due to multiplexing: we can issue many requests in parallel over a single TCP connection. Thus it's no longer necessary to use a bunch of concurrent TCP connections (25 by default). For example, downloading 802 .narinfo files from https://cache.nixos.org/, using a single TCP connection, takes 11.8s with HTTP/1.1, but only 0.61s with HTTP/2. This did require a fairly substantial rewrite of the Downloader class to use the curl multi interface, because otherwise curl wouldn't be able to do multiplexing for us. As a bonus, we get connection reuse even with HTTP/1.1. All downloads are now handled by a single worker thread. Clients call Downloader::enqueueDownload() to tell the worker thread to start the download, getting a std::future to the result.
2016-07-26 makeFixedOutputPath(): Drop superfluous HashType argumentEelco Dolstra1-2/+2
2016-06-01 Make the store directory a member variable of StoreEelco Dolstra1-2/+2
2016-04-15 BinaryCacheStore::readFile(): Return a shared_ptr to a stringEelco Dolstra1-2/+2
This allows readFile() to indicate that a file doesn't exist, and might eliminate some large string copying.
2016-02-29 Add an HTTP binary cache storeEelco Dolstra1-1/+1
Allowing stuff like NIX_REMOTE=https://cache.nixos.org nix-store -qR /nix/store/x1p1gl3a4kkz5ci0nfbayjqlqmczp1kq-geeqie-1.1 or NIX_REMOTE=https://cache.nixos.org nix-store --export /nix/store/x1p1gl3a4kkz5ci0nfbayjqlqmczp1kq-geeqie-1.1 | nix-store --import
2016-02-04 Eliminate the "store" global variableEelco Dolstra1-2/+2
Also, move a few free-standing functions into StoreAPI and Derivation. Also, introduce a non-nullable smart pointer, ref<T>, which is just a wrapper around std::shared_ptr ensuring that the pointer is never null. (For reference-counted values, this is better than passing a "T&", because the latter doesn't maintain the refcount. Usually, the caller will have a shared_ptr keeping the value alive, but that's not always the case, e.g., when passing a reference to a std::thread via std::bind.)
2015-10-21 Disable TLS verification for builtin fetchurlEelco Dolstra1-1/+1
This makes it consistent with the Nixpkgs fetchurl and makes it work in chroots. We don't need verification because the hash of the result is checked anyway.
2015-10-07 Show progress during downloadsEelco Dolstra1-1/+0
2015-10-07 nix-prefetch-url: Add --name optionEelco Dolstra1-3/+7
This allows overriding the name component of the resulting Nix store path, which is necessary if the base name of the URI contains "illegal" characters.
2015-10-07 nix-prefetch-url -A: Use "name" attribute from Nix expressionEelco Dolstra1-1/+8
This is in particular useful for fetchFromGitHub et al., ensuring that the store path produced by nix-prefetch-url corresponds to what those functions expect.
2015-10-07 nix-prefetch-url: Support unpacking tarballsEelco Dolstra1-15/+47
This allows nix-prefetch-url to prefetch the output of fetchzip and its wrappers (like fetchFromGitHub). For example: $ nix-prefetch-url --unpack https://github.com/NixOS/patchelf/archive/0.8.tar.gz or from a Nix expression: $ nix-prefetch-url -A nix-repl.src In the latter case, --unpack can be omitted because nix-repl.src is a fetchFromGitHub derivation and thus has "outputHashMode" set to "recursive".
2015-10-01 nix-prefetch-url: Support prefetching from a Nix expressionEelco Dolstra1-4/+36
For example, $ nix-prefetch-url -A hello.src will prefetch the file specified by the fetchurl call in the attribute ‘hello.src’ from the Nix expression in the current directory. This differs from ‘nix-build -A hello.src’ in that it doesn't verify the hash. You can also specify a path to the Nix expression: $ nix-prefetch-url ~/Dev/nixpkgs -A hello.src List elements (typically used in ‘patches’ attributes) also work: $ nix-prefetch-url -A portmidi.patches.0
2015-10-01 nix-prefetch-url: $PRINT_PATH -> --print-pathEelco Dolstra1-2/+6
2015-10-01 nix-prefetch-url: Rewrite in C++Eelco Dolstra1-0/+132