From f7099965bfa1ec00cce28f6ed0d5daf3bc093759 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 12 Oct 2020 17:08:52 +0000 Subject: [PATCH] Change .cc files to use split build headers --- src/libstore/build/derivation-goal.cc | 17 ++++++++++++++++- src/libstore/build/goal.cc | 3 ++- src/libstore/build/hook-instance.cc | 3 ++- src/libstore/build/local-store-build.cc | 5 ++++- src/libstore/build/substitution-goal.cc | 3 ++- src/libstore/build/worker.cc | 6 +++++- 6 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index bb8921759..241e52116 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -1,4 +1,6 @@ -#include "build.hh" +#include "derivation-goal.hh" +#include "hook-instance.hh" +#include "worker.hh" #include "builtins.hh" #include "builtins/buildenv.hh" #include "references.hh" @@ -12,6 +14,9 @@ #include "topo-sort.hh" #include "callback.hh" +#include +#include + #include #include #include @@ -140,6 +145,16 @@ DerivationGoal::~DerivationGoal() } +string DerivationGoal::key() +{ + /* Ensure that derivations get built in order of their name, + i.e. a derivation named "aardvark" always comes before + "baboon". And substitution goals always happen before + derivation goals (due to "b$"). */ + return "b$" + std::string(drvPath.name()) + "$" + worker.store.printStorePath(drvPath); +} + + inline bool DerivationGoal::needsHashRewrite() { #if __linux__ diff --git a/src/libstore/build/goal.cc b/src/libstore/build/goal.cc index 404a430f7..2dd7a4d37 100644 --- a/src/libstore/build/goal.cc +++ b/src/libstore/build/goal.cc @@ -1,4 +1,5 @@ -#include "build.hh" +#include "goal.hh" +#include "worker.hh" namespace nix { diff --git a/src/libstore/build/hook-instance.cc b/src/libstore/build/hook-instance.cc index a33d5e22b..0f6f580be 100644 --- a/src/libstore/build/hook-instance.cc +++ b/src/libstore/build/hook-instance.cc @@ -1,4 +1,5 @@ -#include "build.hh" +#include "globals.hh" +#include "hook-instance.hh" namespace nix { diff --git a/src/libstore/build/local-store-build.cc b/src/libstore/build/local-store-build.cc index 407979b1e..a05fb5805 100644 --- a/src/libstore/build/local-store-build.cc +++ b/src/libstore/build/local-store-build.cc @@ -1,4 +1,7 @@ -#include "build.hh" +#include "machines.hh" +#include "worker.hh" +#include "substitution-goal.hh" +#include "derivation-goal.hh" namespace nix { diff --git a/src/libstore/build/substitution-goal.cc b/src/libstore/build/substitution-goal.cc index dd2ce94a6..d16584f65 100644 --- a/src/libstore/build/substitution-goal.cc +++ b/src/libstore/build/substitution-goal.cc @@ -1,4 +1,5 @@ -#include "build.hh" +#include "worker.hh" +#include "substitution-goal.hh" #include "nar-info.hh" #include "finally.hh" diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc index 2fc9f6982..5c3fe2f57 100644 --- a/src/libstore/build/worker.cc +++ b/src/libstore/build/worker.cc @@ -1,4 +1,8 @@ -#include "build.hh" +#include "machines.hh" +#include "worker.hh" +#include "substitution-goal.hh" +#include "derivation-goal.hh" +#include "hook-instance.hh" #include