From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#28094: cuirass =?UTF-8?Q?doesn=E2=80=99t?= build i686 things Date: Sat, 26 Aug 2017 01:08:52 +0200 Message-ID: <87fucfdz3v.fsf@gnu.org> References: <877ey5gtsc.fsf@elephly.net> <87378sklwe.fsf@elephly.net> <87o9r6ql0i.fsf@elephly.net> <87lgm9qvlr.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlNjp-0001Xe-I6 for bug-guix@gnu.org; Fri, 25 Aug 2017 19:10:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlNjm-00021D-6Z for bug-guix@gnu.org; Fri, 25 Aug 2017 19:10:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46546) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dlNjm-000218-2m for bug-guix@gnu.org; Fri, 25 Aug 2017 19:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dlNjl-0008Be-TF for bug-guix@gnu.org; Fri, 25 Aug 2017 19:10:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87lgm9qvlr.fsf@elephly.net> (Ricardo Wurmus's message of "Thu, 24 Aug 2017 09:21:36 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ricardo Wurmus Cc: 28094@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Heya! Ricardo Wurmus skribis: > After restarting Cuirass I got this error again: > > =E2=80=A6 > evaluate 'mips64el-linux-gnu.mpc-1.0.3.i686-linux': 104000.000 seconds > evaluate 'mips64el-linux-gnu.coreutils-8.27.i686-linux': -608068998.000 s= econds > evaluate 'mips64el-linux-gnu.findutils-4.6.0.i686-linux': 141217000.000 s= econds > evaluate 'mips64el-linux-gnu.diffutils-3.5.i686-linux': 119447000.000 sec= onds > evaluate 'mips64el-linux-gnu.patch-2.7.5.i686-linux': -853410998.000 seco= nds > /gnu/store/1bil0xyhpim3cfyaifdpb2jsjdni2hif-hplip-3.17.7 > /gnu/store/n7mf8hk262rnlhrjqmacnkp1yn518ks4-cups-minimal-2.2.1 > /gnu/store/lvfymniwbz33an5a2hakf4b1c57lrdwr-cups-filters-1.13.1 > /gnu/store/60671wa0i1fljll26fx7lxfl27fb27si-curl-7.55.0-doc /gnu/store/nm= fwf4fkvb4mfyi7m5sn1daklkjsz9mn-curl-7.55.0 > /gnu/store/53vb094sihb819hk124qvfjq8vz78252-curl-7.53.0-doc /gnu/store/9i= hxpf7al0znb19lx0bk6ymjp6nxhn9y-curl-7.53.0 > Database error with INSERT INTO Builds (derivation, evaluation, log, outp= ut) VALUES ('~A', '~A', '~A', '~A'); and (/gnu/store/zg0zpndricjwwbjv5087z= w9hmdcd708y-curl-7.55.0.drv 3 #f /gnu/store/60671wa0i1fljll26fx7lxfl27fb27s= i-curl-7.55.0-doc) > In ice-9/boot-9.scm: > 230:29 19 (map1 (((#:eval-id . 3) (#:duration . 76000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:29 18 (map1 (((#:eval-id . 3) (#:duration . 110000.0) # # =E2=80= =A6) =E2=80=A6)) > 230:29 17 (map1 (((#:eval-id . 3) (#:duration . 115000.0) # # =E2=80= =A6) =E2=80=A6)) > 230:29 16 (map1 (((#:eval-id . 3) (#:duration . 82000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:29 15 (map1 (((#:eval-id . 3) (#:duration . 98000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:29 14 (map1 (((#:eval-id . 3) (#:duration . 97000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:29 13 (map1 (((#:eval-id . 3) (#:duration . 90000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:29 12 (map1 (((#:eval-id . 3) (#:duration . 75000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:29 11 (map1 (((#:eval-id . 3) (#:duration . 86000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:29 10 (map1 (((#:eval-id . 3) (#:duration . 87000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:29 9 (map1 (((#:eval-id . 3) (#:duration . 93000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:29 8 (map1 (((#:eval-id . 3) (#:duration . 173000.0) # # =E2=80= =A6) =E2=80=A6)) > 230:29 7 (map1 (((#:eval-id . 3) (#:duration . 88000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:29 6 (map1 (((#:eval-id . 3) (#:duration . 118000.0) # # =E2=80= =A6) =E2=80=A6)) > 230:29 5 (map1 (((#:eval-id . 3) (#:duration . 94000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:29 4 (map1 (((#:eval-id . 3) (#:duration . 85000.0) # # =E2=80=A6= ) =E2=80=A6)) > 230:17 3 (map1 (((#:eval-id . 3) (#:duration . 75000.0) # # =E2=80=A6= ) =E2=80=A6)) > In cuirass/base.scm: > 145:6 2 (register _) > In ice-9/boot-9.scm: > 268:13 1 (for-each # =E2=80=A6) > In cuirass/database.scm: > 192:2 0 (db-add-build #< pointer: # =E2=80=A6) > cuirass/database.scm:192:2: In procedure db-add-build: > cuirass/database.scm:192:2: Throw to key `sqlite-error' with args `(#f 15= 55 "UNIQUE constraint failed: Builds.derivation, Builds.evaluation, Builds.= output")'. > > Note that this is the same derivation and the same output as before. > Also note that I started with a fresh database before either of these > errors. I did not remove the database after restarting Cuirass, though. This is the tail of the Builds table on that machine: --8<---------------cut here---------------start------------->8--- /gnu/store/jcdfzvb3ca4n5jzh7ajc3yb47akg30c4-hplip-3.17.7.drv|4|#f|/gnu/stor= e/1bil0xyhpim3cfyaifdpb2jsjdni2hif-hplip-3.17.7 /gnu/store/lndp48wl3jcqjysjdrxgh0nm5cghc38v-cups-filters-1.13.1.drv|4|#f|/g= nu/store/lvfymniwbz33an5a2hakf4b1c57lrdwr-cups-filters-1.13.1 /gnu/store/9zzp62b9l2b85dbdqiq17avbqw3h0xkz-cups-2.2.1.drv|4|#f|/gnu/store/= a403mrmm7jd2vxygfjszrsycpa75w6cy-cups-2.2.1 /gnu/store/2isifzc6i42bxpb5rwm3wq2qvpyw158g-cups-minimal-2.2.1.drv|4|#f|/gn= u/store/n7mf8hk262rnlhrjqmacnkp1yn518ks4-cups-minimal-2.2.1 /gnu/store/5aysbn4y15hzjyj6ixw16rl223c8bv12-curl-7.53.0.drv|4|#f|/gnu/store= /53vb094sihb819hk124qvfjq8vz78252-curl-7.53.0-doc /gnu/store/5aysbn4y15hzjyj6ixw16rl223c8bv12-curl-7.53.0.drv|4|#f|/gnu/store= /9ihxpf7al0znb19lx0bk6ymjp6nxhn9y-curl-7.53.0 /gnu/store/zg0zpndricjwwbjv5087zw9hmdcd708y-curl-7.55.0.drv|4|#f|/gnu/store= /60671wa0i1fljll26fx7lxfl27fb27si-curl-7.55.0-doc /gnu/store/zg0zpndricjwwbjv5087zw9hmdcd708y-curl-7.55.0.drv|4|#f|/gnu/store= /nmfwf4fkvb4mfyi7m5sn1daklkjsz9mn-curl-7.55.0 --8<---------------cut here---------------end--------------->8--- So the problem is that we=E2=80=99re trying to insert one of these again, w= hich fails because we already have it under this primary key. This is because the curl-7.55.0 package ends up twice in the list of jobs: once as a replacement for curl-7.53.0, and once because the curl-7.55.0 is itself a public variable. Commit 7d4d6c13f46f2a307883226789d6aa503e2d7081 in guix-maintenance.git works around that. The proper fix in Cuirass might be to ignore the primary key error (for future reference, 1555 in the =E2=80=98sqlite-error=E2=80=99 exception abov= e is (logior 19 (ash 6 8)), which is SQLITE_CONSTRAINT_PRIMARYKEY in ), as in the attached patch. Thoughts? I=E2=80=99ll push it if there are no objections. Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm index 91133c2..9c7e69a 100644 --- a/src/cuirass/database.scm +++ b/src/cuirass/database.scm @@ -181,15 +181,30 @@ string." ((char=? char #\') (loop (cons* char char chars))) (else (loop (cons char chars))))))) +;; Extended error codes (see ). +;; XXX: This should be defined by (sqlite3). +(define SQLITE_CONSTRAINT 19) +(define SQLITE_CONSTRAINT_PRIMARYKEY + (logior SQLITE_CONSTRAINT (ash 6 8))) + (define (db-add-build db build) - "Store BUILD in database DB." - (sqlite-exec db "\ + "Store BUILD in database DB. This is idempotent." + (catch 'sqlite-error + (lambda () + (sqlite-exec db "\ INSERT INTO Builds (derivation, evaluation, log, output)\ VALUES ('~A', '~A', '~A', '~A');" - (assq-ref build #:derivation) - (assq-ref build #:eval-id) - (assq-ref build #:log) - (assq-ref build #:output)) + (assq-ref build #:derivation) + (assq-ref build #:eval-id) + (assq-ref build #:log) + (assq-ref build #:output))) + (lambda (key who code . rest) + ;; If we get a primary-key-constraint-violated error, that means we have + ;; already inserted the same (derivation,eval-id,log) tuple, which we + ;; can safely ignore. + (unless (= code SQLITE_CONSTRAINT_PRIMARYKEY) + (apply throw key who code rest)))) + (last-insert-rowid db)) (define (db-get-stamp db spec) --=-=-=--