Skip to content
Snippets Groups Projects
  1. Sep 18, 2020
    • Bryan Richter's avatar
      nix-prefetch-url: Add --executable flag · 5fe375a8
      Bryan Richter authored
      pkgs.fetchurl supports an executable argument, which is especially nice
      when downloading a large executable. This patch adds the same option to
      nix-prefetch-url.
      
      I have tested this to work on the simple case of prefetching a little
      executable:
      
      1. nix-prefetch-url --executable https://my/little/script
      2. Paste the hash into a pkgs.fetchurl-based package, script-pkg.nix
      3. Delete the output from the store to avoid any misidentified artifacts
      4. Realise the package script-pkg.nix
      5. Run the executable
      
      I repeated the above while using --name, as well.
      
      I suspect --executable would have no meaningful effect if combined with
      --unpack, but I have not tried it.
      5fe375a8
  2. Jul 10, 2020
  3. Jul 01, 2020
  4. Jun 19, 2020
  5. Jun 18, 2020
  6. Jun 08, 2020
    • regnat's avatar
      Move progress-bar.cc to libmain · 801112de
      regnat authored
      Needed so that we can include it as a logger in loggers.cc without
      adding a dependency on nix
      
      This also requires moving names.hh to libutil to prevent a circular
      dependency between libmain and libexpr
      801112de
  7. Jun 02, 2020
    • John Ericson's avatar
      Remove `HashType::Unknown` · 450dcf2c
      John Ericson authored
      Instead, `Hash` uses `std::optional<HashType>`. In the future, we may
      also make `Hash` itself require a known hash type, encoraging people to
      use `std::optional<Hash>` instead.
      450dcf2c
  8. Apr 21, 2020
  9. Apr 08, 2020
  10. Mar 30, 2020
  11. Mar 29, 2020
  12. Mar 24, 2020
  13. Feb 07, 2020
  14. Jan 05, 2020
  15. Dec 10, 2019
    • Eelco Dolstra's avatar
      Make the Store API more type-safe · bbe97dff
      Eelco Dolstra authored
      Most functions now take a StorePath argument rather than a Path (which
      is just an alias for std::string). The StorePath constructor ensures
      that the path is syntactically correct (i.e. it looks like
      <store-dir>/<base32-hash>-<name>). Similarly, functions like
      buildPaths() now take a StorePathWithOutputs, rather than abusing Path
      by adding a '!<outputs>' suffix.
      
      Note that the StorePath type is implemented in Rust. This involves
      some hackery to allow Rust values to be used directly in C++, via a
      helper type whose destructor calls the Rust type's drop()
      function. The main issue is the dynamic nature of C++ move semantics:
      after we have moved a Rust value, we should not call the drop function
      on the original value. So when we move a value, we set the original
      value to bitwise zero, and the destructor only calls drop() if the
      value is not bitwise zero. This should be sufficient for most types.
      
      Also lots of minor cleanups to the C++ API to make it more modern
      (e.g. using std::optional and std::string_view in some places).
      bbe97dff
  16. Dec 07, 2019
  17. Nov 26, 2019
  18. Nov 09, 2018
  19. Oct 26, 2018
  20. Jul 12, 2018
  21. Jun 12, 2018
    • Eelco Dolstra's avatar
      Move EvalState from the stack to the heap · 0629601d
      Eelco Dolstra authored
      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.
      0629601d
  22. Feb 08, 2018
  23. Oct 24, 2017
  24. Sep 18, 2017
  25. Jul 30, 2017
  26. Jul 04, 2017
  27. Mar 15, 2017
  28. Nov 25, 2016
  29. Sep 21, 2016
  30. Sep 14, 2016
    • Eelco Dolstra's avatar
      Enable HTTP/2 support · 90ad02bf
      Eelco Dolstra authored
      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.
      90ad02bf
Loading