From a18d9269a516c5f8149b04ccb01034960f4851d8 Mon Sep 17 00:00:00 2001 From: Alex Shabalin Date: Fri, 19 Nov 2021 15:22:31 +0100 Subject: [PATCH 1/2] Fix build warnings on MacOS --- src/libstore/build/local-derivation-goal.cc | 5 ++++- src/libstore/gc.cc | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index 3c7bd695e..c9a4a31e7 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -342,7 +342,7 @@ int childEntry(void * arg) return 1; } - +#if __linux__ static void linkOrCopy(const Path & from, const Path & to) { if (link(from.c_str(), to.c_str()) == -1) { @@ -358,6 +358,7 @@ static void linkOrCopy(const Path & from, const Path & to) copyPath(from, to); } } +#endif void LocalDerivationGoal::startBuilder() @@ -917,7 +918,9 @@ void LocalDerivationGoal::startBuilder() } else #endif { +#if __linux__ fallback: +#endif pid = startProcess([&]() { runChild(); }); diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 8030c84f5..29d45e067 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -324,6 +324,7 @@ static string quoteRegexChars(const string & raw) return std::regex_replace(raw, specialRegex, R"(\$&)"); } +#if defined(__linux__) static void readFileRoots(const char * path, UncheckedRoots & roots) { try { @@ -333,6 +334,7 @@ static void readFileRoots(const char * path, UncheckedRoots & roots) throw; } } +#endif void LocalStore::findRuntimeRoots(Roots & roots, bool censor) { From db2e4489a54c1c4bf5bd8fd2deb8b3fd02a712f1 Mon Sep 17 00:00:00 2001 From: Alex Shabalin Date: Mon, 22 Nov 2021 13:57:56 +0100 Subject: [PATCH 2/2] Unify #if linux --- src/libstore/gc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 29d45e067..7a414da6b 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -324,7 +324,7 @@ static string quoteRegexChars(const string & raw) return std::regex_replace(raw, specialRegex, R"(\$&)"); } -#if defined(__linux__) +#if __linux__ static void readFileRoots(const char * path, UncheckedRoots & roots) { try { @@ -416,7 +416,7 @@ void LocalStore::findRuntimeRoots(Roots & roots, bool censor) } #endif -#if defined(__linux__) +#if __linux__ readFileRoots("/proc/sys/kernel/modprobe", unchecked); readFileRoots("/proc/sys/kernel/fbsplash", unchecked); readFileRoots("/proc/sys/kernel/poweroff_cmd", unchecked);