diff --git a/Makefile b/Makefile index 349f1b56ef27..c72554e5eac2 100644 --- a/Makefile +++ b/Makefile @@ -7,14 +7,14 @@ ifeq ($(ENABLE_BUILD), yes) makefiles = \ mk/precompiled-headers.mk \ local.mk \ - src/libutil/local.mk + src/libutil/local.mk \ + src/libstore/local.mk \ + src/libfetchers/local.mk \ + src/libexpr/local.mk ifdef HOST_UNIX makefiles += \ - src/libstore/local.mk \ - src/libfetchers/local.mk \ src/libmain/local.mk \ - src/libexpr/local.mk \ src/libcmd/local.mk \ src/nix/local.mk \ src/resolve-system-dependencies/local.mk \ @@ -33,13 +33,10 @@ endif ifeq ($(ENABLE_BUILD)_$(ENABLE_TESTS), yes_yes) UNIT_TEST_ENV = _NIX_TEST_UNIT_DATA=unit-test-data makefiles += \ - src/libutil/tests/local.mk -ifdef HOST_UNIX -makefiles += \ + src/libutil/tests/local.mk \ src/libstore/tests/local.mk \ src/libexpr/tests/local.mk endif -endif ifeq ($(ENABLE_TESTS), yes) ifdef HOST_UNIX diff --git a/src/libexpr/eval-settings.cc b/src/libexpr/eval-settings.cc index 444a7d7d6dc2..86cf44f25db5 100644 --- a/src/libexpr/eval-settings.cc +++ b/src/libexpr/eval-settings.cc @@ -1,6 +1,8 @@ #include "users.hh" #include "globals.hh" -#include "profiles.hh" +#ifndef _WIN32 +# include "profiles.hh" +#endif #include "eval.hh" #include "eval-settings.hh" @@ -65,8 +67,10 @@ Strings EvalSettings::getDefaultNixPath() if (!evalSettings.restrictEval && !evalSettings.pureEval) { add(getNixDefExpr() + "/channels"); + #ifndef _WIN32 add(rootChannelsDir() + "/nixpkgs", "nixpkgs"); add(rootChannelsDir()); + #endif } return res; diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index dfe81cbf73f4..30eecdc39f02 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -10,12 +10,15 @@ #include "eval-inline.hh" #include "filetransfer.hh" #include "function-trace.hh" -#include "profiles.hh" #include "print.hh" #include "fs-input-accessor.hh" #include "memory-input-accessor.hh" #include "signals.hh" +#ifndef _WIN32 +# include "profiles.hh" +#endif + #include #include #include @@ -23,14 +26,16 @@ #include #include #include -#include #include #include #include -#include #include +#ifndef _WIN32 +# include +#endif + #if HAVE_BOEHMGC #define GC_INCLUDE_NEW @@ -462,6 +467,8 @@ ErrorBuilder & ErrorBuilder::withFrame(const Env & env, const Expr & expr) return *this; } +// Don't want Windows function +#undef SearchPath EvalState::EvalState( const SearchPath & _searchPath, @@ -2543,9 +2550,11 @@ void EvalState::maybePrintStats() void EvalState::printStatistics() { +#ifndef _WIN32 struct rusage buf; getrusage(RUSAGE_SELF, &buf); float cpuTime = buf.ru_utime.tv_sec + ((float) buf.ru_utime.tv_usec / 1000000); +#endif uint64_t bEnvs = nrEnvs * sizeof(Env) + nrValuesInEnvs * sizeof(Value *); uint64_t bLists = nrListElems * sizeof(Value *); @@ -2562,7 +2571,9 @@ void EvalState::printStatistics() if (outPath != "-") fs.open(outPath, std::fstream::out); json topObj = json::object(); +#ifndef _WIN32 topObj["cpuTime"] = cpuTime; +#endif topObj["envs"] = { {"number", nrEnvs}, {"elements", nrValuesInEnvs}, diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l index a3a8608d9a76..40ab8c60217e 100644 --- a/src/libexpr/lexer.l +++ b/src/libexpr/lexer.l @@ -132,7 +132,7 @@ else { return ELSE; } assert { return ASSERT; } with { return WITH; } let { return LET; } -in { return IN; } +in { return INX; } rec { return REC; } inherit { return INHERIT; } or { return OR_KW; } @@ -158,7 +158,7 @@ or { return OR_KW; } .errPos = data->state.positions[CUR_POS], }); } - return INT; + return INTX; } {FLOAT} { errno = 0; yylval->nf = strtod(yytext, 0); @@ -167,7 +167,7 @@ or { return OR_KW; } .msg = hintfmt("invalid float '%1%'", yytext), .errPos = data->state.positions[CUR_POS], }); - return FLOAT; + return FLOATX; } \$\{ { PUSH_STATE(DEFAULT); return DOLLAR_CURLY; } diff --git a/src/libexpr/local.mk b/src/libexpr/local.mk index 6579277ab943..f45ac6ac193a 100644 --- a/src/libexpr/local.mk +++ b/src/libexpr/local.mk @@ -11,12 +11,18 @@ libexpr_SOURCES := \ $(wildcard $(d)/flake/*.cc) \ $(d)/lexer-tab.cc \ $(d)/parser-tab.cc +ifdef HOST_UNIX + libexpr_SOURCES += $(wildcard $(d)/unix/*.cc) +endif libexpr_CXXFLAGS += $(INCLUDE_libutil) $(INCLUDE_libstore) -I src/libfetchers -I src/libmain -I src/libexpr libexpr_LIBS = libutil libstore libfetchers -libexpr_LDFLAGS += -lboost_context -pthread +libexpr_LDFLAGS += -lboost_context +ifdef HOST_UNIX + libexpr_LDFLAGS += -pthread +endif ifdef HOST_LINUX libexpr_LDFLAGS += -ldl endif diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index b86cef217b4c..491b357dfe78 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -340,11 +340,11 @@ void yyerror(YYLTYPE * loc, yyscan_t scanner, ParseData * data, const char * err %type attr %token ID %token STR IND_STR -%token INT -%token FLOAT +%token INTX +%token FLOATX %token PATH HPATH SPATH PATH_END %token URI -%token IF THEN ELSE ASSERT WITH LET IN REC INHERIT EQ NEQ AND OR IMPL OR_KW +%token IF THEN ELSE ASSERT WITH LET INX REC INHERIT EQ NEQ AND OR IMPL OR_KW %token DOLLAR_CURLY /* == ${ */ %token IND_STRING_OPEN IND_STRING_CLOSE %token ELLIPSIS @@ -387,7 +387,7 @@ expr_function { $$ = new ExprAssert(CUR_POS, $2, $4); } | WITH expr ';' expr_function { $$ = new ExprWith(CUR_POS, $2, $4); } - | LET binds IN expr_function + | LET binds INX expr_function { if (!$2->dynamicAttrs.empty()) throw ParseError({ .msg = hintfmt("dynamic attributes not allowed in let"), @@ -457,8 +457,8 @@ expr_simple else $$ = new ExprVar(CUR_POS, data->symbols.create($1)); } - | INT { $$ = new ExprInt($1); } - | FLOAT { $$ = new ExprFloat($1); } + | INTX { $$ = new ExprInt($1); } + | FLOATX { $$ = new ExprFloat($1); } | '"' string_parts '"' { $$ = $2; } | IND_STRING_OPEN ind_string_parts IND_STRING_CLOSE { $$ = stripIndentation(CUR_POS, data->symbols, std::move(*$2)); diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 8d3a18526473..06e769997388 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -25,7 +25,10 @@ #include #include #include -#include + +#ifndef _WIN32 +# include +#endif #include @@ -327,6 +330,8 @@ static RegisterPrimOp primop_import({ } }); +#ifndef _WIN32 + /* Want reasonable symbol names, so extern C */ /* !!! Should we pass the Pos or the file name too? */ extern "C" typedef void (*ValueInitializer)(EvalState & state, Value & v); @@ -399,6 +404,8 @@ void prim_exec(EvalState & state, const PosIdx pos, Value * * args, Value & v) } } +#endif + /* Return a string representing the type of the expression. */ static void prim_typeOf(EvalState & state, const PosIdx pos, Value * * args, Value & v) { @@ -2223,7 +2230,9 @@ static void addPath( arg2.mkString( S_ISREG(st.st_mode) ? "regular" : S_ISDIR(st.st_mode) ? "directory" : + #ifndef _WIN32 S_ISLNK(st.st_mode) ? "symlink" : + #endif "unknown" /* not supported, will fail! */); Value * args []{&arg1, &arg2}; @@ -4458,6 +4467,7 @@ void EvalState::createBaseEnv() )", }); +#ifndef _WIN32 // Miscellaneous if (evalSettings.enableNativeCode) { addPrimOp({ @@ -4471,6 +4481,7 @@ void EvalState::createBaseEnv() .fun = prim_exec, }); } +#endif addPrimOp({ .name = "__traceVerbose", diff --git a/src/libexpr/search-path.hh b/src/libexpr/search-path.hh index ce78135b51f1..231752ea66c5 100644 --- a/src/libexpr/search-path.hh +++ b/src/libexpr/search-path.hh @@ -8,6 +8,9 @@ namespace nix { +// Do not want the windows macro (alias to `SearchPathA`) +#undef SearchPath + /** * A "search path" is a list of ways look for something, used with * `builtins.findFile` and `< >` lookup expressions. diff --git a/src/libexpr/tests/primops.cc b/src/libexpr/tests/primops.cc index d820b860e7cf..5ed950653741 100644 --- a/src/libexpr/tests/primops.cc +++ b/src/libexpr/tests/primops.cc @@ -87,11 +87,13 @@ namespace nix { ASSERT_THAT(*p->value, IsIntEq(123)); } + #ifndef _WIN32 TEST_F(PrimOpTest, getEnv) { setenv("_NIX_UNIT_TEST_ENV_VALUE", "test value", 1); auto v = eval("builtins.getEnv \"_NIX_UNIT_TEST_ENV_VALUE\""); ASSERT_THAT(v, IsStringEq("test value")); } + #endif TEST_F(PrimOpTest, seq) { ASSERT_THROW(eval("let x = throw \"test\"; in builtins.seq x { }"), ThrownError); diff --git a/src/libfetchers/local.mk b/src/libfetchers/local.mk index 8319cac84c1e..e447225fdfc1 100644 --- a/src/libfetchers/local.mk +++ b/src/libfetchers/local.mk @@ -8,6 +8,8 @@ libfetchers_SOURCES := $(wildcard $(d)/*.cc) libfetchers_CXXFLAGS += $(INCLUDE_libutil) $(INCLUDE_libstore) -libfetchers_LDFLAGS += -pthread +ifdef HOST_UNIX + libfetchers_LDFLAGS += -pthread +endif libfetchers_LIBS = libutil libstore diff --git a/src/libfetchers/git.cc b/src/libfetchers/unix/git.cc similarity index 100% rename from src/libfetchers/git.cc rename to src/libfetchers/unix/git.cc diff --git a/src/libfetchers/mercurial.cc b/src/libfetchers/unix/mercurial.cc similarity index 100% rename from src/libfetchers/mercurial.cc rename to src/libfetchers/unix/mercurial.cc diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index dcbec4acd848..c88ca05de25e 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -1,5 +1,4 @@ #include "filetransfer.hh" -#include "namespaces.hh" #include "globals.hh" #include "store-api.hh" #include "s3.hh" @@ -12,6 +11,10 @@ #include #endif +#if __linux__ +# include "namespaces.hh" +#endif + #include #include @@ -243,12 +246,17 @@ struct curlFileTransfer : public FileTransfer int progressCallback(double dltotal, double dlnow) { + #ifndef _WIN32 try { - act.progress(dlnow, dltotal); + act.progress(dlnow, dltotal); } catch (nix::Interrupted &) { - assert(_isInterrupted); + assert(_isInterrupted); } return _isInterrupted; + #else + act.progress(dlnow, dltotal); + return false; + #endif } static int progressCallbackWrapper(void * userp, double dltotal, double dlnow, double ultotal, double ulnow) @@ -455,7 +463,11 @@ struct curlFileTransfer : public FileTransfer if (errorSink) response = std::move(errorSink->s); auto exc = + #ifndef _WIN32 code == CURLE_ABORTED_BY_CALLBACK && _isInterrupted + #else + false + #endif ? FileTransferError(Interrupted, std::move(response), "%s of '%s' was interrupted", request.verb(), request.uri) : httpStatus != 0 ? FileTransferError(err, @@ -505,10 +517,12 @@ struct curlFileTransfer : public FileTransfer Sync state_; + #ifndef _WIN32 /* We can't use a std::condition_variable to wake up the curl thread, because it only monitors file descriptors. So use a pipe instead. */ Pipe wakeupPipe; + #endif std::thread workerThread; @@ -528,8 +542,10 @@ struct curlFileTransfer : public FileTransfer fileTransferSettings.httpConnections.get()); #endif + #ifndef _WIN32 wakeupPipe.create(); fcntl(wakeupPipe.readSide.get(), F_SETFL, O_NONBLOCK); + #endif workerThread = std::thread([&]() { workerThreadEntry(); }); } @@ -550,17 +566,23 @@ struct curlFileTransfer : public FileTransfer auto state(state_.lock()); state->quit = true; } + #ifndef _WIN32 writeFull(wakeupPipe.writeSide.get(), " ", false); + #endif } void workerThreadMain() { /* Cause this thread to be notified on SIGINT. */ + #ifndef _WIN32 auto callback = createInterruptCallback([&]() { stopWorkerThread(); }); + #endif + #if __linux__ unshareFilesystem(); + #endif std::map> items; @@ -594,9 +616,11 @@ struct curlFileTransfer : public FileTransfer /* Wait for activity, including wakeup events. */ int numfds = 0; struct curl_waitfd extraFDs[1]; + #ifndef _WIN32 extraFDs[0].fd = wakeupPipe.readSide.get(); extraFDs[0].events = CURL_WAIT_POLLIN; extraFDs[0].revents = 0; + #endif long maxSleepTimeMs = items.empty() ? 10000 : 100; auto sleepTimeMs = nextWakeup != std::chrono::steady_clock::time_point() @@ -616,7 +640,7 @@ struct curlFileTransfer : public FileTransfer char buf[1024]; auto res = read(extraFDs[0].fd, buf, sizeof(buf)); if (res == -1 && errno != EINTR) - throw SysError("reading curl wakeup socket"); + throw PosixError("reading curl wakeup socket"); } std::vector> incoming; @@ -655,7 +679,9 @@ struct curlFileTransfer : public FileTransfer { try { workerThreadMain(); + #ifndef _WIN32 } catch (nix::Interrupted & e) { + #endif } catch (std::exception & e) { printError("unexpected error in download thread: %s", e.what()); } @@ -680,7 +706,9 @@ struct curlFileTransfer : public FileTransfer throw nix::Error("cannot enqueue download request because the download thread is shutting down"); state->incoming.push(item); } + #ifndef _WIN32 writeFull(wakeupPipe.writeSide.get(), " "); + #endif } #if ENABLE_S3 diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index cc416a4d6214..dc18a8f93720 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -10,13 +10,16 @@ #include #include #include -#include -#include #include #include +#ifndef _WIN32 +# include +# include +#endif + #ifdef __GLIBC__ # include # include @@ -59,7 +62,9 @@ Settings::Settings() , nixManDir(canonPath(NIX_MAN_DIR)) , nixDaemonSocketFile(canonPath(getEnvNonEmpty("NIX_DAEMON_SOCKET_PATH").value_or(nixStateDir + DEFAULT_SOCKET_PATH))) { +#ifndef _WIN32 buildUsersGroup = getuid() == 0 ? "nixbld" : ""; +#endif allowSymlinkedStore = getEnv("NIX_IGNORE_SYMLINK_STORE") == "1"; auto sslOverride = getEnv("NIX_SSL_CERT_FILE").value_or(getEnv("SSL_CERT_FILE").value_or("")); @@ -235,11 +240,15 @@ StringSet Settings::getDefaultExtraPlatforms() bool Settings::isWSL1() { +#if __linux__ struct utsname utsbuf; uname(&utsbuf); // WSL1 uses -Microsoft suffix // WSL2 uses -microsoft-standard suffix return hasSuffix(utsbuf.release, "-Microsoft"); +#else + return false; +#endif } Path Settings::getDefaultSSLCertFile() @@ -337,10 +346,14 @@ void initPlugins() for (const auto & file : pluginFiles) { /* handle is purposefully leaked as there may be state in the DSO needed by the action of the plugin. */ + #ifndef _WIN32 void *handle = dlopen(file.c_str(), RTLD_LAZY | RTLD_LOCAL); if (!handle) throw Error("could not dynamically open plugin file '%s': %s", file, dlerror()); + #else + throw Error("could not dynamically open plugin file '%s'", file); + #endif } } diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index 27caf42c4eda..5cafa8b9132b 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -539,6 +539,7 @@ public: Setting sandboxFallback{this, true, "sandbox-fallback", "Whether to disable sandboxing when the kernel doesn't allow it."}; +#ifndef _WIN32 Setting requireDropSupplementaryGroups{this, getuid() == 0, "require-drop-supplementary-groups", R"( Following the principle of least privilege, @@ -556,6 +557,7 @@ public: (since `root` usually has permissions to call setgroups) and `false` otherwise. )"}; +#endif #if __linux__ Setting sandboxShmSize{ diff --git a/src/libstore/local.mk b/src/libstore/local.mk index 4eea8caa49ee..fd330e7936ba 100644 --- a/src/libstore/local.mk +++ b/src/libstore/local.mk @@ -4,11 +4,20 @@ libstore_NAME = libnixstore libstore_DIR := $(d) -libstore_SOURCES := $(wildcard $(d)/*.cc $(d)/builtins/*.cc $(d)/build/*.cc) +libstore_SOURCES := $(wildcard $(d)/*.cc) +ifdef HOST_UNIX + libstore_SOURCES += $(wildcard $(d)/unix/*.cc $(d)/unix/builtins/*.cc $(d)/unix/build/*.cc) +endif +ifdef HOST_WINDOWS + libstore_SOURCES += $(wildcard $(d)/windows/*.cc) +endif libstore_LIBS = libutil -libstore_LDFLAGS += $(SQLITE3_LIBS) $(LIBCURL_LIBS) $(SODIUM_LIBS) -pthread +libstore_LDFLAGS += $(SQLITE3_LIBS) $(LIBCURL_LIBS) $(SODIUM_LIBS) +ifdef HOST_UNIX + libstore_LDFLAGS += -pthread +endif ifdef HOST_LINUX libstore_LDFLAGS += -ldl endif diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index 1035691c74e1..d66eded6e74e 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -1,7 +1,9 @@ #include "derivations.hh" #include "parsed-derivations.hh" #include "globals.hh" -#include "local-store.hh" +#ifndef _WIN32 +# include "local-store.hh" +#endif #include "store-api.hh" #include "thread-pool.hh" #include "topo-sort.hh" diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc index d7432a3059e5..d2124f981443 100644 --- a/src/libstore/sqlite.cc +++ b/src/libstore/sqlite.cc @@ -8,6 +8,10 @@ #include +#ifdef _WIN32 +# include +#endif + namespace nix { SQLiteError::SQLiteError(const char *path, const char *errMsg, int errNo, int extendedErrNo, int offset, hintformat && hf) @@ -256,10 +260,14 @@ void handleSQLiteBusy(const SQLiteBusy & e, time_t & nextWarning) /* Sleep for a while since retrying the transaction right away is likely to fail again. */ checkInterrupt(); + #ifndef _WIN32 struct timespec t; t.tv_sec = 0; t.tv_nsec = (random() % 100) * 1000 * 1000; /* <= 0.1s */ nanosleep(&t, 0); + #else + Sleep(rand() % 100); + #endif } } diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 0f88d9b92f02..70c30a82697f 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -10,13 +10,16 @@ #include "references.hh" #include "archive.hh" #include "callback.hh" -#include "remote-store.hh" // FIXME this should not be here, see TODO below on // `addMultipleToStore`. #include "worker-protocol.hh" #include "signals.hh" #include "users.hh" +#ifndef _WIN32 +# include "remote-store.hh" +#endif + #include #include @@ -1298,9 +1301,10 @@ Derivation Store::readInvalidDerivation(const StorePath & drvPath) } - -#include "local-store.hh" -#include "uds-remote-store.hh" +#ifndef _WIN32 +# include "local-store.hh" +# include "uds-remote-store.hh" +#endif namespace nix { @@ -1318,6 +1322,7 @@ std::pair splitUriAndParams(const std::string & uri_ return {uri, params}; } +#ifndef _WIN32 static bool isNonUriPath(const std::string & spec) { return @@ -1327,9 +1332,11 @@ static bool isNonUriPath(const std::string & spec) // might be special like "auto" && spec.find("/") != std::string::npos; } +#endif std::shared_ptr openFromNonUri(const std::string & uri, const Store::Params & params) { + #ifndef _WIN32 if (uri == "" || uri == "auto") { auto stateDir = getOr(params, "state", settings.nixStateDir); if (access(stateDir.c_str(), R_OK | W_OK) == 0) @@ -1374,6 +1381,9 @@ std::shared_ptr openFromNonUri(const std::string & uri, const Store::Para } else { return nullptr; } + #else + return nullptr; + #endif } // The `parseURL` function supports both IPv6 URIs as defined in diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/unix/binary-cache-store.cc similarity index 100% rename from src/libstore/binary-cache-store.cc rename to src/libstore/unix/binary-cache-store.cc diff --git a/src/libstore/binary-cache-store.hh b/src/libstore/unix/binary-cache-store.hh similarity index 100% rename from src/libstore/binary-cache-store.hh rename to src/libstore/unix/binary-cache-store.hh diff --git a/src/libstore/daemon.cc b/src/libstore/unix/daemon.cc similarity index 100% rename from src/libstore/daemon.cc rename to src/libstore/unix/daemon.cc diff --git a/src/libstore/daemon.hh b/src/libstore/unix/daemon.hh similarity index 100% rename from src/libstore/daemon.hh rename to src/libstore/unix/daemon.hh diff --git a/src/libstore/gc.cc b/src/libstore/unix/gc.cc similarity index 100% rename from src/libstore/gc.cc rename to src/libstore/unix/gc.cc diff --git a/src/libstore/http-binary-cache-store.cc b/src/libstore/unix/http-binary-cache-store.cc similarity index 100% rename from src/libstore/http-binary-cache-store.cc rename to src/libstore/unix/http-binary-cache-store.cc diff --git a/src/libstore/http-binary-cache-store.md b/src/libstore/unix/http-binary-cache-store.md similarity index 100% rename from src/libstore/http-binary-cache-store.md rename to src/libstore/unix/http-binary-cache-store.md diff --git a/src/libstore/legacy-ssh-store.cc b/src/libstore/unix/legacy-ssh-store.cc similarity index 100% rename from src/libstore/legacy-ssh-store.cc rename to src/libstore/unix/legacy-ssh-store.cc diff --git a/src/libstore/legacy-ssh-store.md b/src/libstore/unix/legacy-ssh-store.md similarity index 100% rename from src/libstore/legacy-ssh-store.md rename to src/libstore/unix/legacy-ssh-store.md diff --git a/src/libstore/local-binary-cache-store.cc b/src/libstore/unix/local-binary-cache-store.cc similarity index 100% rename from src/libstore/local-binary-cache-store.cc rename to src/libstore/unix/local-binary-cache-store.cc diff --git a/src/libstore/local-binary-cache-store.md b/src/libstore/unix/local-binary-cache-store.md similarity index 100% rename from src/libstore/local-binary-cache-store.md rename to src/libstore/unix/local-binary-cache-store.md diff --git a/src/libstore/local-store.cc b/src/libstore/unix/local-store.cc similarity index 100% rename from src/libstore/local-store.cc rename to src/libstore/unix/local-store.cc diff --git a/src/libstore/local-store.hh b/src/libstore/unix/local-store.hh similarity index 100% rename from src/libstore/local-store.hh rename to src/libstore/unix/local-store.hh diff --git a/src/libstore/local-store.md b/src/libstore/unix/local-store.md similarity index 100% rename from src/libstore/local-store.md rename to src/libstore/unix/local-store.md diff --git a/src/libstore/lock.cc b/src/libstore/unix/lock.cc similarity index 100% rename from src/libstore/lock.cc rename to src/libstore/unix/lock.cc diff --git a/src/libstore/lock.hh b/src/libstore/unix/lock.hh similarity index 100% rename from src/libstore/lock.hh rename to src/libstore/unix/lock.hh diff --git a/src/libstore/optimise-store.cc b/src/libstore/unix/optimise-store.cc similarity index 100% rename from src/libstore/optimise-store.cc rename to src/libstore/unix/optimise-store.cc diff --git a/src/libstore/pathlocks.cc b/src/libstore/unix/pathlocks.cc similarity index 100% rename from src/libstore/pathlocks.cc rename to src/libstore/unix/pathlocks.cc diff --git a/src/libstore/pathlocks.hh b/src/libstore/unix/pathlocks.hh similarity index 100% rename from src/libstore/pathlocks.hh rename to src/libstore/unix/pathlocks.hh diff --git a/src/libstore/profiles.cc b/src/libstore/unix/profiles.cc similarity index 100% rename from src/libstore/profiles.cc rename to src/libstore/unix/profiles.cc diff --git a/src/libstore/profiles.hh b/src/libstore/unix/profiles.hh similarity index 100% rename from src/libstore/profiles.hh rename to src/libstore/unix/profiles.hh diff --git a/src/libstore/remote-fs-accessor.cc b/src/libstore/unix/remote-fs-accessor.cc similarity index 100% rename from src/libstore/remote-fs-accessor.cc rename to src/libstore/unix/remote-fs-accessor.cc diff --git a/src/libstore/remote-fs-accessor.hh b/src/libstore/unix/remote-fs-accessor.hh similarity index 100% rename from src/libstore/remote-fs-accessor.hh rename to src/libstore/unix/remote-fs-accessor.hh diff --git a/src/libstore/remote-store-connection.hh b/src/libstore/unix/remote-store-connection.hh similarity index 100% rename from src/libstore/remote-store-connection.hh rename to src/libstore/unix/remote-store-connection.hh diff --git a/src/libstore/remote-store.cc b/src/libstore/unix/remote-store.cc similarity index 100% rename from src/libstore/remote-store.cc rename to src/libstore/unix/remote-store.cc diff --git a/src/libstore/remote-store.hh b/src/libstore/unix/remote-store.hh similarity index 100% rename from src/libstore/remote-store.hh rename to src/libstore/unix/remote-store.hh diff --git a/src/libstore/ssh-store.cc b/src/libstore/unix/ssh-store.cc similarity index 100% rename from src/libstore/ssh-store.cc rename to src/libstore/unix/ssh-store.cc diff --git a/src/libstore/ssh-store.md b/src/libstore/unix/ssh-store.md similarity index 100% rename from src/libstore/ssh-store.md rename to src/libstore/unix/ssh-store.md diff --git a/src/libstore/ssh.cc b/src/libstore/unix/ssh.cc similarity index 100% rename from src/libstore/ssh.cc rename to src/libstore/unix/ssh.cc diff --git a/src/libstore/ssh.hh b/src/libstore/unix/ssh.hh similarity index 100% rename from src/libstore/ssh.hh rename to src/libstore/unix/ssh.hh diff --git a/src/libstore/uds-remote-store.cc b/src/libstore/unix/uds-remote-store.cc similarity index 100% rename from src/libstore/uds-remote-store.cc rename to src/libstore/unix/uds-remote-store.cc diff --git a/src/libstore/uds-remote-store.hh b/src/libstore/unix/uds-remote-store.hh similarity index 100% rename from src/libstore/uds-remote-store.hh rename to src/libstore/unix/uds-remote-store.hh diff --git a/src/libstore/uds-remote-store.md b/src/libstore/unix/uds-remote-store.md similarity index 100% rename from src/libstore/uds-remote-store.md rename to src/libstore/unix/uds-remote-store.md diff --git a/src/libstore/windows/build.cc b/src/libstore/windows/build.cc new file mode 100644 index 000000000000..3eadc5bdaf3c --- /dev/null +++ b/src/libstore/windows/build.cc @@ -0,0 +1,37 @@ +#include "store-api.hh" +#include "build-result.hh" + +namespace nix { + +void Store::buildPaths(const std::vector & reqs, BuildMode buildMode, std::shared_ptr evalStore) +{ + unsupported("buildPaths"); +} + +std::vector Store::buildPathsWithResults( + const std::vector & reqs, + BuildMode buildMode, + std::shared_ptr evalStore) +{ + unsupported("buildPathsWithResults"); +} + +BuildResult Store::buildDerivation(const StorePath & drvPath, const BasicDerivation & drv, + BuildMode buildMode) +{ + unsupported("buildDerivation"); +} + + +void Store::ensurePath(const StorePath & path) +{ + unsupported("ensurePath"); +} + + +void Store::repairPath(const StorePath & path) +{ + unsupported("repairPath"); +} + +}