From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7Gfz-0005Xl-5a for guix-patches@gnu.org; Tue, 02 Oct 2018 05:09:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7Gfu-00029s-Nh for guix-patches@gnu.org; Tue, 02 Oct 2018 05:09:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:57718) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g7Gfu-00029m-J6 for guix-patches@gnu.org; Tue, 02 Oct 2018 05:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g7Gfu-0001mB-D7 for guix-patches@gnu.org; Tue, 02 Oct 2018 05:09:02 -0400 Subject: [bug#32879] [PATCH] database: Add builds only if one of their outputs is new. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180929203532.3826-1-clement@lassieur.org> <87wor2u6dn.fsf@gnu.org> <87k1n2pvjx.fsf@lassieur.org> <87sh1qxcbc.fsf@lassieur.org> Date: Tue, 02 Oct 2018 11:08:14 +0200 In-Reply-To: <87sh1qxcbc.fsf@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Mon, 01 Oct 2018 11:09:59 +0200") Message-ID: <878t3gu35t.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 32879@debbugs.gnu.org Hello! Cl=C3=A9ment Lassieur skribis: > Cl=C3=A9ment Lassieur writes: > >> Ludovic Court=C3=A8s writes: >> >>> Hello Cl=C3=A9ment, >>> >>> Cl=C3=A9ment Lassieur skribis: >>> >>>> * Makefile.am (dist_sql_DATA): Add 'src/sql/upgrade-4.sql'. >>>> * src/cuirass/database.scm (db-add-output): New procedure. >>>> (db-add-build): Call DB-ADD-OUTPUT, rollback the transaction and retur= n #f if >>>> DB-ADD-OUTPUT returned an empty list. >>>> * src/schema.sql (Outputs): Set 'path' as primary key, instead of 'der= ivation, >>>> name'. >>>> * src/sql/upgrade-4.sql: New file with SQL queries to upgrade the data= base. >>>> * tests/database.scm (make-dummy-build): Use the #:OUTPUTS key. Get d= efault >>>> OUTPUTS to depend on DRV. >>>> ("db-add-build-with-fixed-output"): New test. >>> >>> What=E2=80=99s the rationale? I suppose having a simpler primary key f= or >>> =E2=80=98Outputs=E2=80=99 might help performance? >> >> There is a slight performance and db size gain but the primary reason is >> to have a better idea of Cuirass' load when looking at the pending >> builds. There will be less (no?) 'fake' builds. The idea is that all >> builds should be real builds. > > Also, it would allow to be notified when someone pushes on master a > commit that triggers too many builds. That makes a lot of sense, thank you! IMO you can go ahead and push it. Ludo=E2=80=99.