Cannot load Plugins under cygwin

Bug #853196 reported by Sir.Rainbow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scribes
New
Undecided
Unassigned

Bug Description

I am working on getting Scribes to work on Windows. I could get Scribes to start under a cygwin enviroment (details later on),
 but it throws a
PLUGIN ERROR!
ERROR: Cannot find plugin folder. Scribes will not function properly without plugins. Please file a bug report to address the issue.

If I close the error window i can type in the document, and the autosave feature is working, but there is no menu.
This is probably a problem in my setup more than in Scribes, but I figured you could explain why this is going on and where
I have to go look for a solution.

I'll explain now how I got Scribes to start under Cygwin.

1. Install cygwin from http://www.cygwin.com/

2. Follow the instructions on http://sourceware.org/cygwinports/ to add thier gnome packages to your mirror lists.
This will make cygwin look up both the official packages and those from Cygports. Be sure to select both mirrors!
 TIP: the main repository of sourceware.org was horribly slow for me, use the sourceforge one the get better results.

3. Install the following packages:
 bzr
 gnome-common
 gnome-doc-utils
 yelp
 pygtk
 gtk
 xinit (xorg server)
 dbus
 gcc-core
 make
 python-dbus
 python-gtk2
 python-gtksourceview2
 python-gtkspell
 python-xdg

4. Lauch the cygwin bash shell and type these commands (don't type ">", it's just to higlight the commands): (might take some time)
>bzr branch lp:scribes
>cd scribes

Open the file autogen.sh and change REQUIRED_AUTOMAKE_VERSION=1.9 to REQUIRED_AUTOMAKE_VERSION=1.11

>./autogen.sh
>make
>make install (NOTE: i didn't use sudo because cygwin doesn't have it, I still have to do some research to see if there is something equivalent)

Rename scribes.in to scribes.py

Start the program X-Server under Cygwin/X
launch scribes from the xterm windows inside the X-Server:
>dbus-launch python scribes.py

And this is it!

I don't know if this belongs here but it's the rationale for using Cygwin:

The other option to making Scribes run on Windows was to get a Windows version of all the dependecies and then change Scribes to be platform agnostic. I did some step in that direction, but Scribes uses fork to create multiple process (I guess for the autosave feature?), which is not available on Windows. Changing Scribes to be platform agnostic with respect to multithreading is out of my possibilities, if even possible, because of how spawing multiple process differs between Linux and Windows. That's why I abandoned this idea and tried out Cygwin instead.

And in the end that's my scribes -i output:
$ ========================================================
System Info: ('CYGWIN_NT-5.1', '1e2fa2f662c847b', '1.7.9(0.237/5/3)', '2011-03-29 10:10', 'i686')
Python Version: 2.6.7 (r267:88850, Jun 5 2011, 18:50:27)
[GCC 4.5.3]
System Byteorder: little
Python Modules: ('__builtin__', '__main__', '_ast', '_codecs', '_sre', '_symtable', '_warnings', 'errno', 'exceptions', 'gc', 'imp', 'marshal', 'posix', 'pwd', 'signal', 'sys', 'thread', 'xxsubtype', 'zipimport')
========================================================
Scribes Version: 0.4-dev-build985
Dbus Version: (0, 84, 0)
GTK+ Version: (2, 24, 5)
PyGTK Version: (2, 24, 0)
Psyco Not Installed
========================================================
Running Instance: 0
========================================================
Python Path: /usr/lib/python2.6/site-packages
Plugin Path: /usr/lib/scribes/GenericPlugins
Data Path: /usr/share/scribes
Executable Path: /usr/bin
========================================================

Tags: cygwin win
Revision history for this message
Sir.Rainbow (sir-rainbow) wrote :
description: updated
Revision history for this message
Mystilleef (mystilleef) wrote :

Sorry for the late response. Under Linux scribes has 4 plugins folders.

System Plugin Folders are:

/usr/lib/scribes/GenericPlugins

/usr/lib/scribes/LanguagePlugins

Home Plugin Folders are:

~/.config/scribes/GenericPlugins

~/.config/scribes/LanguagePlugins

If Scribes cannot find the system plugin folders it gives that error. So the only way for Scribes to work is if it can find and load the plugin folders in Cygwin. Where are plugin folders placed in Cygwin?

Revision history for this message
Sir.Rainbow (sir-rainbow) wrote :

It's almost working now! I updated the description of the bug accordingly to add the copying step

cygwin has a folder on the windows host (usually C:\cygwin) which "is" the root for the linux filesystem, so for example /home under cygwin maps to C:\cygwin\home on the host.

The make/make install process created the folders :
~/.config/scribes/GenericPlugins
~/.config/scribes/LanguagePlugins

but they only contained a empty __init__.py file, i don't have a linux install of scribes on hand so i don't know if that is the normal behaviour?
The System Plugin folders didn't exist, so i created them and copied over the contents of ~/scribes/GenericPlugins and ~/scribes/LanguagePlugins respectively. I did this also for the other 2 folders in ~/.config

Now it seems that Scribes is functional, I still have to look at all the various functions, the only (minor) annoyance now is that the Message about missing plugins still keeps popping up when you open a file.

In the console i get this (possibly some problem with icon loading?)

(Scribes:2692): GLib-GIO-CRITICAL **: g_loadable_icon_load: assertion `G_IS_LOADABLE_ICON (icon)' failed

(Scribes:2692): GLib-GIO-CRITICAL **: g_loadable_icon_load: assertion `G_IS_LOADABLE_ICON (icon)' failed
/home/Marco/scribes/SCRIBES/Main.py:10: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
  main()

(Scribes:2692): GLib-GIO-CRITICAL **: g_loadable_icon_load: assertion `G_IS_LOADABLE_ICON (icon)' failed

(Scribes:2692): GLib-GIO-CRITICAL **: g_loadable_icon_load: assertion `G_IS_LOADABLE_ICON (icon)' failed

(Scribes:2692): GLib-GIO-CRITICAL **: g_loadable_icon_load: assertion `G_IS_LOADABLE_ICON (icon)' failed

(Scribes:2692): GLib-GIO-CRITICAL **: g_loadable_icon_load: assertion `G_IS_LOADABLE_ICON (icon)' failed

(Scribes:2692): GLib-GIO-CRITICAL **: g_loadable_icon_load: assertion `G_IS_LOADABLE_ICON (icon)' failed
/home/Marco/scribes/SCRIBES/RecentManager.py:35: GtkWarning: Attempting to store changes into `/home/Marco/.local/share/recently-used.xbel', but failed: Creazione del file "/home/Marco/.local/share/recently-used.xbel.PQOY2V" non riuscita: No such file or directory
  self.__manager.add_full(uri, self.__create_recent_data(uri))
/home/Marco/scribes/SCRIBES/RecentManager.py:35: GtkWarning: Attempting to set the permissions of `/home/Marco/.local/share/recently-used.xbel', but failed: No such file or directory
  self.__manager.add_full(uri, self.__create_recent_data(uri))

(Scribes:2692): GLib-GIO-CRITICAL **: g_loadable_icon_load: assertion `G_IS_LOADABLE_ICON (icon)' failed
$

Revision history for this message
Sir.Rainbow (sir-rainbow) wrote :

In the above comment
"/home under cygwin maps to C:\cygwin\home on the host."
should be changed to
"/home under cygwin maps to C:\cygwin\home\%username% on the host. (where %username% is your windows user name"

I would have edited it but i cannot find how (not allowed maybe?)

Revision history for this message
Sir.Rainbow (sir-rainbow) wrote :

HOORAY!
Scribes is now working on Windows! Before i copied the Sytem Plugins to cygwin\usr\lib\scribes\, but apparently /usr/lib maps to \cygwin\lib, so i copied them there and restored the folders in the .config dir (now i understand why it was empty).
I still don't know why it didn't copy those over in the make/make install, but we can look at that later maybe....

So this are now the working instructions to use Scribes on windows under Cygwin:

1. Install cygwin from http://www.cygwin.com/

2. Follow the instructions on http://sourceware.org/cygwinports/ to add thier gnome packages to your mirror lists.
This will make cygwin look up both the official packages and those from Cygports. Be sure to select both mirrors!
 TIP: the main repository of sourceware.org was horribly slow for me, use the sourceforge one the get better results.

3. Install the following packages:
 bzr
 gnome-common
 gnome-doc-utils
 yelp
 pygtk
 gtk
 xinit (xorg server)
 dbus
 gcc-core
 make
 python-dbus
 python-gtk2
 python-gtksourceview2
 python-gtkspell
 python-xdg

4. Lauch the cygwin bash shell and type these commands (don't type ">", it's just to higlight the commands): (might take some time)
>bzr branch lp:scribes
>cd scribes

Open the file autogen.sh and change REQUIRED_AUTOMAKE_VERSION=1.9 to REQUIRED_AUTOMAKE_VERSION=1.11

>./autogen.sh
>make
>make install (NOTE: i didn't use sudo because cygwin doesn't have it, I still have to do some research to see if there is something equivalent)

>mv scribes.in scribes.py
>mkdir /lib/scribes
>cp GenericPlugins/ /lib/scribes/GenericPlugins
>cp LanguagePlugins/ /lib/scribes/LanguagePlugins

Start the program X-Server under Cygwin/X
launch scribes from the xterm windows inside the X-Server:
>dbus-launch python scribes.py

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.