unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Lirzin <mthl@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Cuirass and duplicate derivations
Date: Mon, 09 Jan 2017 01:41:42 +0100	[thread overview]
Message-ID: <87a8b1xdx5.fsf@gnu.org> (raw)
In-Reply-To: <87tw99yw8l.fsf@gnu.org> (Mathieu Lirzin's message of "Mon, 09 Jan 2017 00:20:42 +0100")

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

Mathieu Lirzin <mthl@gnu.org> writes:

> ludo@gnu.org (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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-database-db-add-derivation-Don-t-try-to-add-a-deriva.patch --]
[-- Type: text/x-diff, Size: 1036 bytes --]

From 568d0e1b0866a45e95440d17b6e8f1740cc23e3f Mon Sep 17 00:00:00 2001
From: Mathieu Lirzin <mthl@gnu.org>
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


[-- Attachment #3: Type: text/plain, Size: 92 bytes --]


WDYT?

Thanks.

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

  reply	other threads:[~2017-01-09  0:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87r35o8x0h.fsf@gnu.org>
     [not found] ` <87shq35tue.fsf@gnu.org>
     [not found]   ` <87y3zv4c4i.fsf@gnu.org>
     [not found]     ` <87fuljj5ku.fsf@gnu.org>
     [not found]       ` <87tw9mzq4v.fsf@gnu.org>
2017-01-02 21:40         ` Cuirass and duplicate derivations Ludovic Courtès
2017-01-08 23:20           ` Mathieu Lirzin
2017-01-09  0:41             ` Mathieu Lirzin [this message]
2017-01-09  9:11               ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8b1xdx5.fsf@gnu.org \
    --to=mthl@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).