Hi Mark, Mark H Weaver skribis: > Julien Lepiller writes: > >> Hi, I've been looking at our current code and would like to propose the >> attached patch for that issue. >> >> From cfd2c229087166ab4cc0a9e2bdb72c8b393bcdd5 Mon Sep 17 00:00:00 2001 >> From: Julien Lepiller >> Date: Thu, 1 Aug 2019 22:09:38 +0200 >> Subject: [PATCH] guix: Recursively honor search paths of dependencies. >> >> * guix/packages.scm (all-transitive-inputs) >> (package-all-transitive-inputs) >> (package-all-transitive-native-search-paths): New procedures. >> * guix/profiles.scm (package->manifest-entry): Use >> package-all-transitive-native-search-paths to generate manifest search >> paths. > > As I recall this kind of solution has been proposed in the past and > rejected. It's a reasonable suggestion, but I personally think that it > goes too far, because it would include a great many packages whose code > is nowhere to be found in the resulting profile. I agree. We need to take into account run-time dependencies (references), not build-time dependencies, and that’s what makes things more difficult. The attached procedure computes the search paths of a package based on its run-time dependencies. ‘profile-derivation’ could use this to compute its ‘etc/profile’ file and its ‘manifest’ file. Here’s what it gives for ‘w3m’: --8<---------------cut here---------------start------------->8--- (("BASH_LOADABLES_PATH" ("lib/bash") ":" directory #f) ("GUIX_LOCPATH" ("lib/locale") ":" directory #f) ("SSL_CERT_DIR" ("etc/ssl/certs") #f directory #f) ("SSL_CERT_FILE" ("etc/ssl/certs/ca-certificates.crt") #f regular #f) ("TERMINFO_DIRS" ("share/terminfo") ":" directory #f) ("XDG_DATA_DIRS" ("share") ":" directory #f) ("GIO_EXTRA_MODULES" ("lib/gio/modules") ":" directory #f) ("PERL5LIB" ("lib/perl5/site_perl") ":" directory #f)) --8<---------------cut here---------------end--------------->8--- We get GUIX_LOCPATH and SSL_CERT_DIR, which is exactly what we want. However, the other search paths that we get look less desirable: intuitively, it seems that we may not need them, and in the case of XDG_DATA_DIRS, setting it may be detrimental. For ‘icecat’ this gives additional things like PYTHONPATH, GUILE_LOAD_PATH, XML_CATALOG_FILES, and so on. In practice that’s probably OK though: if you only have ‘icecat’ and other GUIs in your profile, Guix won’t suggest setting GUILE_LOAD_PATH or PYTHONPATH. So I think we can come up with a solution based on the patch below, but we’ll have to test it on Guix System and on foreign distros to see if the extra search paths that it brings are warranted. Thoughts? Ludo’.