[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/08: Export outputPaths function
From: |
Ludovic Courtès |
Subject: |
03/08: Export outputPaths function |
Date: |
Thu, 02 Jul 2015 22:34:04 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit 60bda60fc06135aa97a93301b1a9e2270768f5b3
Author: Eelco Dolstra <address@hidden>
Date: Wed Jun 10 16:17:06 2015 +0200
Export outputPaths function
This is useful for the new hydra-queue-runner.
---
nix/libstore/build.cc | 13 ++-----------
nix/libstore/derivations.cc | 9 +++++++++
nix/libstore/derivations.hh | 1 +
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index 7159d7b..9041ae0 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -1188,15 +1188,6 @@ void DerivationGoal::inputsRealised()
}
-PathSet outputPaths(const DerivationOutputs & outputs)
-{
- PathSet paths;
- foreach (DerivationOutputs::const_iterator, i, outputs)
- paths.insert(i->second.path);
- return paths;
-}
-
-
static bool canBuildLocally(const string & platform)
{
return platform == settings.thisSystem
@@ -1248,7 +1239,7 @@ void DerivationGoal::tryToBuild()
can't acquire the lock, then continue; hopefully some other
goal can start a build, and if not, the main loop will sleep a
few seconds and then retry this goal. */
- if (!outputLocks.lockPaths(outputPaths(drv.outputs), "", false)) {
+ if (!outputLocks.lockPaths(outputPaths(drv), "", false)) {
worker.waitForAWhile(shared_from_this());
return;
}
@@ -1269,7 +1260,7 @@ void DerivationGoal::tryToBuild()
return;
}
- missingPaths = outputPaths(drv.outputs);
+ missingPaths = outputPaths(drv);
if (buildMode != bmCheck)
foreach (PathSet::iterator, i, validPaths) missingPaths.erase(*i);
diff --git a/nix/libstore/derivations.cc b/nix/libstore/derivations.cc
index b452aa2..d316f6c 100644
--- a/nix/libstore/derivations.cc
+++ b/nix/libstore/derivations.cc
@@ -285,4 +285,13 @@ bool wantOutput(const string & output, const
std::set<string> & wanted)
}
+PathSet outputPaths(const Derivation & drv)
+{
+ PathSet paths;
+ for (auto & i : drv.outputs)
+ paths.insert(i.second.path);
+ return paths;
+}
+
+
}
diff --git a/nix/libstore/derivations.hh b/nix/libstore/derivations.hh
index 04b64df..8d5e4d0 100644
--- a/nix/libstore/derivations.hh
+++ b/nix/libstore/derivations.hh
@@ -89,5 +89,6 @@ Path makeDrvPathWithOutputs(const Path & drvPath, const
std::set<string> & outpu
bool wantOutput(const string & output, const std::set<string> & wanted);
+PathSet outputPaths(const Derivation & drv);
}
- branch nix updated (e531520 -> 0dccab9), Ludovic Courtès, 2015/07/02
- 01/08: Allow substitutes for builds that have preferLocalBuild set, Ludovic Courtès, 2015/07/02
- 03/08: Export outputPaths function,
Ludovic Courtès <=
- 04/08: Make /nix/var/nix/db/reserved bigger, Ludovic Courtès, 2015/07/02
- 05/08: Use posix_fallocate to create /nix/var/nix/db/reserved, Ludovic Courtès, 2015/07/02
- 06/08: GC: Handle ENOSPC creating/moving to the trash directory, Ludovic Courtès, 2015/07/02
- 02/08: Use std::vector::data(), Ludovic Courtès, 2015/07/02
- 08/08: Typo, Ludovic Courtès, 2015/07/02
- 07/08: Preserve supplementary groups of build users, Ludovic Courtès, 2015/07/02