From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoL2j-00054h-MH for guix-patches@gnu.org; Tue, 20 Feb 2018 22:26:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eoL2g-0000mY-DI for guix-patches@gnu.org; Tue, 20 Feb 2018 22:26:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:45590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eoL2g-0000m9-8r for guix-patches@gnu.org; Tue, 20 Feb 2018 22:26:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eoL2f-0006xl-Sb for guix-patches@gnu.org; Tue, 20 Feb 2018 22:26:01 -0500 Subject: [bug#30480] [PATCH] environment: Add --manifest option. Resent-Message-ID: MIME-Version: 1.0 In-Reply-To: <87r2pgekv2.fsf@gnu.org> References: <87r2pgekv2.fsf@gnu.org> From: "Thompson, David" Date: Tue, 20 Feb 2018 22:25:00 -0500 Message-ID: Content-Type: multipart/mixed; boundary="001a1139d600f1f0f90565b07879" 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: 30480@debbugs.gnu.org --001a1139d600f1f0f90565b07879 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Ludo, On Mon, Feb 19, 2018 at 4:21 PM, Ludovic Court=C3=A8s wrote: > Hi David! > > "Thompson, David" skribis: > >> In my lurkings I've seen people wondering why `guix environment` >> doesn't work with manifests. The answer is simply: I never thought to >> add it. This patch fixes that. The implementation is kind of >> interesting and might seem a little silly to people that know how >> manifests work. In order to support manifests with minimal code and >> make --manifest compose with other options I simply decompile the >> manifest back into a list of package/output tuples. That means in the >> case of `guix environment --manifest=3Dfoo.scm` the manifest is created, >> decompiled, and a new manifest created from that. Seems redundant! >> The advantage is that since --manifest composes with all the other >> ways to specify packages we can do absolutely bonkers things like >> `guix environment guile --ad-hoc ruby --manifest=3Dfoo.scm >> --manifest=3Dbar.scm --load=3Dfrob.scm --expression=3D'(@ (gnu packages >> python) python)'`. More realistically you'd use it to throw in an >> extra package or two with --ad-hoc. > > Indeed, that makes a lot of sense. I wondered about doing that for > =E2=80=98guix pack=E2=80=99 as well, it turns out to be more shenanigans = than we=E2=80=99d like. > >> From 47e0cf3bef26791c72222175899790a46c49af45 Mon Sep 17 00:00:00 2001 >> From: David Thompson >> Date: Thu, 15 Feb 2018 20:54:28 -0500 >> Subject: [PATCH] environment: Add --manifest option. >> >> * guix/scripts/environment.scm (show-help, %options): Add -m/--manifest. >> (options/resolve-packages): Handle manifests. >> * doc/guix.texi (Invoking guix environment): Document it. > > Could you add an example in tests/guix-environment.sh that uses a > manifest with the =E2=80=9Cguile-bootstrap=E2=80=9D package for instance? > > OK with this change! :-) Is this what you had in mind? - Dave --001a1139d600f1f0f90565b07879 Content-Type: text/x-patch; charset="UTF-8"; name="0001-environment-Add-manifest-option.patch" Content-Disposition: attachment; filename="0001-environment-Add-manifest-option.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jdwim1us0 RnJvbSBlNmQwYTgyZTUyNTBkNTFlNTBjZDA1MjQxMjYxYTQ2MGE3MWRiZDM3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEYXZpZCBUaG9tcHNvbiA8ZHRob21wc29uMkB3b3JjZXN0ZXIu ZWR1PgpEYXRlOiBUaHUsIDE1IEZlYiAyMDE4IDIwOjU0OjI4IC0wNTAwClN1YmplY3Q6IFtQQVRD SF0gZW52aXJvbm1lbnQ6IEFkZCAtLW1hbmlmZXN0IG9wdGlvbi4KCiogZ3VpeC9zY3JpcHRzL2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LTE0MSw2ICsx NDEsOCBAQCBDT01NQU5EIG9yIGFuIGludGVyYWN0aXZlIHNoZWxsIGluIHRoYXQgZW52aXJvbm1l bnQuXG4iKSkKICAgKGRpc3BsYXkgKEdfICIKICAgLWwsIC0tbG9hZD1GSUxFICAgICAgICBjcmVh dGUgZW52aXJvbm1lbnQgZm9yIHRoZSBwYWNrYWdlIHRoYXQgdGhlIGNvZGUgd2l0aGluCiAgICAg ICAgICAgICAgICAgICAgICAgICAgRklMRSBldmFsdWF0ZXMgdG8iKSkKKyAgKGRpc3BsYXkgKEdf ICIKKyAgLW0sIC0tbWFuaWZlc3Q9RklMRSAgICBjcmVhdGUgZW52aXJvbm1lbnQgd2l0aCB0aGUg bWFuaWZlc3QgZnJvbSBGSUxFIikpCiAgIChkaXNwbGF5IChHXyAiCiAgICAgICAtLWFkLWhvYyAg ICAgICAgICAgaW5jbHVkZSBhbGwgc3BlY2lmaWVkIHBhY2thZ2VzIGluIHRoZSBlbnZpcm9ubWVu dCBpbnN0ZWFkCiAgICAgICAgICAgICAgICAgICAgICAgICAgb2Ygb25seSB0aGVpciBpbnB1dHMi KSkKQEAgLTIyMCw2ICsyMjIsMTEgQEAgQ09NTUFORCBvciBhbiBpbnRlcmFjdGl2ZSBzaGVsbCBp biB0aGF0IGVudmlyb25tZW50LlxuIikpCiAgICAgICAgICAgICAgICAgICAgKGFsaXN0LWNvbnMg J2V4cHJlc3Npb24KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGFnLXBhY2thZ2Ut YXJnIHJlc3VsdCBhcmcpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0KSkp CisgICAgICAgICAob3B0aW9uICcoI1xtICJtYW5pZmVzdCIpICN0ICNmCisgICAgICAgICAgICAg ICAgIChsYW1iZGEgKG9wdCBuYW1lIGFyZyByZXN1bHQpCisgICAgICAgICAgICAgICAgICAgKGFs aXN0LWNvbnMgJ21hbmlmZXN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0KSkpCiAgICAgICAgICAob3B0aW9u ICcoImFkLWhvYyIpICNmICNmCiAgICAgICAgICAgICAgICAgIChsYW1iZGEgKG9wdCBuYW1lIGFy ZyByZXN1bHQpCiAgICAgICAgICAgICAgICAgICAgKGFsaXN0LWNvbnMgJ2FkLWhvYz8gI3QgcmVz dWx0KSkpCkBAIC0yODYsNiArMjkzLDE2IEBAIHBhY2thZ2VzLiIKICAgICAgICgoKD8gcGFja2Fn ZS1vci1wYWNrYWdlK291dHB1dD8pIC4uLikgOyBtYW55IHBhY2thZ2VzCiAgICAgICAgKG1hcCAo Y3V0IHBhY2thZ2UtPm91dHB1dCA8PiBtb2RlKSBwYWNrYWdlcykpKSkKIAorICAoZGVmaW5lICht YW5pZmVzdC0+b3V0cHV0cyBtYW5pZmVzdCkKKyAgICAobWFwIChsYW1iZGEgKGVudHJ5KQorICAg ICAgICAgICAoY29ucyAnYWQtaG9jLXBhY2thZ2UgOyBtYW5pZmVzdHMgYXJlIGltcGxpY2l0bHkg YWQtaG9jCisgICAgICAgICAgICAgICAgIChpZiAocGFja2FnZT8gKG1hbmlmZXN0LWVudHJ5LWl0 ZW0gZW50cnkpKQorICAgICAgICAgICAgICAgICAgICAgKGxpc3QgKG1hbmlmZXN0LWVudHJ5LWl0 ZW0gZW50cnkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAobWFuaWZlc3QtZW50cnktb3V0 cHV0IGVudHJ5KSkKKyAgICAgICAgICAgICAgICAgICAgIDs7IERpcmVjdCBzdG9yZSBwYXRocyBo YXZlIG5vIG91dHB1dC4KKyAgICAgICAgICAgICAgICAgICAgIChsaXN0IChtYW5pZmVzdC1lbnRy eS1pdGVtIGVudHJ5KSkpKSkKKyAgICAgICAgIChtYW5pZmVzdC1lbnRyaWVzIG1hbmlmZXN0KSkp CisKICAgKGNvbXBhY3QKICAgIChhcHBlbmQtbWFwICht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