From: "Ludovic Courtès" <ludo@gnu.org>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: guix-devel@gnu.org
Subject: Re: 07/09: gnu: kinit: Use LIBRARY_PATH to search for dynamically loaded libs.
Date: Tue, 08 Jan 2019 18:16:00 +0100 [thread overview]
Message-ID: <87a7kbvzn3.fsf@gnu.org> (raw)
In-Reply-To: <258e37be-8fbc-efd8-d900-abb7193bf69c@crazy-compilers.com> (Hartmut Goebel's message of "Mon, 7 Jan 2019 14:22:19 +0100")
Hello,
Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
> Am 05.01.19 um 15:24 schrieb Ludovic Courtès:
>
>>> ++ // Try to load the library relative to the active profiles.
>>> ++ QByteArrayList profiles = qgetenv("LIBRARY_PATH").split(':');
>>> ++ for (const QByteArray &profile: profiles) {
>>> ++ if (!profile.isEmpty()) {
>>> ++ l.setFileName(QFile::decodeName(profile) + QStringLiteral("/") + libpath);
>>> ++ if (l.load()) break;
>>> ++ }
>> I find this use of LIBRARY_PATH questionable: it’s the variable normally
>> used by the compiler driver (gcc) at link time, not by the loader
>> (ld.so). IOW, it’s really a compile-time variable, and one that has
>> nothing to do with Qt or KDE.
>>
>> What about using a different variable for this purpose? It could be
>> KDE_PLUGIN_PATH or something like this, and we could add it to
>> ‘native-search-paths’ of kinit.
>
> Thanks for discovering and pointing this out. Looks like I did a mistake
> here. Oh, and when rethinking, I made even more mistakes here. Indeed I
> was thinking about a native-search-path, too, but abandoned this since I
> thought, LIBRARY_PATH would already be there.
>
> The original KDE code searches for the shared lib in
> CMAKE_INSTALL_PREFIX/LIB_INSTALL_DIR/ only.
>
> Nixos loops over NIX_PROFILES, looking into $profile/lib/, which would match
>
> (search-path-specification
> (variable "KDEINIT5_LIBRARY_PATH")
> (files '("lib/")))
>
> which would make all packages including a shared lib to be listed in the
> environment variable.
Well, only the lib/ directories themselves would be listed, which is
probably fine.
(It would of course be nicer if KDE would instead store these plugins in
lib/kdeinit or something.)
> One possible solution would be: Since the name to be loaded will be
> prefixed by "/libkdeinit5_" (see some lines above [1]), we could change
> this into "/libkdeinit5/" which then could become KDEINIT5_LIBRARY_PATH.
> This of course has the draw back of a larger patch and that *all*
> packages providing plugins for kinit need to be patched, too.
I think it’s a good idea, but this is something that upstream should
decide.
As downstreams, the most reasonable option is to honor the
KDEINIT5_LIBRARY_PATH as you defined it above IMO.
Thanks,
Ludo’.
next prev parent reply other threads:[~2019-01-08 17:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190104091143.6774.92096@vcs0.savannah.gnu.org>
[not found] ` <20190104091145.4226F209C7@vcs0.savannah.gnu.org>
2019-01-05 14:24 ` 07/09: gnu: kinit: Use LIBRARY_PATH to search for dynamically loaded libs Ludovic Courtès
2019-01-07 13:22 ` Hartmut Goebel
2019-01-08 17:16 ` Ludovic Courtès [this message]
2019-01-09 16:10 ` Hartmut Goebel
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=87a7kbvzn3.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guix-devel@gnu.org \
--cc=h.goebel@crazy-compilers.com \
/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.