diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-02-02T17·24+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-02-02T17·24+0000 |
commit | b682fae9d93037af65282e02b88a9ce34129026e (patch) | |
tree | 2e349a7480d315561bf40864e405b51f9c3ee16d /src/libstore/local-store.cc | |
parent | 6f8c96d12399b747b5f41b5211a635d2801247c8 (diff) |
* Build hooks: use nix-store --import. This prevents a redundant
scan for runtime dependencies (i.e. the local machine shouldn't do a scan that the remote machine has already done). Also pipe directly into `nix-store --import': don't use a temporary file.
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r-- | src/libstore/local-store.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 159f28c91860..1d0c68cb88a5 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -924,7 +924,14 @@ Path LocalStore::importPath(bool requireSignature, Source & source) if (!isValidPath(dstPath)) { - PathLocks outputLock(singleton<PathSet, Path>(dstPath)); + PathLocks outputLock; + + /* 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). */ + Strings locksHeld = tokenizeString(getEnv("NIX_HELD_LOCKS")); + if (find(locksHeld.begin(), locksHeld.end(), dstPath) == locksHeld.end()) + outputLock.lockPaths(singleton<PathSet, Path>(dstPath)); if (!isValidPath(dstPath)) { |