From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTkxk-0006Mv-6S for guix-patches@gnu.org; Fri, 15 Jun 2018 05:24:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTkxe-0002PG-C7 for guix-patches@gnu.org; Fri, 15 Jun 2018 05:24:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:41010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTkxe-0002P8-7B for guix-patches@gnu.org; Fri, 15 Jun 2018 05:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fTkxe-0005kC-10 for guix-patches@gnu.org; Fri, 15 Jun 2018 05:24:02 -0400 Subject: [bug#31813] [PATCH] evaluate: Use a generic key to identify Cuirass arguments. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180613135001.28724-1-clement@lassieur.org> <87po0txfq6.fsf@gnu.org> <87efh9ug1f.fsf@lassieur.org> Date: Fri, 15 Jun 2018 11:23:16 +0200 In-Reply-To: <87efh9ug1f.fsf@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Fri, 15 Jun 2018 01:03:40 +0200") Message-ID: <87tvq4v1x7.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: 31813@debbugs.gnu.org Hey! Cl=C3=A9ment Lassieur skribis: > Ludovic Court=C3=A8s writes: > >>> @@ -98,7 +99,7 @@ building things during evaluation~%") >>> (proc (module-ref %user-module proc-name)) >>> (commit (assq-ref spec #:current-commit)) >>> (name (assq-ref spec #:name)) >>> - (args `((,(string->symbol name) >>> + (args `((guix >>> (revision . ,commit) >>> (file-name . ,source)) >>> ,@(or (assq-ref spec #:arguments) '()))) >> >> If we do that, then everything is called =E2=80=98guix=E2=80=99. > > Why is it a problem? In theory you can have several inputs (checkouts) to a given jobset, and they need to have different names so that you can distinguish among them. > I don't think the current situation is good because: > - a simple mistake from the user gets their build task to silently > vanish, > - it is inconvenient to use guix-modular.scm with several different > specifications, > - that #:name key is useless if users can't choose a custom name, > - allowing custom names would make it way easier to understand > /api/latestbuilds. For an example with custom names, see > https://cuirass.lassieur.org:8081/api/latestbuilds?nr=3D100. I agree with all this. :-) I think the custom name should appear in the arguments passed to the build procedure, though. >> diff --git a/src/schema.sql b/src/schema.sql >> index 65aebbd..bad2f6d 100644 >> --- a/src/schema.sql >> +++ b/src/schema.sql >> @@ -1,7 +1,7 @@ >> BEGIN TRANSACTION; >>=20=20 >> CREATE TABLE Specifications ( >> - repo_name TEXT NOT NULL PRIMARY KEY, >> + repo_name TEXT NOT NULL, >> url TEXT NOT NULL, >> load_path TEXT NOT NULL, >> file TEXT NOT NULL, >> @@ -11,7 +11,8 @@ CREATE TABLE Specifications ( >> branch TEXT, >> tag TEXT, >> revision TEXT, >> - no_compile_p INTEGER >> + no_compile_p INTEGER, >> + PRIMARY KEY (repo_name, branch) >> ); >>=20=20 >> CREATE TABLE Stamps ( >> >> ? >> >> That way we can have one =E2=80=98guix-modular=E2=80=99 job for each bra= nch, for example. > > I don't think it would work because our Specifications table looks like > this: > > sqlite> select * from specifications; > guix-modular-savannah|git://git.savannah.gnu.org/guix.git|.|build-aux/cui= rass/guix-modular.scm|cuirass-jobs|((systems "x86_64-linux"))|master|||1 > guix-modular-clem|git://git.lassieur.org/guix.git|.|build-aux/cuirass/gui= x-modular.scm|cuirass-jobs|((systems "x86_64-linux"))|master|||1 > guix-manifest-savannah|git://git.savannah.gnu.org/guix.git|.|/gnu/store/i= v4p56ja708gdwvj85982srqnx2cz056-cuirass-derivations.scm|drv-list|()|master|= ||1 > guix-manifest-clem|git://git.lassieur.org/guix.git|.|/gnu/store/iv4p56ja7= 08gdwvj85982srqnx2cz056-cuirass-derivations.scm|drv-list|()|master|||1 > > and so we would have two (guix-modular, master) pairs, thus conflicting > with the PRIMARY KEY constraint again. Good point. > Using an auto-incrementing ID column could work, but I don't like it > for the reasons I explained above. You didn=E2=80=99t mention auto-incrementing ID above, did you? It would s= eem like a simple solution to the problem. > :-) Yes it works well, but we use it only for 5 machines. And we only > build the packages in our manifests (and guix-modular), which isn't > much. Heh, pretty cool. :-) Thanks, Ludo=E2=80=99.