about summary refs log tree commit diff
path: root/src/libutil (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-03-14 Catch more possible instances of passing NULL to memcpy.Shea Levy1-0/+1
Actually fixes #1976.
2018-03-12 Wrap thread local in function for CygwinAsad Saeeduddin2-6/+16
Fixes #1826. See #1352 for a previous instance of a similar change.
2018-03-09 Fix double free in Store::queryPathInfo()Eelco Dolstra1-4/+4
It was holding on to a Value* (i.e. a std::shared_ptr<ValidPathInfo>*) outside of the pathInfoCache lock, so the std::shared_ptr could be destroyed between the release of the lock and the decrement of the std::shared_ptr refcount. This can happen if more than 'path-info-cache-size' paths are added in the meantime, *or* if clearPathInfoCache() is called. The hydra-queue-runner queue monitor thread periodically calls the later, so is likely to trigger a crash. Fixes https://github.com/NixOS/hydra/issues/542.
2018-03-06 logging: Don't throw from Activity destructorWill Dietz2-2/+9
Move definition of destructor to logging.cc for access to util.hh's ignoreException.
2018-03-02 don't allocate large buffers on the stackWill Dietz3-23/+24
2018-03-02 Merge branch 'write-failure-fixes' of git://github.com/lheckemann/nixShea Levy1-1/+2
2018-02-26 nix run: Fix segfault on macOSEelco Dolstra2-0/+10
Note that clearenv() is not available on macOS. Fixes #1907.
2018-02-19 libutil: Fix invalid assert on decoding base64 hashesTuomas Tynkkynen1-1/+2
The assertion is broken because there is no one-to-one mapping from length of a base64 string to the length of the output. E.g. "1q69lz7Empb06nzfkj651413n9icx0njmyr3xzq1j9q=" results in a 32-byte output. "1q69lz7Empb06nzfkj651413n9icx0njmyr3xzq1j9qy" results in a 33-byte output. To reproduce, evaluate: builtins.derivationStrict { name = "0"; builder = "0"; system = "0"; outputHashAlgo = "sha256"; outputHash = "1q69lz7Empb06nzfkj651413n9icx0njmyr3xzq1j9qy"; } Found by afl-fuzz.
2018-02-19 libutil: Fix infinite loop in filterANSIEscapes on '\r'Tuomas Tynkkynen1-1/+1
E.g. nix-instantiate --eval -E 'abort "\r"' hangs. Found by afl-fuzz.
2018-02-19 Config::handleUnknownSettings(): Remove unused 'fatal' argumentEelco Dolstra2-6/+3
2018-02-19 Merge branch 'register-settings' of https://github.com/shlevy/nixEelco Dolstra2-25/+25
2018-02-19 Merge pull request #1857 from dtzWill/fix/check-for-lzma-mtEelco Dolstra1-23/+37
configure.ac: check if lzma has MT support, fix deb build/etc.
2018-02-14 monitor-fds: Fix on macOS.Shea Levy1-7/+23
Fixes #1871.
2018-02-13 Allow plugins to define new settings.Shea Levy2-25/+25
2018-02-13 Fix #1762Linus Heckemann1-1/+2
nix-store --export, nix-store --dump, and nix dump-path would previously fail silently if writing the data out failed, because a) FdSink::write ignored exceptions, and b) the commands relied on FdSink's destructor, which ignores exceptions, to flush the data out. This could cause rather opaque issues with installing nixos, because nix-store --export would happily proceed even if it couldn't write its data out (e.g. if nix-store --import on the other side of the pipe failed). This commit adds tests that expose these issues in the nix-store commands, and fixes them for all three.
2018-02-13 Allow includes from nix.confShea Levy1-1/+25
2018-02-11 compression: make parallel sink separate classWill Dietz1-29/+34
2018-02-11 compression: print warning if parallel requested but not supportedWill Dietz1-1/+8
2018-02-09 configure.ac: check if lzma has MT support, fix deb build/etc.Will Dietz1-0/+2
2018-02-07 make multi threaded compression configurable and use single threadedAmineChikhaoui2-19/+27
by default.
2018-02-07 Merge branch 'master' of https://github.com/NixOS/nix into parallel-xzAmineChikhaoui3-31/+48
2018-02-07 Improve filtering of ANSI escape sequences in build logsEelco Dolstra3-31/+48
All ANSI sequences except color setting are now filtered out. In particular, terminal resets (such as from NixOS VM tests) are filtered out. Also, fix the completely broken tab character handling.
2018-02-07 set block size to 0 to let the lzma lib choose the right one, addAmineChikhaoui1-1/+6
some comments about possible improvements wrt memory usage/threading.
2018-02-06 support multi threaded xz encoder, this might be particularly useful inAmineChikhaoui1-2/+7
the case of hydra where the overhead of single threaded encoding is more noticeable e.g most of the time spent in "Sending inputs"/"Receiving outputs" is due to compression while the actual upload to the binary cache seems to be negligible.
2018-01-16 Add pure evaluation modeEelco Dolstra2-2/+10
In this mode, the following restrictions apply: * The builtins currentTime, currentSystem and storePath throw an error. * $NIX_PATH and -I are ignored. * fetchGit and fetchMercurial require a revision hash. * fetchurl and fetchTarball require a sha256 attribute. * No file system access is allowed outside of the paths returned by fetch{Git,Mercurial,url,Tarball}. Thus 'nix build -f ./foo.nix' is not allowed. Thus, the evaluation result is completely reproducible from the command line arguments. E.g. nix build --pure-eval '( let nix = fetchGit { url = https://github.com/NixOS/nixpkgs.git; rev = "9c927de4b179a6dd210dd88d34bda8af4b575680"; }; nixpkgs = fetchGit { url = https://github.com/NixOS/nixpkgs.git; ref = "release-17.09"; rev = "66b4de79e3841530e6d9c6baf98702aa1f7124e4"; }; in (import (nix + "/release.nix") { inherit nix nixpkgs; }).build.x86_64-linux )' The goal is to enable completely reproducible and traceable evaluation. For example, a NixOS configuration could be fully described by a single Git commit hash. 'nixos-rebuild' would do something like nix build --pure-eval '( (import (fetchGit { url = file:///my-nixos-config; rev = "..."; })).system ') where the Git repository /my-nixos-config would use further fetchGit calls or Git externals to fetch Nixpkgs and whatever other dependencies it has. Either way, the commit hash would uniquely identify the NixOS configuration and allow it to reproduced.
2017-12-30 use libbrotli directly when availableWill Dietz2-10/+165
* Look for both 'brotli' and 'bro' as external command, since upstream has renamed it in newer versions. If neither are found, current runtime behavior is preserved: try to find 'bro' on PATH. * Limit amount handed to BrotliEncoderCompressStream to ensure interrupts are processed in a timely manner. Testing shows negligible performance impact. (Other compression sinks don't seem to require this)
2017-12-11 logging.cc: add missing 'override'Will Dietz1-0/+1
2017-11-21 Propagate flags like --sandbox to the daemon properlyEelco Dolstra2-3/+9
2017-11-20 CleanupEelco Dolstra1-2/+2
2017-11-20 Merge pull request #1645 from twhitehead/stat-raceEelco Dolstra1-12/+11
Fix (highly unlikely) race condition in readLink
2017-11-01 fetchMercurial: Don't fetch hashes we already haveEelco Dolstra2-15/+43
2017-10-30 builtins.fetchgit: Support importing a working treeEelco Dolstra4-10/+7
For example, you can write src = fetchgit ./.; and if ./. refers to an unclean working tree, that tree will be copied to the Nix store. This removes the need for "cleanSource".
2017-10-30 Fix (highly unlikely) race condition in readLinkTyson Whitehead1-12/+11
Used to determine symlink size with stat and value with readlink. This could technically result in garbage if symlink changed between calls. Also gets around the broken stat implementation in our network filesystem (returns size + 1 giving a byte of garbage).
2017-10-25 Pass lists/attrsets to bash as (associative) arraysEelco Dolstra2-4/+12
2017-10-24 More progress indicator improvementsEelco Dolstra2-3/+4
Fixes #1599.
2017-10-24 Handle log messages from build-remoteEelco Dolstra2-0/+135
This makes the progress indicator show statuses like "connecting to 'root@machine'".
2017-10-24 nix: Respect -I, --arg, --argstrEelco Dolstra3-48/+44
Also, random cleanup to argument handling.
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-10-09 Fix a hang in ThreadPoolEelco Dolstra2-33/+57
The worker threads could exit prematurely if they finished processing all items while the main thread was still adding items. In particular, this caused hanging nix-store --serve processes in the build farm. Also, process items from the main thread.
2017-09-25 DohEelco Dolstra1-1/+1
2017-09-14 RemoteStore: Add option to drop old connections from the poolEelco Dolstra1-0/+10
This is a hack to make hydra-queue-runner free its temproots periodically, thereby ensuring that garbage collection of the corresponding paths is not blocked until the queue runner is restarted. It would be better if temproots could be released earlier than at process exit. I started working on a RAII object returned by functions like addToStore() that releases temproots. However, this would be a pretty massive change so I gave up on it for now.
2017-09-14 Add "nix add-to-store" commandEelco Dolstra1-3/+4
2017-09-08 ThreadPool: On exception, interrupt the other worker threadsEelco Dolstra4-7/+14
2017-09-08 ThreadPool: Improve exception handlingEelco Dolstra2-24/+53
In particular, process() won't return as long as there are active items. This prevents work item lambdas from referring to stack frames that no longer exist.
2017-09-06 nix build: Add --out-link and --no-link optionsEelco Dolstra1-0/+13
2017-08-31 Add an activity for binary cache queriesEelco Dolstra1-0/+1
2017-08-31 Fix mismatched tag warningEelco Dolstra1-1/+1
https://hydra.nixos.org/build/59649086
2017-08-29 nix run: Allow passing a command to executeEelco Dolstra2-1/+5
E.g. nix run nixpkgs.hello -c hello --greeting Hallo Note that unlike "nix-shell --command", no quoting of arguments is necessary. "-c" (short for "--command") cannot be combined with "--" because they both consume all remaining arguments. But since installables shouldn't start with a dash, this is unlikely to cause problems.
2017-08-29 readLink(): Handle symlinks in /procEelco Dolstra1-4/+5
Symlinks like /proc/self/exe report a stat() size of 0, so use a buffer of at least PATH_MAX instead.
2017-08-28 Give activities a verbosity level againEelco Dolstra2-4/+15
And print them (separately from the progress bar) given sufficient -v flags.