chore(3p/nix): Clean up some unused defines

This commit is contained in:
Vincent Ambo 2020-05-30 23:11:31 +01:00
parent 91ddc7603d
commit 699ab4e20a
5 changed files with 2 additions and 1529 deletions

File diff suppressed because it is too large Load diff

View file

@ -320,16 +320,6 @@ void LocalStore::openDB(State& state, bool create) {
throw Error(format("cannot open Nix database '%1%'") % dbPath); throw Error(format("cannot open Nix database '%1%'") % dbPath);
} }
#ifdef __CYGWIN__
/* The cygwin version of sqlite3 has a patch which calls
SetDllDirectory("/usr/bin") on init. It was intended to fix extension
loading, which we don't use, and the effect of SetDllDirectory is
inherited by child processes, and causes libraries to be loaded from
/usr/bin instead of $PATH. This breaks quite a few things (e.g.
checkPhase on openssh), so we set it back to default behaviour. */
SetDllDirectoryW(L"");
#endif
if (sqlite3_busy_timeout(db, 60 * 60 * 1000) != SQLITE_OK) { if (sqlite3_busy_timeout(db, 60 * 60 * 1000) != SQLITE_OK) {
throwSQLiteError(db, "setting timeout"); throwSQLiteError(db, "setting timeout");
} }
@ -381,7 +371,6 @@ void LocalStore::openDB(State& state, bool create) {
/* To improve purity, users may want to make the Nix store a read-only /* To improve purity, users may want to make the Nix store a read-only
bind mount. So make the Nix store writable for this process. */ bind mount. So make the Nix store writable for this process. */
void LocalStore::makeStoreWritable() { void LocalStore::makeStoreWritable() {
#if __linux__
if (getuid() != 0) { if (getuid() != 0) {
return; return;
} }
@ -401,7 +390,6 @@ void LocalStore::makeStoreWritable() {
throw SysError(format("remounting %1% writable") % realStoreDir); throw SysError(format("remounting %1% writable") % realStoreDir);
} }
} }
#endif
} }
const time_t mtimeStore = 1; /* 1 second into the epoch */ const time_t mtimeStore = 1; /* 1 second into the epoch */

View file

@ -90,13 +90,7 @@ ref<RemoteStore::Connection> UDSRemoteStore::openConnection() {
auto conn = make_ref<Connection>(); auto conn = make_ref<Connection>();
/* Connect to a daemon that does the privileged work for us. */ /* Connect to a daemon that does the privileged work for us. */
conn->fd = socket(PF_UNIX, conn->fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
SOCK_STREAM
#ifdef SOCK_CLOEXEC
| SOCK_CLOEXEC
#endif
,
0);
if (!conn->fd) { if (!conn->fd) {
throw SysError("cannot create Unix domain socket"); throw SysError("cannot create Unix domain socket");
} }

View file

@ -214,7 +214,6 @@ struct XzCompressionSink : CompressionSink {
bool done = false; bool done = false;
if (parallel) { if (parallel) {
#ifdef HAVE_LZMA_MT
lzma_mt mt_options = {}; lzma_mt mt_options = {};
mt_options.flags = 0; mt_options.flags = 0;
mt_options.timeout = 300; // Using the same setting as the xz cmd line mt_options.timeout = 300; // Using the same setting as the xz cmd line
@ -230,10 +229,6 @@ struct XzCompressionSink : CompressionSink {
// number of threads. // number of threads.
ret = lzma_stream_encoder_mt(&strm, &mt_options); ret = lzma_stream_encoder_mt(&strm, &mt_options);
done = true; done = true;
#else
LOG(ERROR) << "parallel XZ compression requested but not supported, "
<< "falling back to single-threaded compression";
#endif
} }
if (!done) { if (!done) {

View file

@ -7,22 +7,8 @@
#include <absl/strings/ascii.h> #include <absl/strings/ascii.h>
#include <absl/strings/match.h> #include <absl/strings/match.h>
#include <glog/logging.h>
#ifdef READLINE
#include <readline/history.h>
#include <readline/readline.h>
#else
// editline < 1.15.2 don't wrap their API for C++ usage
// (added in
// https://github.com/troglobit/editline/commit/91398ceb3427b730995357e9d120539fb9bb7461).
// This results in linker errors due to to name-mangling of editline C symbols.
// For compatibility with these versions, we wrap the API here
// (wrapping multiple times on newer versions is no problem).
extern "C" {
#include <editline.h> #include <editline.h>
} #include <glog/logging.h>
#endif
#include "libexpr/common-eval-args.hh" #include "libexpr/common-eval-args.hh"
#include "libexpr/eval-inline.hh" #include "libexpr/eval-inline.hh"
@ -242,15 +228,11 @@ void NixRepl::mainLoop(const std::vector<std::string>& files) {
// Allow nix-repl specific settings in .inputrc // Allow nix-repl specific settings in .inputrc
rl_readline_name = "nix-repl"; rl_readline_name = "nix-repl";
createDirs(dirOf(historyFile)); createDirs(dirOf(historyFile));
#ifndef READLINE
el_hist_size = 1000; el_hist_size = 1000;
#endif
read_history(historyFile.c_str()); read_history(historyFile.c_str());
curRepl = this; curRepl = this;
#ifndef READLINE
rl_set_complete_func(completionCallback); rl_set_complete_func(completionCallback);
rl_set_list_possib_func(listPossibleCallback); rl_set_list_possib_func(listPossibleCallback);
#endif
std::string input; std::string input;