From bcde5456cc3295061a0726881c3e441444dd6680 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 21 Mar 2020 11:07:16 -0400 Subject: [PATCH] Flip dependency so store-api.hh includes derivations.hh I think it makes more sense to define the data model (derivations), before the operations (store api). --- src/libexpr/get-drvs.cc | 2 +- src/libexpr/primops/context.cc | 2 +- src/libstore/derivations.hh | 3 ++- src/libstore/parsed-derivations.hh | 2 +- src/libstore/store-api.hh | 4 +--- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index ca9c547fa..16f7b5637 100644 --- a/src/libexpr/get-drvs.cc +++ b/src/libexpr/get-drvs.cc @@ -1,7 +1,7 @@ #include "get-drvs.hh" #include "util.hh" #include "eval-inline.hh" -#include "derivations.hh" +#include "store-api.hh" #include #include diff --git a/src/libexpr/primops/context.cc b/src/libexpr/primops/context.cc index 94fa0158c..66d8bab1f 100644 --- a/src/libexpr/primops/context.cc +++ b/src/libexpr/primops/context.cc @@ -1,6 +1,6 @@ #include "primops.hh" #include "eval-inline.hh" -#include "derivations.hh" +#include "store-api.hh" namespace nix { diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh index 7222d25e5..a3651de23 100644 --- a/src/libstore/derivations.hh +++ b/src/libstore/derivations.hh @@ -1,8 +1,8 @@ #pragma once +#include "path.hh" #include "types.hh" #include "hash.hh" -#include "store-api.hh" #include @@ -76,6 +76,7 @@ struct Derivation : BasicDerivation class Store; +enum RepairFlag : bool { NoRepair = false, Repair = true }; /* Write a derivation to the Nix store, and return its path. */ StorePath writeDerivation(ref store, diff --git a/src/libstore/parsed-derivations.hh b/src/libstore/parsed-derivations.hh index f4df5dd54..d0cc70f9c 100644 --- a/src/libstore/parsed-derivations.hh +++ b/src/libstore/parsed-derivations.hh @@ -1,4 +1,4 @@ -#include "derivations.hh" +#include "store-api.hh" #include diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 0fa59be6a..396709633 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -8,6 +8,7 @@ #include "sync.hh" #include "globals.hh" #include "config.hh" +#include "derivations.hh" #include #include @@ -30,15 +31,12 @@ MakeError(SubstituteGone, Error); MakeError(SubstituterDisabled, Error); -struct BasicDerivation; -struct Derivation; class FSAccessor; class NarInfoDiskCache; class Store; class JSONPlaceholder; -enum RepairFlag : bool { NoRepair = false, Repair = true }; enum CheckSigsFlag : bool { NoCheckSigs = false, CheckSigs = true }; enum SubstituteFlag : bool { NoSubstitute = false, Substitute = true }; enum AllowInvalidFlag : bool { DisallowInvalid = false, AllowInvalid = true };