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 578196 - Problems with gnome-shell on Solaris
Problems with gnome-shell on Solaris
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other opensolaris
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-04-07 05:58 UTC by Brian Cameron
Modified: 2009-08-31 17:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch fixing the problem (1.05 KB, patch)
2009-04-07 05:59 UTC, Brian Cameron
none Details | Review
updated patch (1.15 KB, patch)
2009-08-27 20:09 UTC, Brian Cameron
none Details | Review
Use AM_PATH_PYTHON to find Python >= 2.5 (1.67 KB, patch)
2009-08-31 15:54 UTC, Owen Taylor
committed Details | Review

Description Brian Cameron 2009-04-07 05:58:04 UTC
The gnome-shell script has 3 problems on Solaris.

1) On Solaris /usr/bin/python point to Python 2.4, and /usr/bin/python2.6 is
   used for Python 2.6.  So I have to hack /usr/bin/gnome-shell so it has
   "#!/usr/bin/python2.6" instead of just "#!/usr/bin/python".  It would be
   nicer if configure allowed you to set the specific Python to use here.

2) Solaris doesn't have pidof.  I have a hack that makes it work on Solaris.
   However, it might be better if a better cross-platform solution could be
   used here.

3) On Solaris, we avoid installing the library .la files,  This causes the
   code to fail since it specifically looks for .la files.  I hacked the code
   to make it look for the .so file instead.  This seems to work.
Comment 1 Brian Cameron 2009-04-07 05:59:36 UTC
Created attachment 132239 [details] [review]
patch fixing the problem


This patch fixes the problem.  My solutions for #1 and #2 are just hacks to work
around the problem, and to show you what I needed to change to get gnome-shell
working on Solaris.  However, the fix for issue #3 might be appropriate for 
going upstream.

I'd appreciate any comments about how to better fix this.  I'm happy to rework
the patches if you have any recommendations about how to fix these issues 
better.
Comment 2 Dan Winship 2009-04-07 13:48:30 UTC
gnome-shell is already generated from a .in file, so it would be easy to substitute in the correct python path from a configure variable. I imagine there must be some GNOME module already whose configure script has code to find the right python binary?

For pidof, using ps is probably fine as long as all of those args are POSIX ps args, not SVR4 ps args. Alternatively you could rewrite the code to use killall/pkill, rather than getting the pid first and using os.kill.
Comment 3 Brian Cameron 2009-04-07 20:13:07 UTC
Sorry, I'm a python newbie.  Adding the try/catch block is stretching my abilities.  I'll see if I can work together a better patch, but could use help.
In general, it would be good to fix the upstream code to use interfaces that are more general, if possible.
Comment 4 Owen Taylor 2009-08-27 18:27:35 UTC
Does OpenSolaris have pgrep? (See bug 591888)
Comment 5 Brian Cameron 2009-08-27 20:09:30 UTC
Created attachment 141882 [details] [review]
updated patch


To make gnome-shell work on Solaris, we currently only apply the attached patch.
I rewrote this to use pgrep some time ago, but forgot to submit the patch.  Here
is the updated patch we use which you can consider using if it can also be used
on Linux, that would be a more portable solution I think.

Or perhaps we could make the code use this alternative pgrep logic if pidof isn't available on the system?
Comment 6 Owen Taylor 2009-08-28 17:04:17 UTC
Use of pidof is now completely gone (see bug 593325 bug 591171), so we don't
have to worry about that any more.

I don't understand the change:

-        plugin = os.path.join(top_dir, 'src', 'libgnome-shell.la')
+        plugin = os.path.join(top_dir, 'src', 'libgnome-shell.so')

Do you have a modified version of libtool that doesn't generate .la files at all, even in the uninstalled tree?

Is the Python substitution problem still an issue?
Comment 7 Brian Cameron 2009-08-28 17:37:44 UTC
The Python issue is no longer an issue.

Solaris does not yet deliver .la files.  This is because libtool still has some nasty bugs on Solaris which cause compiles to fail if you install them.  This is the only remaining issue.
Comment 8 Owen Taylor 2009-08-28 17:47:14 UTC
(In reply to comment #7)
> The Python issue is no longer an issue.
> 
> Solaris does not yet deliver .la files.  This is because libtool still has some
> nasty bugs on Solaris which cause compiles to fail if you install them.  This
> is the only remaining issue.

We don't package .la files for Fedora either. But that doesn't answer my question - the path that you modify above is a path in the *uninstalled* tree - used only when you are running uninstalled.

Normally libtool will put the .la file in the compilation directory, and the .so file (however it is named) will be hidden in a .libs directory.

So, the only way your patch would be required, or work at all, is if you have a modified libtool or libtool-compatible script that doesn't use .la files at all.

That doesn't strike me as too likely - a lot of GNOME makefiles just wouldn't work at all since there are direct references to .la files.
Comment 9 Brian Cameron 2009-08-31 15:38:41 UTC
An update.  I just rebuilt gnome-shell without the patch to change the ".la".  Seems like this now works fine, and no problems.

However, we still have the Python issue.  On Solaris /usr/bin/python is Python 2.4.  However when you try to use Python 2.4, gnome-shell crashes since it uses some syntax that requires a newer version of Python.  So we are still hacking gnome-shell to change the "/usr/bin/python" string to "/usr/bin/python2.6".

It would be nice if this were configurable, so you could specify which version of python to use when configuring gnome-shell, so we didn't have to patch this.

So, currently we are only applying a patch to gnome-shell to address this python issue.  Sorry about my last confusing comment where I said we didn't need this part of the patch anymore.
Comment 10 Owen Taylor 2009-08-31 15:54:27 UTC
Created attachment 142139 [details] [review]
Use AM_PATH_PYTHON to find Python >= 2.5

On OpenSolaris /usr/bin/python is 2.4; use AM_PATH_PYTHON to find
a newer Python. (The PYTHON environment variable can also be set
before running configure to override the search.)
Comment 11 Owen Taylor 2009-08-31 15:54:58 UTC
Can you test the attached?
Comment 12 Brian Cameron 2009-08-31 17:01:53 UTC
Just tested, and that does fix the Python problem.  Thanks.
Comment 13 Owen Taylor 2009-08-31 17:45:35 UTC
Thanks for the test. Patch pushed. Resolving this bug.