Subject: [PATCH] daemon: Add const qualifier to comparison call operator.

From: Dariqq <[email-masked]>
Date: Wed, 14 May 2025 07:39:26 +0000

* nix/libstore/build.cc (CompareGoalPtrs::operator()): Add const qualifier.

Change-Id: Ieccea071db53715ef808fe59c69429fe228b5f77
---
Hello,
I had to add this patch to build guix on Fedora 42 and got a template error without it.
It corresponds to this commit in nix from 2017:
https://github.com/NixOS/nix/commit/00e0c416ffccf6edb63fe7f4b01422915ff12f86

 nix/libstore/build.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index a1f39d9a8bf..f80f69f2bb6 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -94,7 +94,7 @@ typedef std::shared_ptr<Goal> GoalPtr;
 typedef std::weak_ptr<Goal> WeakGoalPtr;
 
 struct CompareGoalPtrs {
-    bool operator() (const GoalPtr & a, const GoalPtr & b);
+    bool operator() (const GoalPtr & a, const GoalPtr & b) const;
 };
 
 /* Set of goals. */
@@ -192,7 +192,7 @@ protected:
 };

-bool CompareGoalPtrs::operator() (const GoalPtr & a, const GoalPtr & b) {
+bool CompareGoalPtrs::operator() (const GoalPtr & a, const GoalPtr & b) const{
     string s1 = a->key();
     string s2 = b->key();
     return s1 < s2;

base-commit: 5f5d84beccc180f1b51474c0e47eb6e0d0c9175f
-- 
2.49.0