about summary refs log tree commit diff
path: root/src/libutil/util.hh
AgeCommit message (Collapse)AuthorFilesLines
2016-11-17 TypoEelco Dolstra1-1/+1
2016-11-17 Fix binary-cache-store buildShea Levy1-7/+8
2016-11-17 istringstream_nocopy: Implement in a standards-compliant wayShea Levy1-4/+40
Fixes #1135.
2016-11-16 S3BinaryCacheStore:: Eliminate a string copy while uploadingEelco Dolstra1-0/+14
This cuts hydra-queue-runner's peak memory usage by about a third.
2016-10-12 Add some functions needed by hydraEelco Dolstra1-0/+1
2016-09-21 nix-build, nix-shell: Don't print error message if nix-store/nix-instantiate ↵Eelco Dolstra1-1/+10
fails
2016-09-20 TweakEelco Dolstra1-1/+2
2016-09-20 nix-shell: Fix $PATH handling in the impure caseEelco Dolstra1-0/+5
We were passing "p=$PATH" rather than "p=$PATH;", resulting in some invalid shell code. Also, construct a separate environment for the child rather than overwriting the parent's.
2016-09-16 Make computeFSClosure() single-threaded againEelco Dolstra1-0/+39
The fact that queryPathInfo() is synchronous meant that we needed a thread for every concurrent binary cache lookup, even though they end up being handled by the same download thread. Requiring hundreds of threads is not a good idea. So now there is an asynchronous version of queryPathInfo() that takes a callback function to process the result. Similarly, enqueueDownload() now takes a callback rather than returning a future. Thus, a command like nix path-info --store https://cache.nixos.org/ -r /nix/store/slljrzwmpygy1daay14kjszsr9xix063-nixos-16.09beta231.dccf8c5 that returns 4941 paths now takes 1.87s using only 2 threads (the main thread and the downloader thread). (This is with a prewarmed CloudFront.)
2016-09-16 printMsg(): Don't check for interruptsEelco Dolstra1-2/+2
Having the logger function potentially throw exceptions is Heisenbuggy.
2016-09-14 Add a toLower utility functionEelco Dolstra1-0/+4
2016-09-14 Move some .drv parsing functions out of utilEelco Dolstra1-14/+0
2016-07-11 Modernize AutoCloseFDShea Levy1-6/+8
2016-05-04 Cleanup: Remove singleton()Eelco Dolstra1-9/+0
2016-04-29 Support Git repos in the Nix pathEelco Dolstra1-0/+4
E.g. $ nix-build -I nixpkgs=git://github.com/NixOS/nixpkgs '<nixpkgs>' -A hello This is not extremely useful yet because you can't specify a branch/revision.
2016-04-25 Improved logging abstractionEelco Dolstra1-48/+1
This also gets rid of --log-type, since the nested log type isn't useful in a multi-threaded situation, and nobody cares about the "pretty" log type.
2016-04-20 Cache path info lookups in SQLiteEelco Dolstra1-0/+3
This re-implements the binary cache database in C++, allowing it to be used by other Store backends, in particular the S3 backend.
2016-03-29 Improve SIGINT handling in multi-threaded programsEelco Dolstra1-0/+2
The flag remembering whether an Interrupted exception was thrown is now thread-local. Thus, all threads will (eventually) throw Interrupted. Previously, one thread would throw Interrupted, and then the other threads wouldn't see that they were supposed to quit.
2016-03-29 Add "nix verify-paths" commandEelco Dolstra1-1/+1
Unlike "nix-store --verify-path", this command verifies signatures in addition to store path contents, is multi-threaded (especially useful when verifying binary caches), and has a progress indicator. Example use: $ nix verify-paths --store https://cache.nixos.org -r $(type -p thunderbird) ... [17/132 checked] checking ‘/nix/store/rawakphadqrqxr6zri2rmnxh03gqkrl3-autogen-5.18.6’
2016-02-24 deletePath(): Succeed if path doesn't existEelco Dolstra1-2/+2
Also makes it robust against concurrent deletions.
2016-02-12 Merge pull request #762 from ctheune/ctheune-floatsEelco Dolstra1-0/+8
Implement floats
2016-02-04 Eliminate the "store" global variableEelco Dolstra1-0/+10
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.)
2016-01-20 string2Int: Barf on negative numbers for unsigned typesEelco Dolstra1-1/+3
2016-01-05 Merge pull request #685 from vizanto/masterEelco Dolstra1-0/+6
POSIX compliant directory access (fixes build on Solaris)
2016-01-05 First hit at providing support for floats in the language.Christian Theune1-0/+8
2015-11-16 AutoDelete: Add default constructor with deletion disabledShea Levy1-0/+2
2015-11-09 Fix namespace issueEelco Dolstra1-2/+2
2015-11-07 Fix build on SolarisDanny Wilson1-0/+6
d_type is not part of the POSIX spec unfortunately.
2015-10-29 int2String() -> std::to_string()Eelco Dolstra1-7/+0
2015-10-01 nix-prefetch-url: Rewrite in C++Eelco Dolstra1-0/+1
2015-07-20 Support systemd log severity prefixesEelco Dolstra1-1/+2
This is mostly useful for hydra-queue-runner.
2015-07-17 OCD: foreach -> C++11 ranged forEelco Dolstra1-7/+0
2015-06-17 Support URLs in $NIX_PATHEelco Dolstra1-0/+5
This didn't work (despite claims in the manual), because the colon in "http://" was parsed as a element separator. So handle "://" specially.
2015-06-09 Use std::vector::data()Eelco Dolstra1-1/+1
2015-04-09 Implement caching of fetchurl/fetchTarball resultsEelco Dolstra1-0/+7
ETags are used to prevent redownloading unchanged files.
2015-02-10 Add base64 encoder/decoderEelco Dolstra1-0/+5
2015-02-04 Use libsodium instead of OpenSSL for binary cache signingEelco Dolstra1-1/+1
Sodium's Ed25519 signatures are much shorter than OpenSSL's RSA signatures. Public keys are also much shorter, so they're now specified directly in the nix.conf option ‘binary-cache-public-keys’. The new command ‘nix-store --generate-binary-cache-key’ generates and prints a public and secret key.
2014-12-12 Fix some memory leaksEelco Dolstra1-0/+5
2014-12-12 Ensure we're writing to stderr in the builderEelco Dolstra1-0/+1
http://hydra.nixos.org/build/17862041
2014-12-10 Use vforkEelco Dolstra1-2/+10
2014-11-19 nix-daemon: Call exit(), not _exit()Eelco Dolstra1-1/+1
This was preventing destructors from running. In particular, it was preventing the deletion of the temproot file for each worker process. It may also have been responsible for the excessive WAL growth on Hydra (due to the SQLite database not being closed properly). Apparently broken by accident in 8e9140cfdef9dbd1eb61e4c75c91d452ab5e4a74.
2014-10-03 Remove some duplicate codeEelco Dolstra1-0/+2
2014-08-21 Use PR_SET_PDEATHSIG to ensure child cleanupEelco Dolstra1-1/+2
2014-08-20 Add some colorEelco Dolstra1-0/+12
2014-08-04 Get rid of "killing <pid>" message for unused build hooksEelco Dolstra1-1/+1
2014-08-01 Eliminate redundant copyEelco Dolstra1-0/+2
2014-08-01 Make readDirectory() return inode / file typeEelco Dolstra1-1/+10
2014-07-31 Restore default SIGPIPE handler before invoking ‘man’Eelco Dolstra1-0/+4
Fixes NixOS/nixpkgs#3410.
2014-07-10 Refactoring: Move all fork handling into a higher-order functionEelco Dolstra1-0/+7
C++11 lambdas ftw.
2014-07-10 Remove maybeVforkEelco Dolstra1-3/+0