From: Maxime Devos <maximedevos@telenet.be>
To: 22138@debbugs.gnu.org
Subject: bug#22138: Should search paths of dependencies be honored automatically?
Date: Fri, 14 Jan 2022 19:48:53 +0000 [thread overview]
Message-ID: <e00f34344ec42db021f06004b2117d8b8a0d8f55.camel@telenet.be> (raw)
In-Reply-To: <87bn9yk5mf.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 4203 bytes --]
(first section)
> As of 0.9.0+, only the search paths of packages explicitly in the
> profile are shown by ‘--search-paths’ and similar. This is a problem
> for libraries that have associated environment variables.
>
> For instance, if one installs an application linked against OpenSSL,
> they will not know about ‘SSL_CERT_DIR’ and ‘SSL_CERT_FILE’. Similarly
> for GStreamer and ‘GST_PLUGIN_PATH’, libc and ‘GUIX_LOCPATH’, and so on.
> [...]
> [... stuff about references-graph ...]
I want to note that it is possible to use a library in a program without
needing the environment variables. E.g., web servers can use openssl,
but often only for listening so they don't need a certificate bundle.
A game using GStreamer for sounds knows in advance which plugins it will
need, so the package definition would be using 'wrap-program' or the like
to hardcode the set of plugins.
Many (almost all?) packages keep a reference to the "lib" output of "gcc",
but almost no packages need '{,CROSS_}C_INCLUDE_PATH', '{,CROSS_}CPLUS_INCLUDE_PATH' or
'{,CROSS_}LIBRARY_PATH'.
That said, adding these superfluos environment variables is probably
harmless in practice, but it kind of breaks some abstractions:
If I use a package as input that uses a search path and I fix the search path
using 'wrap-program' or the like, then I would expect things to be as if there
wasn't a search path in the first place, but IIUC the proposed patch looking
at references would break things.
Also, the patch seems to only affect profiles and not build environments,
creating another distance between them, which seems suboptimal.
For these reasons, I don't think search paths of dependencies should be honoured.
However, there are things to improve:
(second section)
I believe a better option would be to document search paths better in the manual
(there's almost nothing currently about search paths) and make search paths easier
to use.
E.g., we could move ‘generic’ search paths used by several packages (e.g.
INFOPATH, TERMINFO_DIRS, XDG_DATA_DIRS, GST_PLUGIN_PATH, SSL_CERT_DIR
and SSL_CERT_FILE --- why is SSL_CERT_DIR missing from icecat and guile
anyway?) (counter-example: MINETEST_MOD_PATH, because it is used by only
one package) into a common module next to each other, which some small comments
[...]
;; FWIW I think I suggested something like this elsewhere, in the context
;; of module import loops.
;; for info readers (info-reader, emacs, ...)
(define-public %info-path ...)
;; for programs interacting with terminal emulators,
;; e.g. almost anything using 'ncurses'
(define-public %terminfo-dirs-path ...)
;; for packages using TLS, e.g. web browsers (icecat, ungoogled-chromium, ...),
;; e-mail clients (evolution, icedove ...), most software 'openssl'
;;
;; Not all packages using TLS respect one of these two variables.
;;
;; (TODO check if these examples actually respect SSL_CERT_DIR/PATH)
(define-public %x509-cert-dir-path ...)
(define-public %x509-cert-file-path ...)
[...]
and mention this module in the documentation of 'search-paths',
invite people to look at the source code of the module for examples
people maybe even documenting these search paths in the manual.
Maybe also insert a reminder about search paths in the 'reviewing' section?
I think this (keeping standard search paths together, with some explanation,
with some example packages using these search paths ...) would help discoverability
a lot, reducing the risk that a package is defined without appropriate search paths.
Such a common module would also reduce redunancy (a single definition of %foo-path
instead of sprinkling it among separate packages) and reduce the chance of module import
loops (maybe we can move the python search path there?), although the latter could
be solved with thunking (at some cost).
It's also possible to do both this (manual documentation, common search path module)
and the patch using the reference graph.
This ignores GUIX_LOCPATH, but that's used by almost anything, so it could be
special-cased I think?
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
next prev parent reply other threads:[~2022-01-14 19:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 9:36 bug#22138: Search paths of dependencies are not honored Ludovic Courtès
2019-08-01 20:12 ` Julien Lepiller
2019-08-05 16:23 ` Mark H Weaver
2019-08-05 16:31 ` Julien Lepiller
2019-08-23 14:42 ` Ludovic Courtès
2019-08-24 13:52 ` Ludovic Courtès
2019-11-26 12:00 ` Julien Lepiller
2022-01-14 19:48 ` Maxime Devos [this message]
2022-01-22 21:27 ` Maxime Devos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e00f34344ec42db021f06004b2117d8b8a0d8f55.camel@telenet.be \
--to=maximedevos@telenet.be \
--cc=22138@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.