about summary refs log tree commit diff
path: root/src/libmain/shared.cc
AgeCommit message (Collapse)AuthorFilesLines
2018-05-30 Modularize config settingsEelco Dolstra1-1/+1
Allow global config settings to be defined in multiple Config classes. For example, this means that libutil can have settings and evaluator settings can be moved out of libstore. The Config classes are registered in a new GlobalConfig class to which config files etc. are applied. Relevant to https://github.com/NixOS/nix/issues/2009 in that it removes the need for ad hoc handling of useCaseHack, which was the underlying cause of that issue.
2018-03-21 shared.cc: style: prefer "nullptr" over '(char *)NULL'Will Dietz1-5/+5
2018-03-20 execl: cast NULL sentinel to (char *), per man page and compiler warningWill Dietz1-5/+5
From exec(3): > The list of arguments must be terminated by a null pointer, and, since these > are variadic functions, this pointer must be cast (char *) NULL
2018-02-15 Set backup MANPATH in case man path isn’t set correctly.Matthew Bauer1-0/+1
Previously, this would fail at startup for non-NixOS installs: nix-env --help The fix for this is to just use "nixManDir" as the value for MANPATH when spawning "man". To test this, I’m using the following: $ nix-build release.nix -A build $ MANPATH= ./result/bin/nix-env --help Fixes #1627
2018-01-16 Make show-trace a config settingEelco Dolstra1-3/+0
2017-11-14 anchor nix::Exit exceptionWill Dietz1-0/+1
2017-10-24 Add --store argument to legacy commandsEelco Dolstra1-0/+6
2017-10-24 nix: Respect -I, --arg, --argstrEelco Dolstra1-55/+61
Also, random cleanup to argument handling.
2017-10-24 Remove the remote-builds optionEelco Dolstra1-3/+0
This is superfluous since you can now just set "builders" to empty, e.g. "--builders ''".
2017-09-01 Fix verbosity level for nix build --dry-runEelco Dolstra1-12/+12
2017-08-31 Rename a few configuration optionsEelco Dolstra1-4/+4
In particular, drop the "build-" and "gc-" prefixes which are pointless. So now you can say nix build --no-sandbox instead of nix build --no-build-use-sandbox
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-26 nix-build/nix-shell: Eliminate call to nix-instantiate / nix-storeEelco Dolstra1-1/+8
Note that this removes the need for a derivation symlink, so the --drv-path and --add-drv-link flags now do nothing.
2017-06-12 On macOS, don't use /var/folders for TMPDIREelco Dolstra1-0/+8
This broke "nix-store --serve".
2017-04-21 add helper function to set 'interruptThrown'David McFarland1-1/+1
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-14 Minor cleanupEelco Dolstra1-1/+1
2017-04-13 Convert Settings to the new config systemEelco Dolstra1-7/+3
This makes all config options self-documenting. Unknown or unparseable config settings and --option flags now cause a warning.
2017-04-13 Initialise loggerEelco Dolstra1-2/+0
2017-03-16 Remove "killing process <pid>" messagesEelco Dolstra1-5/+1
They convey no useful information.
2017-02-28 Support auto-configuration of build-max-jobsEelco Dolstra1-1/+4
"build-max-jobs" and the "-j" option can now be set to "auto" to use the number of CPUs in the system. (Unlike build-cores, it doesn't use 0 to imply auto-configuration, because a) magic values are a bad idea in general; b) 0 is a legitimate value used to disable local building.) Fixes #1198.
2017-02-16 Move netrcFile to SettingsEelco Dolstra1-1/+0
Also get rid of Settings::processEnvironment(), it appears to be useless.
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-19/+10
In particular, this fixes Ctrl-C in nix-shell sessions.
2017-01-26 Fix interrupt handlingEelco Dolstra1-0/+9
2017-01-19 Kill builds when we get EOF on the log FDEelco Dolstra1-1/+1
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-17/+3
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.
2016-11-26 Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra1-8/+8
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-8/+8
2016-09-21 printMsg(lvlError, ...) -> printError(...) etc.Eelco Dolstra1-11/+11
2016-08-10 Remove $NIX_DB_DIREelco Dolstra1-1/+0
This variable has no reason to exist, given $NIX_STATE_DIR.
2016-07-11 Modernize AutoCloseFDShea Levy1-2/+2
2016-04-25 Show the log tail when a build failsEelco Dolstra1-1/+1
If --no-build-output is given (which will become the default for the "nix" command at least), show the last 10 lines of the build output if the build fails.
2016-04-25 Remove --print-build-traceEelco Dolstra1-3/+0
This was added to support Hydra, but Hydra no longer uses it.
2016-04-25 Improved logging abstractionEelco Dolstra1-2/+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-03-29 Improve SIGINT handling in multi-threaded programsEelco Dolstra1-9/+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 Re-enable sync_with_stdioEelco Dolstra1-3/+0
Otherwise writing to std::cerr is not thread-safe (in particular, lines will be randomly duplicated).
2016-02-25 Merge branch 'master' into new-cliEelco Dolstra1-4/+21
2016-02-23 Pool<T>: Allow a maximum pool sizeEelco Dolstra1-0/+1
2016-02-22 Make OpenSSL usage thread-safeEelco Dolstra1-4/+20
OpenSSL can randomly segfault unless we register a callback function to do locking. https://www.openssl.org/docs/manmaster/crypto/threads.html
2016-02-09 New command line parsing infrastructureEelco Dolstra1-77/+71
2016-02-04 StoreAPI -> StoreEelco Dolstra1-2/+2
Calling a class an API is a bit redundant...
2016-02-04 Eliminate the "store" global variableEelco Dolstra1-5/+4
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-28 printMissing(): Propagate store argumentEelco Dolstra1-3/+3
2015-07-23 --version: Print some config infoEelco Dolstra1-0/+14
Such as whether Nix is built with signed binary cache support, and the location of the configuration file.
2015-07-20 Support systemd log severity prefixesEelco Dolstra1-0/+4
This is mostly useful for hydra-queue-runner.
2015-05-21 nix-collect-garbage: Call collectGarbage() internallyEelco Dolstra1-0/+15
2015-01-02 Allow $NIX_PAGER to override $PAGEREelco Dolstra1-4/+5
2014-12-14 PedantryEelco Dolstra1-1/+1
2014-12-14 Merge branch 'cygwin-master' of https://github.com/ternaris/nixEelco Dolstra1-0/+1
2014-12-12 Don't abort if we get a signal while waiting for the pagerEelco Dolstra1-4/+8