From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6uEO-0007hk-BE for guix-patches@gnu.org; Mon, 01 Oct 2018 05:11:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6uEJ-0002xY-2n for guix-patches@gnu.org; Mon, 01 Oct 2018 05:11:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:56424) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6uEI-0002wW-Lq for guix-patches@gnu.org; Mon, 01 Oct 2018 05:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g6uEI-0006nW-Cu for guix-patches@gnu.org; Mon, 01 Oct 2018 05:11:02 -0400 Subject: [bug#32879] [PATCH] database: Add builds only if one of their outputs is new. Resent-Message-ID: References: <20180929203532.3826-1-clement@lassieur.org> <87wor2u6dn.fsf@gnu.org> <87k1n2pvjx.fsf@lassieur.org> From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <87k1n2pvjx.fsf@lassieur.org> Date: Mon, 01 Oct 2018 11:09:59 +0200 Message-ID: <87sh1qxcbc.fsf@lassieur.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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 32879@debbugs.gnu.org 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 return= #f if >>> DB-ADD-OUTPUT returned an empty list. >>> * src/schema.sql (Outputs): Set 'path' as primary key, instead of 'deri= vation, >>> name'. >>> * src/sql/upgrade-4.sql: New file with SQL queries to upgrade the datab= ase. >>> * tests/database.scm (make-dummy-build): Use the #:OUTPUTS key. Get de= fault >>> 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 for >> =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.