From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emVXH-0005mp-8Y for guix-patches@gnu.org; Thu, 15 Feb 2018 21:14:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emVXG-0001kG-3d for guix-patches@gnu.org; Thu, 15 Feb 2018 21:14:03 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:37533) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emVXF-0001kB-VB for guix-patches@gnu.org; Thu, 15 Feb 2018 21:14:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1emVXF-0001a3-Pu for guix-patches@gnu.org; Thu, 15 Feb 2018 21:14:01 -0500 Subject: [bug#30480] [PATCH] environment: Add --manifest option. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emVWI-00052u-Ak for guix-patches@gnu.org; Thu, 15 Feb 2018 21:13:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emVWH-0001YN-28 for guix-patches@gnu.org; Thu, 15 Feb 2018 21:13:02 -0500 Received: from mail-ua0-x22f.google.com ([2607:f8b0:400c:c08::22f]:39826) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emVWG-0001YC-Q0 for guix-patches@gnu.org; Thu, 15 Feb 2018 21:13:01 -0500 Received: by mail-ua0-x22f.google.com with SMTP id w3so1037244uaj.6 for ; Thu, 15 Feb 2018 18:13:00 -0800 (PST) MIME-Version: 1.0 From: "Thompson, David" Date: Thu, 15 Feb 2018 21:12:58 -0500 Message-ID: Content-Type: multipart/mixed; boundary="f403045ed84024175605654ae2bd" 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: 30480@debbugs.gnu.org --f403045ed84024175605654ae2bd Content-Type: text/plain; charset="UTF-8" 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=foo.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=foo.scm --manifest=bar.scm --load=frob.scm --expression='(@ (gnu packages python) python)'`. More realistically you'd use it to throw in an extra package or two with --ad-hoc. Anyway, hope y'all like it. - Dave --f403045ed84024175605654ae2bd 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_jdpanhy60 RnJvbSA0N2UwY2YzYmVmMjY3OTFjNzIyMjIxNzU4OTk3OTBhNDZjNDlhZjQ1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEYXZpZCBUaG9tcHNvbiA8ZHRob21wc29uMkB3b3JjZXN0ZXIu ZWR1PgpEYXRlOiBUaHUsIDE1IEZlYiAyMDE4IDIwOjU0OjI4IC0wNTAwClN1YmplY3Q6IFtQQVRD SF0gZW52aXJvbm1lbnQ6IEFkZCAtLW1hbmlmZXN0IG9wdGlvbi4KCiogZ3VpeC9zY3JpcHRzL2Vu dmlyb25tZW50LnNjbSAoc2hvdy1oZWxwLCAlb3B0aW9ucyk6IEFkZCAtbS8tLW1hbmlmZXN0Lgoo b3B0aW9ucy9yZXNvbHZlLXBhY2thZ2VzKTogSGFuZGxlI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HRoZSBwYWNrYWdlIHRoYXQgdGhlIGNvZGUg d2l0aGluCiAgICAgICAgICAgICAgICAgICAgICAgICAgRklMRSBldmFsdWF0ZXMgdG8iKSkKKyAg KGRpc3BsYXkgKEdfICIKKyAgLW0sIC0tbWFuaWZlc3Q9RklMRSAgICBjcmVhdGUgZW52aXJvbm1l bnQgd2l0aCB0aGUgbWFuaWZlc3QgZnJvbSBGSUxFIikpCiAgIChkaXNwbGF5IChHXyAiCiAgICAg ICAtLWFkLWhvYyAgICAgICAgICAgaW5jbHVkZSBhbGwgc3BlY2lmaWVkIHBhY2thZ2VzIGluIHRo ZSBlbnZpcm9ubWVudCBpbnN0ZWFkCiAgICAgICAgICAgICAgICAgICAgICAgICAgb2Ygb25seSB0 aGVpciBpbnB1dHMiKSkKQEAgLTIyMCw2ICsyMjIsMTEgQEAgQ09NTUFORCBvciBhbiBpbnRlcmFj dGl2ZSBzaGVsbCBpbiB0aGF0IGVudmlyb25tZW50LlxuIikpCiAgICAgICAgICAgICAgICAgICAg KGFsaXN0LWNvbnMgJ2V4cHJlc3Npb24KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo dGFnLXBhY2thZ2UtYXJnIHJlc3VsdCBhcmcpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgcmVzdWx0KSkpCisgICAgICAgICAob3B0aW9uICcoI1xtICJtYW5pZmVzdCIpICN0ICNmCisg ICAgICAgICAgICAgICAgIChsYW1iZGEgKG9wdCBuYW1lIGFyZyByZXN1bHQpCisgICAgICAgICAg ICAgICAgICAgKGFsaXN0LWNvbnMgJ21hbmlmZXN0CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYXJnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0KSkpCiAgICAg ICAgICAob3B0aW9uICcoImFkLWhvYyIpICNmICNmCiAgICAgICAgICAgICAgICAgIChsYW1iZGEg KG9wdCBuYW1lIGFyZyByZXN1bHQpCiAgICAgICAgICAgICAgICAgICAgKGFsaXN0LWNvbnMgJ2Fk LWhvYz8gI3QgcmVzdWx0KSkpCkBAIC0yODYsNiArMjkzLDE2IEBAIHBhY2thZ2VzLiIKICAgICAg ICgoKD8gcGFja2FnZS1vci1wYWNrYWdlK291dHB1dD8pIC4uLikgOyBtYW55IHBhY2thZ2VzCiAg ICAgICAgKG1hcCAoY3V0IHBhY2thZ2UtPm91dHB1dCA8PiBtb2RlKSBwYWNrYWdlcykpKSkKIAor ICAoZGVmaW5lIChtYW5pZmVzdC0+b3V0cHV0cyBtYW5pZmVzdCkKKyAgICAobWFwIChsYW1iZGEg KGVudHJ5KQorICAgICAgICAgICAoY29ucyAnYWQtaG9jLXBhY2thZ2UgOyBtYW5pZmVzdHMgYXJl IGltcGxpY2l0bHkgYWQtaG9jCisgICAgICAgICAgICAgICAgIChpZiAocGFja2FnZT8gKG1hbmlm ZXN0LWVudHJ5LWl0ZW0gZW50cnkpKQorICAgICAgICAgICAgICAgICAgICAgKGxpc3QgKG1hbmlm ZXN0LWVudHJ5LWl0ZW0gZW50cnkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAobWFuaWZl c3QtZW50cnktb3V0cHV0IGVudHJ5KSkKKyAgICAgICAgICAgICAgICAgICAgIDs7IERpcmVjdCBz dG9yZSBwYXRocyBoYXZlIG5vIG91dHB1dC4KKyAgICAgICAgICAgICAgICAgICAgIChsaXN0ICht YW5pZmVzdC1lbnRyeS1pdGVtIGVudHJ5KSkpKSkKKyAgICAgICAgIChtYW5pZmVzdC1lbnRyaWVz IG1hbmlmZXN0KSkpCisKICAgKGNvbXBhY3QKICAgIChhcHBlbmQtbWFwIChtYXRjaC1sYW1iZGEK ICAgICAgICAgICAgICAgICAgKCgncGFja2FnZSBtb2RlICg/IHN0cmluZz8gc3BlYykpCkBAIC0y OTksNiArMzE2LDkgQEAgcGFja2FnZXMuIgogICAgICAgICAgICAgICAgICAgOzsgQWRkIGFsbCB0 aGUgb3V0cHV0cyBvZiB0aGUgcGFja2FnZSBkZWZpbmVkIGluIEZJTEUuCiAgICAgICAgICAgICAg ICAgICAobGV0ICgobW9kdWxlIChtYWtlLXVzZXItbW9kdWxlICcoKSkpKQogICAgICAgICAgICAg ICAgICAgICAocGFja2FnZXMtPm91dHB1dHMgKGxvYWQqIGZpbGUgbW9kdWxlKSBtb2RlKSkpCisg ICAgICAgICAgICAgICAgICgoJ21hbmlmZXN0IC4gZmlsZSkKKyAgICAgICAgICAgICAgICAgIChs ZXQgKChtb2R1bGUgKG1ha2UtdXNlci1tb2R1bGUgJygpKSkpCisgICAgICAgICAgICAgICAgICAg IChtYW5pZmVzdC0+b3V0cHV0cyAobG9hZCogZmlsZSBtb2R1bGUpKSkpCiAgICAgICAgICAgICAg ICAgIChfICcoI2YpKSkKICAgICAgICAgICAgICAgIG9wdHMpKSkKIAotLSAKMi4xNi4xCgo= --f403045ed84024175605654ae2bd--