about summary refs log tree commit diff
path: root/src/libutil/util.cc
AgeCommit message (Collapse)AuthorFilesLines
2018-03-20 Hack to get SSH error messages from build-remoteEelco Dolstra1-3/+20
E.g. cannot build on 'ssh://mac1': cannot connect to 'mac1': bash: nix-store: command not found cannot build on 'ssh://mac2': cannot connect to 'mac2': Host key verification failed. cannot build on 'ssh://mac3': cannot connect to 'mac3': Received disconnect from 213... port 6001:2: Too many authentication failures Authentication failed.
2018-03-19 util: rename stdout/stdin members to avoid conflicts w/standard macroWill Dietz1-7/+7
(cherry picked from commit c389a7fb617ed7bcd617efa68c6a48c00405310d)
2018-03-16 decompress(): Use a Source and SinkEelco Dolstra1-15/+60
This allows decompression to happen in O(1) memory.
2018-03-15 Filter ANSI colors when not writing to a terminalEelco Dolstra1-2/+2
Fixes https://github.com/NixOS/nixpkgs/issues/37114.
2018-02-26 nix run: Fix segfault on macOSEelco Dolstra1-0/+7
Note that clearenv() is not available on macOS. Fixes #1907.
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-07 Improve filtering of ANSI escape sequences in build logsEelco Dolstra1-26/+41
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-01-16 Add pure evaluation modeEelco Dolstra1-0/+6
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-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 Dolstra1-15/+26
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 Dolstra1-0/+10
2017-09-08 ThreadPool: On exception, interrupt the other worker threadsEelco Dolstra1-1/+1
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-25 Handle SIGWINCHEelco Dolstra1-0/+28
2017-08-25 TypoEelco Dolstra1-1/+1
2017-08-18 Remove unused decodeOctalEscapedAndy Wingo1-15/+0
Besides being unused, this function has a bug that it will incorrectly decode the path component Ubuntu\04016.04.2\040LTS\040amd64 as "Ubuntu.04.2 LTS amd64" instead of "Ubuntu 16.04.2 LTS amd64".
2017-08-09 Use /proc/self/fd to efficiently close all FDs on LinuxEelco Dolstra1-2/+16
Issue #1506.
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-28/+28
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-11 replaceSymlink(): Handle the case where the temporary file already existsEelco Dolstra1-4/+13
Not really necessary anymore for #849, but still nice to have.
2017-06-12 Suppress spurious "killing process N: Operation not permitted" on macOSEelco Dolstra1-2/+9
2017-05-16 Improve progress indicatorEelco Dolstra1-1/+1
2017-05-05 Figure out the user's home directory if $HOME is not setEelco Dolstra1-17/+28
2017-05-01 Minor cleanupEelco Dolstra1-2/+2
2017-04-25 nix repl: Use $XDG_DATA_HOME for the readline historyEelco Dolstra1-0/+12
2017-04-21 add helper function to set 'interruptThrown'David McFarland1-1/+6
this fixes a linker failure on cygwin 64 due to some bad interaction between tls and shared libraries. see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
2017-04-20 Read per-user settings from ~/.config/nix/nix.confEelco Dolstra1-0/+12
2017-04-13 canonPath(): Check against empty pathsEelco Dolstra1-0/+2
2017-04-06 Fix bogus "unexpected Nix daemon error: interrupted by the user"Eelco Dolstra1-2/+2
2017-03-16 Remove "killing process <pid>" messagesEelco Dolstra1-3/+2
They convey no useful information.
2017-03-15 runProgram(): Distinguish between empty input and no inputEelco Dolstra1-10/+23
For example, if we call brotli with an empty input, it shouldn't read from the caller's stdin.
2017-03-15 Fix deadlock in runProgram() when input is larger than the pipe buffer sizeEelco Dolstra1-3/+9
2017-02-16 Support netrc in <nix/fetchurl.nix>Eelco Dolstra1-2/+2
This allows <nix/fetchurl.nix> to fetch private Git/Mercurial repositories, e.g. import <nix/fetchurl.nix> { url = https://edolstra@bitbucket.org/edolstra/my-private-repo/get/80a14018daed.tar.bz2; sha256 = "1mgqzn7biqkq3hf2697b0jc4wabkqhmzq2srdymjfa6sb9zb6qs7"; } where /etc/nix/netrc contains: machine bitbucket.org login edolstra password blabla... This works even when sandboxing is enabled. To do: add unpacking support (i.e. fetchzip functionality).
2017-02-08 Include config.h implicitly with '-include config.h' in CFLAGSTuomas Tynkkynen1-2/+0
Because config.h can #define things like _FILE_OFFSET_BITS=64 and not every compilation unit includes config.h, we currently compile half of Nix with _FILE_OFFSET_BITS=64 and other half with _FILE_OFFSET_BITS unset. This causes major havoc with the Settings class on e.g. 32-bit ARM, where different compilation units disagree with the struct layout. E.g.: diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc @@ -166,6 +166,8 @@ void Settings::update() _get(useSubstitutes, "build-use-substitutes"); + fprintf(stderr, "at Settings::update(): &useSubstitutes = %p\n", &nix::settings.useSubstitutes); _get(buildUsersGroup, "build-users-group"); diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -138,6 +138,8 @@ void RemoteStore::initConnection(Connection & conn) void RemoteStore::setOptions(Connection & conn) { + fprintf(stderr, "at RemoteStore::setOptions(): &useSubstitutes = %p\n", &nix::settings.useSubstitutes); conn.to << wopSetOptions Gave me: at Settings::update(): &useSubstitutes = 0xb6e5c5cb at RemoteStore::setOptions(): &useSubstitutes = 0xb6e5c5c7 That was not a fun one to debug!
2017-02-01 Restore default signal handling in child processesEelco Dolstra1-10/+14
In particular, this fixes Ctrl-C in nix-shell sessions.
2017-01-26 Fix interrupt handlingEelco Dolstra1-12/+16
2017-01-24 Work around a bug in clang and older versions of gccEelco Dolstra1-1/+1
http://hydra.nixos.org/build/46597440 https://llvm.org/bugs/show_bug.cgi?id=28096
2017-01-19 Kill builds when we get EOF on the log FDEelco Dolstra1-23/+10
This closes a long-time bug that allowed builds to hang Nix indefinitely (regardless of timeouts) simply by doing exec > /dev/null 2>&1; while true; do true; done Now, on EOF, we just send SIGKILL to the child to make sure it's really gone.
2017-01-17 Handle SIGINT etc. via a sigwait() signal handler threadEelco Dolstra1-4/+66
This allows other threads to install callbacks that run in a regular, non-signal context. In particular, we can use this to signal the downloader thread to quit. Closes #1183.
2017-01-16 AutoCloseDir: Use std::unique_ptrEelco Dolstra1-44/+2
2017-01-16 AutoDeleteArray -> std::unique_ptrEelco Dolstra1-4/+3
Also, switch to C++14 for std::make_unique.
2016-11-26 Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra1-28/+28
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-28/+28
2016-10-12 Add some functions needed by hydraEelco Dolstra1-0/+8
2016-10-06 Merge pull request #998 from veprbl/rx_chmod_fixEelco Dolstra1-4/+5
override rx directory permissions in deletePath()
2016-09-21 nix-build, nix-shell: Don't print error message if nix-store/nix-instantiate ↵Eelco Dolstra1-1/+1
fails
2016-09-21 printMsg(lvlError, ...) -> printError(...) etc.Eelco Dolstra1-5/+5
2016-09-21 Some notational convenience for formatting stringsEelco Dolstra1-10/+3
We can now write throw Error("file '%s' not found", path); instead of throw Error(format("file '%s' not found") % path); and similarly printError("file '%s' not found", path); instead of printMsg(lvlError, format("file '%s' not found") % path);
2016-09-20 TweakEelco Dolstra1-2/+2