unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37123: gnome-shell: LD_LIBRARY_PATH setting propagates to entire session
@ 2019-08-20 19:21 Mark H Weaver
  2019-08-20 19:38 ` Ricardo Wurmus
  2021-12-02  9:54 ` Ricardo Wurmus
  0 siblings, 2 replies; 4+ messages in thread
From: Mark H Weaver @ 2019-08-20 19:21 UTC (permalink / raw)
  To: 37123

Since commit 2b0c755d195c79bfc95cdbe802e1e2dea1adb7a2 in August 2018,
our 'gnome-shell' executable has been wrapped by a script that sets
LD_LIBRARY_PATH.

One consequence of this, which I just noticed, is that if 'gnome-shell'
is based on 'core-updates' (or in my case, 'core-updates-next'), many
programs based on 'master' will fail to run within the resulting GNOME
session.

I ran into this issue because I recently rebuilt my Guix system based on
'core-updates-next' and booted into it, although it will take more time
to finish rebuilding my user profile.  Many programs, including Emacs
and Nautilus, fail to launch.  A workaround is to launch a terminal,
unset LD_LIBRARY_PATH within the resulting shell, and then manually run
the other programs from within that shell.  (Since then, I've built a
trimmed-down version of my profile based on 'core-updates-next'.)

I was unable to easily find an existing bug report tracking this issue,
so I created this one.

       Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#37123: gnome-shell: LD_LIBRARY_PATH setting propagates to entire session
  2019-08-20 19:21 bug#37123: gnome-shell: LD_LIBRARY_PATH setting propagates to entire session Mark H Weaver
@ 2019-08-20 19:38 ` Ricardo Wurmus
  2019-11-13 22:02   ` Ludovic Courtès
  2021-12-02  9:54 ` Ricardo Wurmus
  1 sibling, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2019-08-20 19:38 UTC (permalink / raw)
  To: mhw; +Cc: 37123


Hi Mark,

> Since commit 2b0c755d195c79bfc95cdbe802e1e2dea1adb7a2 in August 2018,
> our 'gnome-shell' executable has been wrapped by a script that sets
> LD_LIBRARY_PATH.
>
> One consequence of this, which I just noticed, is that if 'gnome-shell'
> is based on 'core-updates' (or in my case, 'core-updates-next'), many
> programs based on 'master' will fail to run within the resulting GNOME
> session.
[…]
> I was unable to easily find an existing bug report tracking this issue,
> so I created this one.

There was no bug report about this, so thanks for reporting it.  I once
brought this issue up on the mailing list here:

    https://lists.gnu.org/archive/html/guix-devel/2019-05/msg00372.html

--
Ricardo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#37123: gnome-shell: LD_LIBRARY_PATH setting propagates to entire session
  2019-08-20 19:38 ` Ricardo Wurmus
@ 2019-11-13 22:02   ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2019-11-13 22:02 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 37123

Hello,

Ricardo Wurmus <rekado@elephly.net> skribis:

>> Since commit 2b0c755d195c79bfc95cdbe802e1e2dea1adb7a2 in August 2018,
>> our 'gnome-shell' executable has been wrapped by a script that sets
>> LD_LIBRARY_PATH.
>>
>> One consequence of this, which I just noticed, is that if 'gnome-shell'
>> is based on 'core-updates' (or in my case, 'core-updates-next'), many
>> programs based on 'master' will fail to run within the resulting GNOME
>> session.
> […]
>> I was unable to easily find an existing bug report tracking this issue,
>> so I created this one.
>
> There was no bug report about this, so thanks for reporting it.  I once
> brought this issue up on the mailing list here:
>
>     https://lists.gnu.org/archive/html/guix-devel/2019-05/msg00372.html

Looking at this bit in the ‘gnome-shell’ definition:

--8<---------------cut here---------------start------------->8---
     (wrap-program (string-append out "/bin/gnome-shell")
       `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
       ;; FIXME: gnome-shell loads these libraries with unqualified
       ;; names only, so they need to be on LD_LIBRARY_PATH.  The
       ;; alternative might be to patch gnome-shell.
       `("LD_LIBRARY_PATH" ":" prefix
         ,(map (lambda (pkg)
                 (string-append (assoc-ref inputs pkg) "/lib"))
               '("gdk-pixbuf"
                 "gnome-bluetooth" "librsvg" "libgweather"))))
--8<---------------cut here---------------end--------------->8---

I checked in Gjs etc. how those imports (e.g., “imports.gi.Rsvg” in
Javascript) are turned into a dlopen.  AIUI, this is done by
gobject-introspection based on info found in .gir files.

In Guix, .gir files contain absolute file names of share libraries.  At
run-time, ‘gobject-introspection-absolute-shlib-path.patch’ ensures that
dlopen is passed absolute file names.

So, IIUC, “imports.gi.Rsvg” should lead to dlopen by absolute file name,
in which case setting LD_LIBRARY_PATH is useless.

However, does anyone know about we can test whether removing the
LD_LIBRARY_PATH wrapping above breaks something?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#37123: gnome-shell: LD_LIBRARY_PATH setting propagates to entire session
  2019-08-20 19:21 bug#37123: gnome-shell: LD_LIBRARY_PATH setting propagates to entire session Mark H Weaver
  2019-08-20 19:38 ` Ricardo Wurmus
@ 2021-12-02  9:54 ` Ricardo Wurmus
  1 sibling, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2021-12-02  9:54 UTC (permalink / raw)
  To: 37123-done

Commit f1fd313e486491caf1ff5874810f2ee06091e825 removes LD_LIBRARY_PATH
from the wrapper.  That’s on core-updates-frozen.

I reconfigured my system with this change and gnome-shell starts up
fine, and things like Gnome Weather work correctly.  So I’m pretty
confident that we no longer need to do this.

Yay!

-- 
Ricardo




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-02  9:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20 19:21 bug#37123: gnome-shell: LD_LIBRARY_PATH setting propagates to entire session Mark H Weaver
2019-08-20 19:38 ` Ricardo Wurmus
2019-11-13 22:02   ` Ludovic Courtès
2021-12-02  9:54 ` Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).