From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6hUd-0002nb-JB for guix-patches@gnu.org; Sun, 30 Sep 2018 15:35:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6hUc-00043V-On for guix-patches@gnu.org; Sun, 30 Sep 2018 15:35:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:56010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6hUc-00043K-Kw for guix-patches@gnu.org; Sun, 30 Sep 2018 15:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g6hUc-0003Lp-Dk for guix-patches@gnu.org; Sun, 30 Sep 2018 15:35: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> Date: Sun, 30 Sep 2018 21:34:12 +0200 In-Reply-To: <20180929203532.3826-1-clement@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Sat, 29 Sep 2018 22:35:32 +0200") Message-ID: <87wor2u6dn.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, 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 'deriva= tion, > name'. > * src/sql/upgrade-4.sql: New file with SQL queries to upgrade the databas= e. > * tests/database.scm (make-dummy-build): Use the #:OUTPUTS key. Get defa= ult > 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? Thank you, Ludo=E2=80=99.