Skip to content

Commit

Permalink
Fix hang in build-remote
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Feb 12, 2018
1 parent 4f09ce7 commit 9bcb4d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/build-remote/build-remote.cc
Expand Up @@ -241,7 +241,7 @@ int main (int argc, char * * argv)

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

Expand Down
1 change: 0 additions & 1 deletion src/libstore/local-store.cc
Expand Up @@ -992,7 +992,6 @@ void LocalStore::addToStore(const ValidPathInfo & info, const ref<std::string> &
/* Lock the output path. But don't lock if we're being called
from a build hook (whose parent process already acquired a
lock on this path). */
static auto locksHeld = tokenizeString<PathSet>(getEnv("NIX_HELD_LOCKS"));
if (!locksHeld.count(info.path))
outputLock.lockPaths({realPath});

Expand Down
3 changes: 3 additions & 0 deletions src/libstore/local-store.hh
Expand Up @@ -104,6 +104,9 @@ private:

public:

// Hack for build-remote.cc.
PathSet locksHeld = tokenizeString<PathSet>(getEnv("NIX_HELD_LOCKS"));

/* Initialise the local store, upgrading the schema if
necessary. */
LocalStore(const Params & params);
Expand Down

0 comments on commit 9bcb4d2

Please sign in to comment.