guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cuirass and duplicate derivations


From: Mathieu Lirzin
Subject: Re: Cuirass and duplicate derivations
Date: Mon, 09 Jan 2017 01:41:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Mathieu Lirzin <address@hidden> writes:

> address@hidden (Ludovic Courtès) writes:
>
>> What change would you suggest to solve this problem?  It would be best
>> if Cuirass allowed several jobs building the same derivations (the key
>> could be an autoincrement counter instead of the (drv,eval) pair maybe?)
>
> Seems reasonable to me.  I will do that.
> Thanks.

After a second thought, I think maybe it is sufficient to just ignore
when a derivation is added twice by an evaluation.  As a consequence
'cuirass' will only try to realize the derivation once per evaluation.

>From 568d0e1b0866a45e95440d17b6e8f1740cc23e3f Mon Sep 17 00:00:00 2001
From: Mathieu Lirzin <address@hidden>
Date: Mon, 9 Jan 2017 01:29:48 +0100
Subject: [PATCH] database: db-add-derivation: Don't try to add a derivation
 twice.

* src/cuirass/database.scm (db-add-derivation): Ignore if JOB is already
present in DB.
---
 src/cuirass/database.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 870cdc0..702e643 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -147,7 +147,7 @@ INSERT OR IGNORE INTO Specifications (repo_name, url, 
load_path, file, \
 (define (db-add-derivation db job)
   "Store a derivation result in database DB and return its ID."
   (sqlite-exec db "\
-INSERT INTO Derivations (derivation, job_name, evaluation)\
+INSERT OR IGNORE INTO Derivations (derivation, job_name, evaluation)\
   VALUES ('~A', '~A', '~A');"
                (assq-ref job #:derivation)
                (assq-ref job #:job-name)
-- 
2.11.0

WDYT?

Thanks.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

reply via email to

[Prev in Thread] Current Thread [Next in Thread]