Skip to content

Commit 9bcb4d2

Browse files
committed
Fix hang in build-remote
1 parent 4f09ce7 commit 9bcb4d2

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/build-remote/build-remote.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ int main (int argc, char * * argv)
241241

242242
if (!missing.empty()) {
243243
Activity act(*logger, lvlTalkative, actUnknown, fmt("copying outputs from '%s'", storeUri));
244-
setenv("NIX_HELD_LOCKS", concatStringsSep(" ", missing).c_str(), 1); /* FIXME: ugly */
244+
store->locksHeld.insert(missing.begin(), missing.end()); /* FIXME: ugly */
245245
copyPaths(ref<Store>(sshStore), store, missing, NoRepair, NoCheckSigs, substitute);
246246
}
247247

src/libstore/local-store.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,6 @@ void LocalStore::addToStore(const ValidPathInfo & info, const ref<std::string> &
992992
/* Lock the output path. But don't lock if we're being called
993993
from a build hook (whose parent process already acquired a
994994
lock on this path). */
995-
static auto locksHeld = tokenizeString<PathSet>(getEnv("NIX_HELD_LOCKS"));
996995
if (!locksHeld.count(info.path))
997996
outputLock.lockPaths({realPath});
998997

src/libstore/local-store.hh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ private:
104104

105105
public:
106106

107+
// Hack for build-remote.cc.
108+
PathSet locksHeld = tokenizeString<PathSet>(getEnv("NIX_HELD_LOCKS"));
109+
107110
/* Initialise the local store, upgrading the schema if
108111
necessary. */
109112
LocalStore(const Params & params);

0 commit comments

Comments
 (0)