From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: Re: [PATCH 5/6] guix: Move package-transitive-propagated-labels* and package-propagated-input-refs to (guix packages). Date: Tue, 8 Sep 2015 03:31:58 -0500 Message-ID: <20150908033158.16a45fec@openmailbox.org> References: <1436488689-4078-1-git-send-email-ericbavier@openmailbox.org> <1436488689-4078-5-git-send-email-ericbavier@openmailbox.org> <20150721211143.6edeaae7@openmailbox.org> <87io9cba7o.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_//dCp/uPKCh7e/efMWM8yOPZ" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZItT-0006WX-LM for guix-devel@gnu.org; Tue, 08 Sep 2015 09:25:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZItP-0006Ef-LU for guix-devel@gnu.org; Tue, 08 Sep 2015 09:25:03 -0400 In-Reply-To: <87io9cba7o.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Cc: guix-devel@gnu.org, Eric Bavier --MP_//dCp/uPKCh7e/efMWM8yOPZ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I find myself needing this functionality while exploring configuration support in xmonad, so I am (finally) revisiting this patch. The attached patch, rather than simply moving the two relevant procedures from (gnu packages version-control), instead replaces them with a single new procedure, named 'transitive-input-references', in (guix packages). I think the new procedure addresses the concerns raised previously. On Wed, 22 Jul 2015 15:20:11 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Eric Bavier skribis: >=20 > > From 6282f668d3cadb9f24f045a0c6992eda9fbe6d5d Mon Sep 17 00:00:00 2001 > > From: Eric Bavier > > Date: Tue, 21 Jul 2015 20:45:54 -0500 > > Subject: [PATCH 5/6] guix: Move package-transitive-propagated-labels* a= nd > > package-propagated-input-refs to (guix packages). > > > > * gnu/packages/version-control.scm (package-transitive-propagated-label= s*) > > (package-propagated-input-refs): Move from here... > > * guix/packages.scm: ...to here. >=20 [...] >=20 > > +(define (package-propagated-input-refs inputs packages) >=20 > Should be =E2=80=9Creferences=E2=80=9D, not =E2=80=9Crefs.=E2=80=9D Sure. >=20 > > + "Return a list of (assoc-ref INPUTS ) for each package= in > > +PACKAGES and their transitive propagated inputs." >=20 > Maybe mention that this assumes that each input uses the package name as > the label. This is not the case with the new transitive-input-references. Labels may be arbitrary strings. This behavior is checked in the new test case. >=20 > > + (map (lambda (l) > > + `(assoc-ref ,inputs ,l)) > > + (delete-duplicates ;XXX: efficiency > > + (append-map package-transitive-propagated-labels* > > + packages)))) >=20 > The quadratic =E2=80=98delete-duplicates=E2=80=99 is going to be a proble= m sooner or > later. The new procedure makes use of 'transitive-inputs' and so benefits from its optimizations. =20 > Also, could you add one or two tests? Done. >=20 > I understand this is needed in some cases, but it is not really nice (or > =E2=80=9Creally not nice=E2=80=9D?). I would go with "really not nice" > I would rather avoid propagating the use of these > constructs, No pun intended? ;) > but OTOH, I have nothing better to propose currently. For Perl, my idea is to wrap each module somehow, so that perl gets the appropriate 'use lib "/gnu/store/..."' when it loads each module. Preferably the solution would also work with store deduplication. I've not yet confirmed this is even feasible, so anyone with more perl knowledge should chime in. Our haskell modules install files into a "package.conf.d" subdirectory, and these files actually keep references to all haskell modules that were configured in the environment when it was built. I'm baffled why GHC does not make use of this information for dependency resolution when it loads libraries. Perhaps we could hack our GHC to do so. `~Eric --MP_//dCp/uPKCh7e/efMWM8yOPZ Content-Type: text/plain Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0005-guix-packages-Add-transitive-input-references.patch RnJvbSBjNzkzMjQ3NW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KG1hcCAobGFtYmRhIChsKQ0KLSAgICAgICAgIGAoYXNz b2MtcmVmICxpbnB1dHMgLGwpKQ0KLSAgICAgICAoZGVsZXRlLWR1cGxpY2F0ZXMgICAgICAgICAg ICAgICAgICA7WFhYOiBlZmZpY2llbmN5DQotICAgICAgICAoYXBwZW5kLW1hcCBwYWNrYWdlLXRy YW5zaXRpdmUtcHJvcGFnYXRlZC1sYWJlbHMqDQotICAgICAgICAgICAgICAgICAgICBwYWNrYWdl cykpKSkNCi0NCiAoZGVmaW5lLXB1YmxpYyBnaXQNCiAgIDs7IEtlZXAgaW4gc3luYyB3aXRoICdn aXQtbWFucGFnZXMnIQ0KICAgKHBhY2thZ2UNCkBAIC0yMzgsMTEgKzIyMCwxMyBAQCBQQUNLQUdF UyBhbmQgdGhlaXIgcHJvcGFnYXRlZCBpbnB1dHMuIg0KICAgICAgICAgICAgICAgICBgKCJQRVJM NUxJQiIgIjoiIHByZWZpeA0KICAgICAgICAgICAgICAgICAgICwobWFwIChsYW1iZGEgKG8pIChz dHJpbmctYXBwZW5kIG8gIi9saWIvcGVybDUvc2l0ZV9wZXJsIikpDQogICAgICAgICAgICAgICAg ICAgICAgICAgKGxpc3QNCi0gICAgICAgICAgICAgICAgICAgICAgICAgLEAocGFja2FnZS1wcm9w YWdhdGVkLWlucHV0LXJlZnMNCisgICAgICAgICAgICAgICAgICAgICAgICAgLEAodHJhbnNpdGl2 ZS1pbnB1dC1yZWZlcmVuY2VzDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICdpbnB1dHMN Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxpc3QgcGVybC1hdXRoZW4tc2FzbA0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJsLW5ldC1zbXRwLXNzbA0KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJsLWlvLXNvY2tldC1zc2wpKSkpKSkNCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1hcCAobGFtYmRhIChsKQ0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKGFzc29jIGwgKGlucHV0cykpKQ0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcoInBlcmwtYXV0aGVuLXNhc2wiDQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAicGVybC1uZXQtc210cC1zc2wiDQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAicGVybC1pby1zb2NrZXQtc3NsIikpKSkpKSkNCiANCiAg ICAgICAgICAgICAgIDs7IFRlbGwgJ2dpdC1zdWJtb2R1bGUnIHdoZXJlIFBlcmwgaXMuDQogICAg ICAgICAgICAgICAod3JhcC1wcm9ncmFtIGdpdC1zbQ0KZGlmZiAtLWdpdCBhL2d1aXgvcGFja2Fn ZXMuc2NtIGIvZ3VpeC9wYWNrYWdlcy5zY20NCmluZGV4IDM5ODNkMTQuLjA1MzgwM2YgMTAwNjQ0 DQotLS0gYS9ndWl4L3BhY2thZ2VzLnNjbQ0KKysrIGIvZ3VpeC9wYWNrYWdlcy5zY20NCkBAIC05 Myw2ICs5Myw4IEBADQogICAgICAgICAgICAgcGFja2FnZS1vdXRwdXQNCiAgICAgICAgICAgICBw YWNrYWdlLWdyYWZ0cw0KIA0KKyAgICAgICAgICAgIHRyYW5zaXRpdmUtaW5wdXQtcmVmZXJlbmNl cw0KKw0KICAgICAgICAgICAgICVzdXBwb3J0ZWQtc3lzdGVtcw0KICAgICAgICAgICAgICVoeWRy YS1zdXBwb3J0ZWQtc3lzdGVtcw0KICAgICAgICAgICAgIHN1cHBvcnRlZC1wYWNrYWdlPw0KQEAg LTU3OSw2ICs1ODEsMTggQEAgZm9yIHRoZSBob3N0IHN5c3RlbSAoXCJuYXRpdmUgaW5wdXRzXCIp LCBhbmQgbm90IHRhcmdldCBpbnB1dHMuIg0KIHJlY3Vyc2l2ZWx5LiINCiAgICh0cmFuc2l0aXZl LWlucHV0cyAocGFja2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DQorICAobGV0KiAoKGEgKGR1bW15LXBhY2thZ2UgImEiKSkNCisg ICAgICAgICAoYiAoZHVtbXktcGFja2FnZSAiYiIpKQ0KKyAgICAgICAgIChjIChkdW1teS1wYWNr YWdlICJjIg0KKyAgICAgICAgICAgICAgKGlucHV0cyBgKCgiYSIgLGEpKSkNCisgICAgICAgICAg ICAgIChwcm9wYWdhdGVkLWlucHV0cyBgKCgiYm9vIiAsYikpKSkpDQorICAgICAgICAgKGQgKGR1 bW15LXBhY2thZ2UgImQiDQorICAgICAgICAgICAgICAoaW5wdXRzIGAoKCJjKiIgLGMpKSkpKQ0K KyAgICAgICAgIChrZXlzIChtYXAgKG1hdGNoLWxhbWJkYQ0KKyAgICAgICAgICAgICAgICAgICAg ICAoKCdhc3NvYy1yZWYgJ2wga2V5KQ0KKyAgICAgICAgICAgICAgICAgICAgICAga2V5KSkNCisg ICAgICAgICAgICAgICAgICAgIChwayAncmVmcyAodHJhbnNpdGl2ZS1pbnB1dC1yZWZlcmVuY2Vz DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdsIChwYWNrYWdlLWlucHV0cyBkKSkp KSkpDQorICAgIChhbmQgKD0gKGxlbmd0aCBrZXlzKSAyKQ0KKyAgICAgICAgIChtZW1iZXIgImMq IiBrZXlzKQ0KKyAgICAgICAgIChtZW1iZXIgImJvbyIga2V5cykpKSkNCisNCiAodGVzdC1lcXVh bCAicGFja2FnZS10cmFuc2l0aXZlLXN1cHBvcnRlZC1zeXN0ZW1zLCBpbXBsaWNpdCBpbnB1dHMi DQogICAlc3VwcG9ydGVkLXN5c3RlbXMNCiANCi0tIA0KMi40LjMNCg0K --MP_//dCp/uPKCh7e/efMWM8yOPZ--