GNOME Bugzilla – Bug 578196
Problems with gnome-shell on Solaris
Last modified: 2009-08-31 17:45:35 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.
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.
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.
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.
Does OpenSolaris have pgrep? (See bug 591888)
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?
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?
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.
(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.
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.
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.)
Can you test the attached?
Just tested, and that does fix the Python problem. Thanks.
Thanks for the test. Patch pushed. Resolving this bug.