From c878cee8954151aaa1054af7ef3746a979b05832 Mon Sep 17 00:00:00 2001
From: regnat <rg@regnat.ovh>
Date: Tue, 22 Jun 2021 10:50:28 +0200
Subject: [PATCH] Assert that compatible realisations have the same
 dependencies
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Should always hold, but that’s not necessarily obvious, so better
enforce it
---
 src/libstore/realisation.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/libstore/realisation.cc b/src/libstore/realisation.cc
index 76aec74ce..eadec594c 100644
--- a/src/libstore/realisation.cc
+++ b/src/libstore/realisation.cc
@@ -143,7 +143,11 @@ StorePath RealisedPath::path() const {
 bool Realisation::isCompatibleWith(const Realisation & other) const
 {
     assert (id == other.id);
-    return outPath == other.outPath;
+    if (outPath == other.outPath) {
+        assert(dependentRealisations == other.dependentRealisations);
+        return true;
+    }
+    return false;
 }
 
 void RealisedPath::closure(
-- 
GitLab