After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 573413 - libmozjs linking broken on Ubuntu
libmozjs linking broken on Ubuntu
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 574499 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-02-27 15:41 UTC by Dan Winship
Modified: 2011-03-26 15:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Work around Ubuntu xulrunner bug in the same way our .jhbuildrc does (1.83 KB, patch)
2009-02-27 16:15 UTC, Dan Winship
none Details | Review
Do the workaround for Ubuntu xulrunner breakage at build time (2.92 KB, patch)
2009-05-05 19:56 UTC, Dan Winship
rejected Details | Review
buildtime fix - set LD_LIBRARY_PATH properly for gir scanner runs (1.35 KB, patch)
2009-07-01 23:21 UTC, Alexander Sack
rejected Details | Review
set LD_LIBRARY_PATH for runtime (1.00 KB, patch)
2009-07-01 23:21 UTC, Alexander Sack
needs-work Details | Review

Description Dan Winship 2009-02-27 15:41:05 UTC
libmozjs linking is broken on Ubuntu, so we have to work around it in jhbuild and in the gnome-shell wrapper script.

Upstream: https://bugs.launchpad.net/ubuntu/+source/xulrunner-1.9/+bug/286906
Comment 1 Dan Winship 2009-02-27 16:15:44 UTC
Created attachment 129668 [details] [review]
Work around Ubuntu xulrunner bug in the same way our .jhbuildrc does
Comment 2 Dan Winship 2009-03-08 00:30:13 UTC
*** Bug 574499 has been marked as a duplicate of this bug. ***
Comment 3 Igor Vatavuk 2009-03-08 14:39:17 UTC
Hi, 
I tried the patch (using git apply command) but the result is the same, with this as the output:

jaybee@laptop:~/gnome-shell/source/gnome-shell/src$ ./gnome-shell --replace
Window manager warning: Log level 16: Could not load library [/home/jaybee/gnome-shell/source/gnome-shell/src/libgnome-shell.la (libmozjs.so: cannot open shared object file: No such file or directory)]
Window manager warning: Log level 8: failed to load plugins

I am using Ubuntu Jaunty and this is the output of locate libmozjs.so
/usr/lib/xulrunner-1.9.0.7/libmozjs.so
/usr/lib/xulrunner-devel-1.9.0.7/sdk/lib/libmozjs.so

Comment 4 Dan Winship 2009-03-10 14:58:30 UTC
oh, you have to do

    jhbuild buildone -n -f -a gnome-shell

after applying it, to regenerate src/gnome-shell from src/gnome-shell.in. Does that help?
Comment 5 Igor Vatavuk 2009-03-10 15:07:08 UTC
Thanks, it works now as expected!
Comment 6 Dan Winship 2009-03-10 15:22:25 UTC
committed
Comment 7 Alexander Sack 2009-05-04 18:19:04 UTC
is src/gnome-shell.in something used at build time? otherwise, this patch seems wrong, because the .pc files you rely on are shipped by the xulrunner-dev package which isnt available except on development systems.

If you want to keep the LD_LIBRARY_PATH approach, consider to use 

/usr/lib/xulrunner-`xulrunner --gre-version`

to find the proper path.
Comment 8 Dan Winship 2009-05-04 18:32:56 UTC
we should be running pkg-config at build time and substituting the result in
Comment 9 Dan Winship 2009-05-05 19:56:35 UTC
Created attachment 134058 [details] [review]
Do the workaround for Ubuntu xulrunner breakage at build time

Can you verify that this patch fixes things?
Comment 10 Alexander Sack 2009-07-01 23:21:00 UTC
Created attachment 137710 [details] [review]
buildtime fix - set LD_LIBRARY_PATH properly for gir scanner runs
Comment 11 Alexander Sack 2009-07-01 23:21:50 UTC
Created attachment 137712 [details] [review]
set LD_LIBRARY_PATH for runtime
Comment 12 Alexander Sack 2009-07-01 23:24:48 UTC
(In reply to comment #9)
> Created an attachment (id=134058) [edit]
> Do the workaround for Ubuntu xulrunner breakage at build time
> 
> Can you verify that this patch fixes things?
> 

Your patch would require a rebuild whenever xulrunner gets updated from lets say 1.9.0.11 to 1.9.0.12. The buildtime and runtime patches attached should do the right thing. If you have problems on other distros let me know.
Comment 13 Sebastien Bacher 2009-07-01 23:37:01 UTC
the changes from alexander fix the build issue on karmic
Comment 14 Götz Waschk 2010-02-23 11:34:47 UTC
the patch from comment #11 fails on Mandriva Cooker:
xulrunner --xre-version

Better to hard-code the xulrunner path at build time.
Comment 15 Götz Waschk 2010-02-23 11:38:21 UTC
Review of attachment 137712 [details] [review]:

It is wrong to hard-code /usr/lib/xulrunner-something, as on x86_64 this would be /usr/lib64/xulrunner-something.
Comment 16 Owen Taylor 2010-03-09 20:30:31 UTC
Review of attachment 134058 [details] [review]:

While this is theoretically right, I think this is going to result in a lot of problems with packages getting out of sync on Firefox security updates. Practically speaking libmozjs has been very compatible across minor version updates.
Comment 17 Owen Taylor 2010-03-09 20:33:20 UTC
Review of attachment 137710 [details] [review]:

This part of the Makefile.am is already ugly enough without injecting this workaround here, this can be worked by setting LD_LIBRARY_PATH in the Debian packaging for the build.
Comment 18 Owen Taylor 2010-03-09 20:48:51 UTC
Review of attachment 137712 [details] [review]:

I think this is basically the right approach. Possible fixes for the problem Götz mentions:

 1) You could effectively do 'xulrunner --find-gre `xulrunner --gre-version`' and then strip off the last component from that

 2) You could borrow the code from jhbuild that choses /usr/lib64 vs. /usr/lib

try:
    uname = os.uname()
    use_lib64 = (uname[0], uname[4]) in [ ('Linux', 'x86_64'),
                                          ('Linux', 'ppc64'),
                                          ('Linux', 's390x') ]
    del uname
except AttributeError:
    # some platforms don't have os.uname (ie. Win32)
    use_lib64 = False

 3) You could just search /usr/lib64/xulrunner-<version>, /usr/lib/xulrunner-<version> and use the first that you fine

I think I like 3) best because it's going to be the least code.
Comment 19 Alexander Sack 2010-04-12 11:09:49 UTC
libmozjs is not something that should be used. upstrema explicity wants to not maintain a stable API/ABI ... even in security updates (they rarely break it, but when asking if we can make this a policy you get "we want to be able to break abii/api).

So really, please move away from mozjs
Comment 20 Giovanni Campagna 2011-03-26 15:25:15 UTC
Since we cannot move away from mozjs (because we use GJS code in libgnome-shell, and because we routinely use JS 1.6 / JS 1.7 features like let and destructuring assignment, so moving to seed would be nontrivial), and given that libmozjs do longer uses a pkg-config hack, instead setting RPATH at build time, I'm marking this RESOLVED FIXED.