your first idea was in the right direction !

if I change e_module_new to:
dlopen(modpath, (RTLD_NOW | RTLD_GLOBAL));
edgar works again as expected \o/

I think this make sense because the edgar module.so is linked to python.so,
but the python-efl bindings modules are not. Thus importing python modules
require that the caller (the python interpreter or any app embedding
python)
must be linked to python.so. At the end RTLD_LOCAL make the linked
python.so not "reachable" from the python-efl modules.

Are there some reasons to not use RTLD_GLOBAL in e_module_new?



Il giorno ven 17 apr 2020 alle ore 23:56 Carsten Haitzler <
ras...@rasterman.com> ha scritto:

> On Fri, 17 Apr 2020 23:20:25 +0200 Davide Andreoli <d...@gurumeditation.it
> >
> said:
>
> > I found a way to get a bit more info, the python error while importing
> and
> > failing is:
> > ImportError: /usr/lib/python3.8/site-packages/efl/
> > eo.cpython-38-x86_64-linux-gnu.so: undefined symbol:
> PyUnicode_FromFormat
>
> oooooh. ... so it is a symbol problem. :) That i believe is provided by
> libpython3.8.so ... edgar is linked to this... my guess is then python is
> dlopening the pytno-efl binding .so files and expecting the symbols to link
> up... but they don't.
>
> an idea. dlopen libpython3.8.so and use RTDL_GLOBAL to put python symbols
> in
> the global namespace instead of linking to libpython at compile time - do
> it
> runtime? then edgar can also choose at runtime either python 2 or python3
> libs
> - dlsym the symbols you need from these... ? just trying the dlopen and
> stuffing it into global namespace may help...
>
> > eo.cpython-38-x86_64-linux-gnu.so is the python-efl module that bind
> the eo
> > library,
> > PyUnicode_FromFormat is a normal CPython function that should work...
> > the edgar module does not get correctly linked to python?
> >
> > Il giorno ven 17 apr 2020 alle ore 21:54 Carsten Haitzler <
> > ras...@rasterman.com> ha scritto:
> >
> > > On Fri, 17 Apr 2020 19:33:30 +0200 Davide Andreoli <
> d...@gurumeditation.it
> > > >
> > > said:
> > >
> > > hmm no. removing RTLD_LOCAL makes no difference. so there goes that
> idea. i
> > > have python-efl bindings installed - i can run ecoonman-bin as a test.
> > > there is
> > > no output i see from python complaining... knowing what exactly fails
> will
> > > be
> > > key to finding out why. like cant find a symbol? missing
> link/dependency on
> > > load? something else? as there is nothing telling me what... it needs
> much
> > > deeper digging
> > >
> > > > Hi guys,
> > > > I'm lost in trying to fix the Edgar module to run again in E. Since
> some
> > > > months the python import machinery does not work anymore and the
> edgar
> > > > module is not able anymore to import the python efl bindings.
> > > >
> > > > Nothing has changed in Edgar nor in python-efl and I'm able to
> correctly
> > > > use the machinery in a simple test app (attached), it just does not
> work
> > > > when used inside an E module. I suspect something related to the new
> > > meson
> > > > build, but not sure at all.
> > > >
> > > > The simple test attached can be built as:
> > > > gcc -o test_py test_py.c `python-config --cflags --libs --embed`
> > > > `pkg-config --libs --cflags efl-ui`
> > > > when run it print OK, that means the python-efl module has been
> found and
> > > > linked. While the same code in edgar fails on the import_efl__eo()
> call.
> > > > Note the test also need the attached .h file to build
> > > >
> > > > To build/run this simple code of course python-efl must be installed
> > > > https://phab.enlightenment.org/w/projects/python_bindings_for_efl/
> > > >
> > > > The edgar module instead is documented here:
> > > > https://phab.enlightenment.org/w/emodules/edgar/
> > > >
> > > > Any help/ideas would be appreciated as I really don't have any idea
> atm
> > > >
> > > > The same issue has been recently raised also on the e-user mailing
> list
> > > >
> > > > Thanks
> > > > DaveMDS
> > >
> > >
> > > --
> > > ------------- Codito, ergo sum - "I code, therefore I am"
> --------------
> > > Carsten Haitzler - ras...@rasterman.com
> > >
> > >
>
>
> --
> ------------- Codito, ergo sum - "I code, therefore I am" --------------
> Carsten Haitzler - ras...@rasterman.com
>
>

_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to