|
From: Mark E. <ma...@mp...> - 2012-08-13 14:47:19
|
On Mon, 2012-08-13 at 12:16 +0200, Mark Ellis wrote: > On Fri, 2012-08-10 at 20:07 +0200, Chris Frey wrote: > > On Fri, Aug 10, 2012 at 01:40:35PM -0400, Chris Frey wrote: > > > Glad to hear you're having success! I'm still working out small details > > > in the actual sync part. Data flows from file-sync -> python-sample, but > > > not quiet in the other direction yet. > > > > Ok, data flows in both directions now, and the slow_sync flag argument > > in the get_changes callback has been implemented. > > > > - Chris > > > > You're doing a magnificent job on this, many thanks. I've got some old > patches to extend the wrapper, i'll have a look through them and see > what state they're in a some point. > > I've hit a snag early on, i think this may be one for a python list, but > see what you think. > > The first thing the synce plugin does is import some more python > modules. The first being dbus, which in turn imports most of it's > functionality from a C shared object. Quite correctly as I understand > it, this object is not linked to libpython, and results in a python > import error from undefined symbols. I first tried passing -Xlinker > -export-dynamic when linking the python plugin, which didn't help, > annoying since this seems to be the accepted way of fixing this. > LD_PRELOAD with libpython fixes it, confirming everything else is ok, > but the python plugin is linked to libpython, so it should already be > loaded. > > And to add insult to injury, this never happened in the 0.22 plugin. > Found the problem. In opensync/module/opensync_module.c, the call to g_module_open() uses the BIND_LOCAL flag, restricting the symbols from the global namespace, which is not used in opensync 0.22. Removing the flag resolves my symbol problem. However, was this flag added for a good reason ? It was added in svn revision 4396, and the reasoning makes sense, but I don't know whether that was actually a real problem at the time. If the flag is necessary, that makes python embedding somewhat difficult. Mark |