From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Subject: bug#32190: [PATCH] database: Merge Derivations into Builds table. Date: Tue, 14 Aug 2018 18:57:31 +0200 Message-ID: <87tvnw6g3o.fsf@lassieur.org> References: <87k1ptirr0.fsf@lassieur.org> <20180804160303.20451-1-clement@lassieur.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpdE8-0005w3-Uf for bug-guix@gnu.org; Tue, 14 Aug 2018 13:35:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpdDi-0003b9-Qm for bug-guix@gnu.org; Tue, 14 Aug 2018 13:35:28 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46021) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fpdDi-0003Kx-MT for bug-guix@gnu.org; Tue, 14 Aug 2018 13:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fpces-0001qV-Fj for bug-guix@gnu.org; Tue, 14 Aug 2018 12:59:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <20180804160303.20451-1-clement@lassieur.org> 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: 32190@debbugs.gnu.org I forgot: Cl=C3=A9ment Lassieur writes: > Fixes . > > * Makefile.am (dist_sql_DATA): Add 'src/sql/upgrade-2.sql'. > * src/cuirass/base.scm (evaluate): Don't add jobs to the Derivations tabl= e. (build-packages): Add columns that were in the Derivations table before. O= nly build the derivations that were successfully registered, that is, those that didn't exist in the Builds table. Give a derivation instead of a build id = to DB-GET-BUILD. Compute the number of failed jobs based on the derivations t= hat were added to the table, instead of the jobs. > * src/cuirass/database.scm (db-add-derivation, db-get-derivation): Remove > exported procedures. > (db-add-build): Catch SQLITE_CONSTRAINT_PRIMARYKEY error, which means tha= t two > jobs produced the same derivation, and return #f in that case. Add colum= ns [...] And (in base.scm) @@ -584,7 +587,7 @@ procedure is meant to be called at startup." (((_ (#:path . (? string? outputs))) ...) outputs)) outputs)) - (fail (- (length jobs) success))) + (fail (- (length derivations) success))) (log-message "outputs:\n~a" (string-join outs "\n")) (log-message "success: ~a, fail: ~a" success fail) results))