Received: (at 55653) by debbugs.gnu.org; 1 Jun 2022 20:34:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 01 16:34:22 2022 Received: from localhost ([127.0.0.1]:52003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1nwV2s-0007ji-FD for submit <at> debbugs.gnu.org; Wed, 01 Jun 2022 16:34:22 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:51884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maximedevos@HIDDEN>) id 1nwV2q-0007jW-Rl for 55653 <at> debbugs.gnu.org; Wed, 01 Jun 2022 16:34:21 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by xavier.telenet-ops.be with bizsmtp id dwaJ270084UW6Th01waJJv; Wed, 01 Jun 2022 22:34:19 +0200 Message-ID: <01eb4bc70367cfeb2378867abe561542e0f07e01.camel@HIDDEN> Subject: Re: bug#55653: [PATCH] guix: Add syntactic sugar for profile generation. From: Maxime Devos <maximedevos@HIDDEN> To: Liliana Marie Prikler <liliana.prikler@HIDDEN>, Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN> Date: Wed, 01 Jun 2022 22:34:18 +0200 In-Reply-To: <60b305664d635fa72c2162d0e55fe44af3c95461.camel@HIDDEN> References: <10354f31e0be9bcb88b78da2fb8a2a3c3acbde10.camel@HIDDEN> <87sfopyfte.fsf@HIDDEN> <d5426354a02f060f412bbeb45c374d0c563e985c.camel@HIDDEN> <87zgiwtbid.fsf@HIDDEN> <60b305664d635fa72c2162d0e55fe44af3c95461.camel@HIDDEN> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-7sXwMrvC31Eke1BL67XF" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1654115659; bh=2hgx8vt0XhPtUR/tMGs2SSCHfEY6qppqGucJEXQdsbY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=oomcOge9Ke/29ATiBr5ylRJjdh+ctilzrf05crK4TUURcPE/EfjGpmbmi291aQAtg qN6sejx2ttMKbPbZf4FfICSK36YmoAOHRTV0AIC73FOT5LU89nKHvyyzyvNh0tbEoT ntT09XHeHOmnwYjTWQXu+66fKAPmTVKHJ8AW65Bwui85zkyTwxisk08LQ2DHq+DRzW rXbxeFMnHTtUK7zgF7Gz5uuCAXDlsCHr/sHKGuX7P0ziFrDTVxz0Xks1pOg51juxZo LTrKgHUtjsoNmlM2+I7H5MIOcZcT1Z1zt06103rowJI4QN/94poN0o6f+jKeAenpMK QR37JQkcn3ERw== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55653 Cc: Andrew Tropin <andrewtropin@HIDDEN>, 55653 <at> debbugs.gnu.org, zimoun <zimon.toutoune@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --=-7sXwMrvC31Eke1BL67XF Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Liliana Marie Prikler schreef op wo 01-06-2022 om 22:15 [+0200]: > not to mention that changes which > break record ABI (such as added fields) get promoted directly through > syntax but not through a plain procedure. Using a procedure instead of the record construction macro would make the ABI stable (*). ABI-wise, wouldn't a stable ABI (regular procudure) be better than an unstable ABI? There might be some benefits for a macro concerning readability or such, but I don't see any benefits ABI-wise. (*) assuming no inlining. Greetings, Maxime. --=-7sXwMrvC31Eke1BL67XF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYpfNShccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sQYAQDHGJ3tji1kVSu6Lkxl957bsgvZ l28lCNiEIU+gdZkcDQD/StkWaEL1ZSpO1U6tD+DdGR8K+O/oEavIDX/fPLkv6Qc= =N0Rx -----END PGP SIGNATURE----- --=-7sXwMrvC31Eke1BL67XF--
guix-patches@HIDDEN
:bug#55653
; Package guix-patches
.
Full text available.Received: (at 55653) by debbugs.gnu.org; 1 Jun 2022 20:15:15 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 01 16:15:15 2022 Received: from localhost ([127.0.0.1]:51968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1nwUkN-0007CH-Dd for submit <at> debbugs.gnu.org; Wed, 01 Jun 2022 16:15:15 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:46061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <liliana.prikler@HIDDEN>) id 1nwUkM-0007Bw-3X for 55653 <at> debbugs.gnu.org; Wed, 01 Jun 2022 16:15:14 -0400 Received: by mail-ed1-f65.google.com with SMTP id er5so3649569edb.12 for <55653 <at> debbugs.gnu.org>; Wed, 01 Jun 2022 13:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=an4iLilFua7LgsF2maBonrm6s0lc1qOrcUYYRJGhEy0=; b=Ksl/3m1V1WjmELDiWEV16G/VhsJUhs/EHClJa6UaYAlYWTzgQm+Zwak6egr2vjoKlr BHcvSca2FNyKIVTwv2RrVh4DFqQ89gJd3+nHSbFrcJ3KltarpZij66Mf/QbmApzh7nsM o2DnldqQy8Njd30PrdYyoVrua5Co95OauZ+Iu8s7LsSjKesVnhWGr/rOz6Kehms/YK83 xyHDu+WsVuxJh/+KZ7f0cOj7Fc85F8UhpoRiesSAAtgjC25LBcof5KebvmVv2jODUnnY qafVcSwq9iv7tOVsjfEtFdxDXci/ZtYmQsKUB3jWWtwqcMYBvkLrlJRf1kdGe1SqlJlp E6Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=an4iLilFua7LgsF2maBonrm6s0lc1qOrcUYYRJGhEy0=; b=7ml7sMM/rr3NoWPBuXyRMTm4ad8WjJfZ5B4DnPAPoyFMDjc668woCLhxL4XUzJ0CBz wZ5YA2P2reLfRoecuHFSnSDgYu+jHnVyOVToAKAEGFmbvHvDFIDHs1CMdx7uj9/zKGb8 pd+NUFfWJoNYYcoafNCefNTIq04tyyxrt9Bs1/z8cBYOJCMrmUYa4pUapxipqouFRujD 1aeNkA9NtbWk3ZRrco58S7QtpJbtj3adkSvzFjZk1zifgCq+oD28uruSqbRtU0rfCij+ GwKjUsdW45qp44f0dmt0tntd67IT9erggfPAETrQ6/VKAHOrARcbQTK6NTTInBZ5j8pJ KslQ== X-Gm-Message-State: AOAM531lFlXqT43jzdr9KvdKWFumWHljuF0iWHXMYo3B8rNO/W1PsBZh SDJ6rnLUbe+56DOaZUG2W1U= X-Google-Smtp-Source: ABdhPJwU4wUqA6JUeHicekeUWGZ1N8bGFID31ZtjkefMLIkSagf7Okkc3EdCdX8lMsf9sLgoGrECtA== X-Received: by 2002:a05:6402:1cc1:b0:413:2b12:fc49 with SMTP id ds1-20020a0564021cc100b004132b12fc49mr1638980edb.118.1654114508078; Wed, 01 Jun 2022 13:15:08 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id r18-20020aa7cfd2000000b0042dc8dd59c7sm1478316edy.51.2022.06.01.13.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:15:07 -0700 (PDT) Message-ID: <60b305664d635fa72c2162d0e55fe44af3c95461.camel@HIDDEN> Subject: Re: bug#55653: [PATCH] guix: Add syntactic sugar for profile generation. From: Liliana Marie Prikler <liliana.prikler@HIDDEN> To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN> Date: Wed, 01 Jun 2022 22:15:06 +0200 In-Reply-To: <87zgiwtbid.fsf@HIDDEN> References: <10354f31e0be9bcb88b78da2fb8a2a3c3acbde10.camel@HIDDEN> <87sfopyfte.fsf@HIDDEN> <d5426354a02f060f412bbeb45c374d0c563e985c.camel@HIDDEN> <87zgiwtbid.fsf@HIDDEN> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55653 Cc: Andrew Tropin <andrewtropin@HIDDEN>, 55653 <at> debbugs.gnu.org, Maxime Devos <maximedevos@HIDDEN>, zimoun <zimon.toutoune@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi, Am Mittwoch, dem 01.06.2022 um 21:43 +0200 schrieb Ludovic Courtès: > [...] > > > > > > We don’t have syntactic sugar like this elsewhere, and I would > > > prefer to remain consistent here. > > We do have origin sha256, which sets both hash-algo and hash- > > content, so it's not unprecedented in my opinion. > > ‘sha256’ is a backward-compatibility hack for ‘content-hash’, so it’s > a bit different in my view. > > To be clear, what I meant is that record construction always look > like this: > > (constructor > (field1 value1) > (field2 value2)) > > whereas here the proposal (IIUC) is: > > (constructor > (field1 several values that get bundled together magically)) If it reads like that, then that's probably a mistake somewhere. My actual proposal to allow both of the following: (package other-fields ... (manifest some-manifest)) (package other-fields ... (packages (list bash coreutils emacs ...))) > > > However, if that helps, we could have a procedure, like: > > > > > > (define (packages->profile name packages) > > > (profile (name name) …)) > > > > > > Thoughts? > > I do think syntactic constructors feel better here, because the end > > goal would be embedding things in (thunked) configuration fields. > > Having a procedure might be acceptable, but feels more clunky in > > the context of Guix. > > To me, ‘packages->profile’ doesn’t look any more clunky than > ‘packages->manifest’ or similar procedures. > > Do you think a procedure like this would address the verbosity > problem that prompted you to propose this patch? I don't think it does tbh. We currently have two implementations of packages->profile-entry, one for Guix System, one for Guix Home, which at the time of writing are exactly the same. My use case of naming profiles would be served by such a procedure, but using a syntactic constructor has other benefits in that all of the fields of the profile become accessible. That means that users could (once profile management via Guix Home is implemented) for instance run less hooks or additional hooks for certain profiles, allow collisions, use relative symlinks, etc. for basically free, not to mention that changes which break record ABI (such as added fields) get promoted directly through syntax but not through a plain procedure. Cheers
guix-patches@HIDDEN
:bug#55653
; Package guix-patches
.
Full text available.Received: (at 55653) by debbugs.gnu.org; 1 Jun 2022 19:44:05 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 01 15:44:05 2022 Received: from localhost ([127.0.0.1]:51929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1nwUGC-00049K-Nk for submit <at> debbugs.gnu.org; Wed, 01 Jun 2022 15:44:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1nwUGB-00048h-Fj for 55653 <at> debbugs.gnu.org; Wed, 01 Jun 2022 15:44:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42916) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1nwUG5-0007gy-G4; Wed, 01 Jun 2022 15:43:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=IDqRAJE5zksDDwA66Q8qAzagLjWV+iHCVxsgo24rIBU=; b=hyOie6xTzsiW2Ur0vhj5 Y1UAqGiFMzzosiAY8K0JSvM2pkWyPXLfR9vscB7f+XF2RB/BxSWNa7dfK3MYAsILchlWB3kdP8cNX hJ58Drnb3dapLOf3rRt4Fmcpd5HgVhM4IKEL+eqDXl+Yyzx+J4Fh7+fIKptyJ/t4kpYJOaEuQ75er KpDu+EbLkA7G6blRIh7YkU1xONKvYhtfS0ByJv+UBFRVs+wCKhaSGoVk3/DczX75fd+J0iIC1TmPD bh53gk236Ix4p+ZTT6EqEdCpjgHF6NDcTnGg196fgpVQgnapIWSG69ZeywQZ1Qsf+M52bM/wJIbJ7 AoRGxwHr+J2CHA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:56612 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1nwUG5-0002x3-3W; Wed, 01 Jun 2022 15:43:57 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Liliana Marie Prikler <liliana.prikler@HIDDEN> Subject: Re: bug#55653: [PATCH] guix: Add syntactic sugar for profile generation. References: <10354f31e0be9bcb88b78da2fb8a2a3c3acbde10.camel@HIDDEN> <87sfopyfte.fsf@HIDDEN> <d5426354a02f060f412bbeb45c374d0c563e985c.camel@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Tridi 13 Prairial an 230 de la =?utf-8?Q?R=C3=A9volu?= =?utf-8?Q?tion=2C?= jour du Pois X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 01 Jun 2022 21:43:54 +0200 In-Reply-To: <d5426354a02f060f412bbeb45c374d0c563e985c.camel@HIDDEN> (Liliana Marie Prikler's message of "Tue, 31 May 2022 20:07:09 +0200") Message-ID: <87zgiwtbid.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55653 Cc: Andrew Tropin <andrewtropin@HIDDEN>, 55653 <at> debbugs.gnu.org, Maxime Devos <maximedevos@HIDDEN>, zimoun <zimon.toutoune@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi, Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis: > Am Dienstag, dem 31.05.2022 um 15:47 +0200 schrieb Ludovic Court=C3=A8s: >> So the goal is to make things slightly more concise than: >>=20 >> =C2=A0 (profile (content (packages->manifest (list =E2=80=A6)))) >>=20 >> right? > More or less. However, I also feel that "content" is somewhat > confusing if it were to be user-facing so I added a syntactic manifest > noop as well. OK. >> We don=E2=80=99t have syntactic sugar like this elsewhere, and I would p= refer >> to remain consistent here.=C2=A0=C2=A0 > We do have origin sha256, which sets both hash-algo and hash-content, > so it's not unprecedented in my opinion. =E2=80=98sha256=E2=80=99 is a backward-compatibility hack for =E2=80=98cont= ent-hash=E2=80=99, so it=E2=80=99s a bit different in my view. To be clear, what I meant is that record construction always look like this: (constructor (field1 value1) (field2 value2)) whereas here the proposal (IIUC) is: (constructor (field1 several values that get bundled together magically)) >> However, if that helps, we could have a procedure, like: >>=20 >> =C2=A0 (define (packages->profile name packages) >> =C2=A0=C2=A0=C2=A0 (profile (name name) =E2=80=A6)) >>=20 >> Thoughts? > I do think syntactic constructors feel better here, because the end > goal would be embedding things in (thunked) configuration fields.=20 > Having a procedure might be acceptable, but feels more clunky in the > context of Guix. To me, =E2=80=98packages->profile=E2=80=99 doesn=E2=80=99t look any more cl= unky than =E2=80=98packages->manifest=E2=80=99 or similar procedures. Do you think a procedure like this would address the verbosity problem that prompted you to propose this patch? Thanks, Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#55653
; Package guix-patches
.
Full text available.Received: (at 55653) by debbugs.gnu.org; 31 May 2022 18:07:23 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 31 14:07:23 2022 Received: from localhost ([127.0.0.1]:48846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1nw6H5-0001Rq-GF for submit <at> debbugs.gnu.org; Tue, 31 May 2022 14:07:23 -0400 Received: from mail-ej1-f68.google.com ([209.85.218.68]:43799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <liliana.prikler@HIDDEN>) id 1nw6Gz-0001RY-1l for 55653 <at> debbugs.gnu.org; Tue, 31 May 2022 14:07:22 -0400 Received: by mail-ej1-f68.google.com with SMTP id m20so28130256ejj.10 for <55653 <at> debbugs.gnu.org>; Tue, 31 May 2022 11:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=QeFt9gvn4kyhUOXWrw9ppIaqJ5FJJ+ULqtkvmtsU/lw=; b=j3FHVydE8OykxvRTclUEIWdVS+y39wvipAuEa63ENI1eRe2Q9Zn2Qeds9O5vrE7ygH wyaHtWsViljcwZ/hsmrHquhhVYsbcsGFH2GuQ1Bjc2h/CEA4Ec6LwSFCDz+JDbAcG/h4 /c1N7L6poLm2x/+X49LQloqCR0eoIZDwBLVkGOCcCkbd8jzFlrr3AXBxY7bl9RhQ3nmz dpXFzXHZWGWbEJacWi3ubjgZKyoxoqvCrvM1kb2C3bpqhmI81fRWBqpKG8XVb8K4VU6E YXvp/nVoqaOOgmqjE83dSYvbCA8873Wtg/CbDipIspKYt/EhrymPw9M9Aw4C5z5OZH1D qwpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=QeFt9gvn4kyhUOXWrw9ppIaqJ5FJJ+ULqtkvmtsU/lw=; b=CHrLJX5Egs3bhn5pqvTAkd14aeXPVYvOil+QldYji2/JJqvWHbRNRm3KiAyenH1i+P sAHj8CtlF/PUyjjAEac8DZCj9EDHYPNMA0C2LTNFk5+pF+GJ5VKNuvO4XlXFGm8zbDYQ A0+DDcZwTvRou/EK35OmnafmTsVx27mf78aqfDtm9i2sp8Wwz9CcMPjAq+DqrcDZkaUI dsmxN+EivYYfVUolAb+7+icME3fwUojb2uoLUY0ovPUV5dh/K0++L70djqWQwpmgwAnl BJ4RG28h9ounGvTeen6iMgNNlnUDViOuWwx9cAHnBe1SA0bGGRUTWlEZmRHJx60wlucu NBbg== X-Gm-Message-State: AOAM532YTAFvJ8mAiIhV9NXNifLQw38W3QToeSMvJ92qR/ZltkNRFJPp 1OfBKqlZ7Z8PoscjFD0YL6Q= X-Google-Smtp-Source: ABdhPJyirzuHinJjSeOR1xsvi+ipvx6YxfJRZ/56fj5MF88a8LCACByVvgKOfKl5DqghsXBl/e3j3Q== X-Received: by 2002:a17:907:2d07:b0:6ff:7867:82f2 with SMTP id gs7-20020a1709072d0700b006ff786782f2mr10712845ejc.708.1654020431188; Tue, 31 May 2022 11:07:11 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id m8-20020a056402430800b0042de29d8fc0sm1690327edc.94.2022.05.31.11.07.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 11:07:10 -0700 (PDT) Message-ID: <d5426354a02f060f412bbeb45c374d0c563e985c.camel@HIDDEN> Subject: Re: bug#55653: [PATCH] guix: Add syntactic sugar for profile generation. From: Liliana Marie Prikler <liliana.prikler@HIDDEN> To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN> Date: Tue, 31 May 2022 20:07:09 +0200 In-Reply-To: <87sfopyfte.fsf@HIDDEN> References: <10354f31e0be9bcb88b78da2fb8a2a3c3acbde10.camel@HIDDEN> <87sfopyfte.fsf@HIDDEN> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 55653 Cc: Andrew Tropin <andrewtropin@HIDDEN>, 55653 <at> debbugs.gnu.org, Maxime Devos <maximedevos@HIDDEN>, zimoun <zimon.toutoune@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi, Am Dienstag, dem 31.05.2022 um 15:47 +0200 schrieb Ludovic Courtès: > So the goal is to make things slightly more concise than: > > (profile (content (packages->manifest (list …)))) > > right? More or less. However, I also feel that "content" is somewhat confusing if it were to be user-facing so I added a syntactic manifest noop as well. > We don’t have syntactic sugar like this elsewhere, and I would prefer > to remain consistent here. We do have origin sha256, which sets both hash-algo and hash-content, so it's not unprecedented in my opinion. > However, if that helps, we could have a procedure, like: > > (define (packages->profile name packages) > (profile (name name) …)) > > Thoughts? I do think syntactic constructors feel better here, because the end goal would be embedding things in (thunked) configuration fields. Having a procedure might be acceptable, but feels more clunky in the context of Guix. Chees
guix-patches@HIDDEN
:bug#55653
; Package guix-patches
.
Full text available.Received: (at 55653) by debbugs.gnu.org; 31 May 2022 13:47:41 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 31 09:47:41 2022 Received: from localhost ([127.0.0.1]:47140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1nw2Dj-0008WP-0S for submit <at> debbugs.gnu.org; Tue, 31 May 2022 09:47:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1nw2De-0008Vp-TP for 55653 <at> debbugs.gnu.org; Tue, 31 May 2022 09:47:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1nw2DZ-00069A-Eq; Tue, 31 May 2022 09:47:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=CwCptLf2n1OtbFTGf//rVV/yXyUDL4deBp8a5R6Cqgw=; b=A/G/8UyfzIpYuM0etckx vpVwHxykzFf78I/06RBuh4UVx+Hhyhqb3cXbFbfMLogCtBqvNOD/BZKegHzvh7P8rYnvRMe232Wkx hc6dN2ruhnBp+6e75bqeZjTWD63H1fdJ7VnxbX46w2XL1EQPJZu7wsRoRUGhMnkkCyBhUxCVRwVle jgHoyHDl35UEHd/EuWXY2Bz3DFM9YIOOg3YfRJtXxycpRWO+aZR6wyg482tfg7iY7OcU4dIbXMeqz FLyfpSAT9TqGjzYimLIgKs/SltY97mRpTXdo4UluHPsZn38txwgTRKc2ZLMioFFbWqoomlsX19dIA zEEugqrX9QM5XA==; Received: from nat-eduroam-36-gw-01-bso.bordeaux.inria.fr ([194.199.1.36]:41606 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1nw2DZ-0002eK-2j; Tue, 31 May 2022 09:47:29 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Liliana Marie Prikler <liliana.prikler@HIDDEN> Subject: Re: bug#55653: [PATCH] guix: Add syntactic sugar for profile generation. References: <10354f31e0be9bcb88b78da2fb8a2a3c3acbde10.camel@HIDDEN> Date: Tue, 31 May 2022 15:47:25 +0200 In-Reply-To: <10354f31e0be9bcb88b78da2fb8a2a3c3acbde10.camel@HIDDEN> (Liliana Marie Prikler's message of "Thu, 26 May 2022 11:01:02 +0200") Message-ID: <87sfopyfte.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55653 Cc: Andrew Tropin <andrewtropin@HIDDEN>, 55653 <at> debbugs.gnu.org, Maxime Devos <maximedevos@HIDDEN>, zimoun <zimon.toutoune@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hello! Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis: > * guix/profiles.scm (%profile, package-compatibility-helper): New variabl= es. > (profile): Implement in terms of package-compatibility-helper. > --- > Hi Guix, > > this is a first step towards managing multiple profiles via Guix Home. > It makes it so that regular Guix profiles can more easily be specified, t= hough > I'm not quite sure whether the mlet of packages->profile-entry should not= also > be used here. > > In any case, with this it should now be relatively easy for users to spec= ify > profiles such as > (profile (name "emacs") (packages emacs emacs-magit emacs-org ...)) > (profile (name "r") (packages r r-plyr emacs emacs-ess ...)) > (profile (name "python") (packages python python-beautifulsoup4 ...)) > ... So the goal is to make things slightly more concise than: (profile (content (packages->manifest (list =E2=80=A6)))) right? We don=E2=80=99t have syntactic sugar like this elsewhere, and I would pref= er to remain consistent here. However, if that helps, we could have a procedure, like: (define (packages->profile name packages) (profile (name name) =E2=80=A6)) Thoughts? Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#55653
; Package guix-patches
.
Full text available.Received: (at submit) by debbugs.gnu.org; 27 May 2022 12:39:53 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 27 08:39:53 2022 Received: from localhost ([127.0.0.1]:33061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1nuZFx-0001Cf-Bv for submit <at> debbugs.gnu.org; Fri, 27 May 2022 08:39:53 -0400 Received: from lists.gnu.org ([209.51.188.17]:55428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <andrew@HIDDEN>) id 1nuZFv-0001CY-OS for submit <at> debbugs.gnu.org; Fri, 27 May 2022 08:39:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <andrew@HIDDEN>) id 1nuZFv-0006HO-Ec for guix-patches@HIDDEN; Fri, 27 May 2022 08:39:51 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:46125) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <andrew@HIDDEN>) id 1nuZFs-0000gQ-RH; Fri, 27 May 2022 08:39:51 -0400 Received: (Authenticated sender: andrew@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id 6C6D11BF20B; Fri, 27 May 2022 12:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1653655183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hFs3yjdLLx0HROUc31uwOQFenoYVQ1vQMP3gjHFTvOM=; b=FOunFF823tKtdK4SZjEfUlK4f7tiV+B4wcKsFB97IozVLvUBIKFEAVudWdUclIs6YODa8Y 6GnkNwDhkT2xzgtNXf91m9PPhKIMbOE2jMpv/IwQ1G3b2lXbhv4JzGOEKVlJ5aoXzPkKRg LMAYhvHJWhPHg6HSS9prTy/bxLagDMcEus0duN9iCUWkLTrmg5IjSy04wtEEUUxQOxo1Wp UvHx2BMwssgyHL72BpLDS69AqccGJoXMAS99kaa4+olTCmC2b9BGg+g+WUpeH+fnrChPrr EdDxB+KHBWS1L9kuin8QoHeCo8H5yZydbzroouJR0iZTI0Xsk8b1iTX7L+D0zQ== From: andrew@HIDDEN To: Liliana Marie Prikler <liliana.prikler@HIDDEN>, guix-patches@HIDDEN Subject: Re: [PATCH] guix: Add syntactic sugar for profile generation. In-Reply-To: <10354f31e0be9bcb88b78da2fb8a2a3c3acbde10.camel@HIDDEN> References: <10354f31e0be9bcb88b78da2fb8a2a3c3acbde10.camel@HIDDEN> Date: Fri, 27 May 2022 15:39:38 +0300 Message-ID: <87tu9bqhdh.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=217.70.183.201; envelope-from=andrew@HIDDEN; helo=relay8-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Maxime Devos <maximedevos@HIDDEN>, zimoun <zimon.toutoune@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.7 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-05-26 11:01, Liliana Marie Prikler wrote: > * guix/profiles.scm (%profile, package-compatibility-helper): New variabl= es. > (profile): Implement in terms of package-compatibility-helper. > --- > Hi Guix, > > this is a first step towards managing multiple profiles via Guix Home. > It makes it so that regular Guix profiles can more easily be specified, t= hough > I'm not quite sure whether the mlet of packages->profile-entry should not= also > be used here. The sugar looks reasonable to me. > > In any case, with this it should now be relatively easy for users to spec= ify > profiles such as > (profile (name "emacs") (packages emacs emacs-magit emacs-org ...)) > (profile (name "r") (packages r r-plyr emacs emacs-ess ...)) > (profile (name "python") (packages python python-beautifulsoup4 ...)) > ... > What's still missing is a way to link them up with /var/guix/profiles/per= -user Don't think that they have to be linked to /var/guix/profiles/per-user, as mentioned earlier profiles built for the home environment should be a part of home environment, link to the profile will be inside home-environment directory: /var/guix/profiles/per-user/bob/guix-home/profiles/PROFILE_NAME links in /var/guix/profiles/per-user needed for switching between profile versions, it's not possible in case profile is a part of home environment, otherwise home environment will stop being reproducible. > and $HOME =E2=80=93 for the latter, there would be a home-*-service-type. Yep, can be done by home-files-* and symlink-manager I guess. > > WDYT? > > guix/profiles.scm | 23 ++++++++++++++++++++++- > tests/profiles.scm | 16 ++++++++++++++++ > 2 files changed, 38 insertions(+), 1 deletion(-) > > diff --git a/guix/profiles.scm b/guix/profiles.scm > index bf50c00a1e..fbc343c456 100644 > --- a/guix/profiles.scm > +++ b/guix/profiles.scm > @@ -1974,7 +1974,7 @@ (define builder > (manifest-entries manifest)))= ))))) >=20=20 > ;; Declarative profile. > -(define-record-type* <profile> profile make-profile > +(define-record-type* <profile> %profile make-profile > profile? > (name profile-name (default "profile")) ;string > (content profile-content) ;<manifest> > @@ -1987,6 +1987,27 @@ (define-record-type* <profile> profile make-profile > (relative-symlinks? profile-relative-symlinks? ;Boolean > (default #f))) >=20=20 > +(define-syntax package-compatibility-helper > + (syntax-rules (packages manifest) > + ((_ () (fields ...)) > + (%profile fields ...)) > + ((_ ((packages exp) rest ...) (others ...)) > + (package-compatibility-helper > + (rest ...) > + (others ... (content (packages->manifest > + (delete-duplicates exp eq?)))))) > + ((_ ((manifest exp) rest ...) (others ...)) > + (package-compatibility-helper > + (rest ...) > + (others ... (content exp)))) > + ((_ (field rest ...) (others ...)) > + (package-compatibility-helper (rest ...) (others ... field))))) > + > +(define-syntax-rule (profile fields ...) > + "Build a <profile> record, automatically converting 'packages' or 'man= ifest ' > +field specifications to 'content'." > + (package-compatibility-helper (fields ...) ())) > + > (define-gexp-compiler (profile-compiler (profile <profile>) system targe= t) > "Compile PROFILE to a derivation." > (match profile > diff --git a/tests/profiles.scm b/tests/profiles.scm > index d59d75985f..970a34b6cc 100644 > --- a/tests/profiles.scm > +++ b/tests/profiles.scm > @@ -272,6 +272,22 @@ (define transform1 > (manifest-pattern (name name)))) > '("gcc" "binutils" "glibc" "coreutils" "grep" "sed")))) >=20=20 > +(test-assert "profile syntax sugar" > + (let ((p1 (dummy-package "p1")) > + (p2 (dummy-package "p2"))) > + (define (profile=3D? . profiles) > + (define (manifest=3D? . manifests) > + ;; Since we're using the same packages, we could also compare vi= a eq? > + (apply list=3D manifest-entry=3D? (map manifest-entries manifest= s))) > + (apply manifest=3D? (map profile-content profiles))) > + > + (profile=3D? > + (profile (content (manifest > + (map package->manifest-entry (list p1 p2))))) > + (profile (content (packages->manifest (list p1 p2)))) > + (profile (manifest (packages->manifest (list p1 p2)))) > + (profile (packages (list p1 p2)))))) > + > (test-assertm "profile-derivation" > (mlet* %store-monad > ((entry -> (package->manifest-entry %bootstrap-guile)) =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmKQxooACgkQIgjSCVjB 3rC8rw/7BTxMeH87Sx38URbnZHN1rzM3klKOZLHRAc9Kx7YVmnyFvhBYDsRqzYvh JkaxWGEiKcYV2Y3pwcOM6mndXd8nFGpQvbDE6SwZWcEaVOEYaJoNl6XFx8q9CXw0 u6PVYmL2iKZzVahPXdC4qv8woRobSyS5f74yxYVuAFtGxUIG+6OvgC7Ua3rG7aLI pX3iTMapnEgvrHvDp0mR4W2Ty4uydWs9hwkqUW4XR4YJ2p1mOMw8tk/FRHcg/Wqf QfIJ3oUUW7Vdltc709a29BMW2+vYdXvBGU7o0jUvuNEltpu4t5Sa291LN6+cVaeu E36PeeuTPH/tIS0GuO5CCKv26yu72yD1OPlGl1c6b6y/M/oHXdhNLuq+t6/JyGaU S5IUANFEoxO57fpfqdEOjj4NgStAPdOuF+xUtdYlUT8oKOxtqlKXkdxCLn3AqW0w Gw1NOUo6trrucvcrOjR6h+7gpr21RzNC6mmqTEksFwW2mdbrg5pN5Q5tCtNmgw7m mh4Pr+PH8DSD4ngoTbZbSm/gpS5kSsGfXYLijl+feVg0I6LeFlaz7e4BZHlkdh4+ ubRo+c1/o5sFxjEMimQ3Znnz0vYDnjlxjtPgOg/HlazH0Ub/795DVkpGoudybFCT +32LY2FU8mBRw1eLHRhpWrNksxbDCiJJ/RvuccConR+jpxXqt/A= =ijru -----END PGP SIGNATURE----- --=-=-=--
guix-patches@HIDDEN
:bug#55653
; Package guix-patches
.
Full text available.Received: (at submit) by debbugs.gnu.org; 26 May 2022 09:20:00 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 26 05:19:59 2022 Received: from localhost ([127.0.0.1]:57069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1nu9ex-0005rM-J9 for submit <at> debbugs.gnu.org; Thu, 26 May 2022 05:19:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:35406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <liliana.prikler@HIDDEN>) id 1nu9ew-0005rF-2q for submit <at> debbugs.gnu.org; Thu, 26 May 2022 05:19:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <liliana.prikler@HIDDEN>) id 1nu9ev-0001m3-NR for guix-patches@HIDDEN; Thu, 26 May 2022 05:19:57 -0400 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]:40906) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <liliana.prikler@HIDDEN>) id 1nu9et-00014e-Kn; Thu, 26 May 2022 05:19:57 -0400 Received: by mail-ej1-x642.google.com with SMTP id wh22so1881281ejb.7; Thu, 26 May 2022 02:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:subject:to:cc:content-transfer-encoding:message-id :mime-version; bh=GxpEctlAdt0wUFnQfKpzU+e9a9lIOiX1Xv06mV+7FWI=; b=kLkWy8N3jhA6ZWDCzmtjJRG14VkMXotVSjOXXHs5yEkIRqDbvfw72sB/TGG+B2fQsf KaA1t4RmwjVM0+LwdLGACU3/25wr9tdCg0L28QraRXzw7vN1V2JXsvfow8T61RilTidw aCyZfmQ1Ig3etAZxLAJIANLhiN3kJw8CEvcYnPAUVdGSJwVJiGnOguycsaqOwieMpfVn mB5YUSPCcsYTntsIweSss6Sue1bqevUZWruLRd1HC1Sc0R+Y+0dFJ4W9DyROKf9Pe/HG TrsI4zsLv0sNC/bN18H2EM1FeuxWZyySmvA0oky+OGcgv9vT8qKVGcXIJCz30UF8lUut fbqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:to:cc :content-transfer-encoding:message-id:mime-version; bh=GxpEctlAdt0wUFnQfKpzU+e9a9lIOiX1Xv06mV+7FWI=; b=bXEJVTNJc59ememgVi7tAly834eZpC5P5lKwaa21v5DqSBjj/IBjhWqyfb/W2kchrg DkCIUKyDQp5GJqk7AFElHNTRrqt72c3YdrWCdPD3fu5i5lraJxQqW3D5wAVlXzdXjLdF AnKxFdsa7M/vwf7PQuAxL7Wn3qDkGMpdsBadTfn43b9JKD5mbYAr/brYnvIGlKR50s1y QfzpVbuYuZCZxOnKQOnNtPpQykkZ6BCoZToWsQL7/R4QG53N6pYyZ8msFRDG3n2+FV52 6XybBkBYRGHS0ge5doZnpARe4kfb1T5n7y4n1xrGsAj5q0TTmSoPfnYPXKZrIvpmqgbd YXBw== X-Gm-Message-State: AOAM531osU8os0S6byRHbXRfsmLCcnObYhQdl07HbLrnaEAMfLyLNYkn DwRVEDeirjy766PS249qznh3fS4k4Jc= X-Google-Smtp-Source: ABdhPJxHc/0Got+LrL1FC330LQpbff3pMYE+BRSVMYonql6fDZAGnOAih6OCxocxkGJA64XysPSF3A== X-Received: by 2002:a17:907:8a01:b0:6ff:8b8:ca85 with SMTP id sc1-20020a1709078a0100b006ff08b8ca85mr9985812ejc.602.1653556791717; Thu, 26 May 2022 02:19:51 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id e12-20020a170906374c00b006fec41b21e1sm332952ejc.171.2022.05.26.02.19.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 02:19:51 -0700 (PDT) From: Liliana Marie Prikler <liliana.prikler@HIDDEN> Date: Thu, 26 May 2022 11:01:02 +0200 Subject: [PATCH] guix: Add syntactic sugar for profile generation. to: guix-patches@HIDDEN Content-Transfer-Encoding: 8bit Message-ID: <10354f31e0be9bcb88b78da2fb8a2a3c3acbde10.camel@HIDDEN> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::642; envelope-from=liliana.prikler@HIDDEN; helo=mail-ej1-x642.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PP_MIME_FAKE_ASCII_TEXT=0.999, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: submit Cc: Andrew Tropin <andrewtropin@HIDDEN>, Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>, Maxime Devos <maximedevos@HIDDEN>, zimoun <zimon.toutoune@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.5 (-) * guix/profiles.scm (%profile, package-compatibility-helper): New variables. (profile): Implement in terms of package-compatibility-helper. --- Hi Guix, this is a first step towards managing multiple profiles via Guix Home. It makes it so that regular Guix profiles can more easily be specified, though I'm not quite sure whether the mlet of packages->profile-entry should not also be used here. In any case, with this it should now be relatively easy for users to specify profiles such as (profile (name "emacs") (packages emacs emacs-magit emacs-org ...)) (profile (name "r") (packages r r-plyr emacs emacs-ess ...)) (profile (name "python") (packages python python-beautifulsoup4 ...)) ... What's still missing is a way to link them up with /var/guix/profiles/per-user and $HOME – for the latter, there would be a home-*-service-type. WDYT? guix/profiles.scm | 23 ++++++++++++++++++++++- tests/profiles.scm | 16 ++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index bf50c00a1e..fbc343c456 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1974,7 +1974,7 @@ (define builder (manifest-entries manifest)))))))) ;; Declarative profile. -(define-record-type* <profile> profile make-profile +(define-record-type* <profile> %profile make-profile profile? (name profile-name (default "profile")) ;string (content profile-content) ;<manifest> @@ -1987,6 +1987,27 @@ (define-record-type* <profile> profile make-profile (relative-symlinks? profile-relative-symlinks? ;Boolean (default #f))) +(define-syntax package-compatibility-helper + (syntax-rules (packages manifest) + ((_ () (fields ...)) + (%profile fields ...)) + ((_ ((packages exp) rest ...) (others ...)) + (package-compatibility-helper + (rest ...) + (others ... (content (packages->manifest + (delete-duplicates exp eq?)))))) + ((_ ((manifest exp) rest ...) (others ...)) + (package-compatibility-helper + (rest ...) + (others ... (content exp)))) + ((_ (field rest ...) (others ...)) + (package-compatibility-helper (rest ...) (others ... field))))) + +(define-syntax-rule (profile fields ...) + "Build a <profile> record, automatically converting 'packages' or 'manifest ' +field specifications to 'content'." + (package-compatibility-helper (fields ...) ())) + (define-gexp-compiler (profile-compiler (profile <profile>) system target) "Compile PROFILE to a derivation." (match profile diff --git a/tests/profiles.scm b/tests/profiles.scm index d59d75985f..970a34b6cc 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm @@ -272,6 +272,22 @@ (define transform1 (manifest-pattern (name name)))) '("gcc" "binutils" "glibc" "coreutils" "grep" "sed")))) +(test-assert "profile syntax sugar" + (let ((p1 (dummy-package "p1")) + (p2 (dummy-package "p2"))) + (define (profile=? . profiles) + (define (manifest=? . manifests) + ;; Since we're using the same packages, we could also compare via eq? + (apply list= manifest-entry=? (map manifest-entries manifests))) + (apply manifest=? (map profile-content profiles))) + + (profile=? + (profile (content (manifest + (map package->manifest-entry (list p1 p2))))) + (profile (content (packages->manifest (list p1 p2)))) + (profile (manifest (packages->manifest (list p1 p2)))) + (profile (packages (list p1 p2)))))) + (test-assertm "profile-derivation" (mlet* %store-monad ((entry -> (package->manifest-entry %bootstrap-guile)) -- 2.36.1
Liliana Marie Prikler <liliana.prikler@HIDDEN>
:guix-patches@HIDDEN
.
Full text available.guix-patches@HIDDEN
:bug#55653
; Package guix-patches
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.