FS#34397 - [gvim] has --disable-python3interp
Attached to Project:
Arch Linux
Opened by Ignas Anikevicius (Liuuutas) - Thursday, 21 March 2013, 15:56 GMT
Last edited by Thomas Dziedzic (tomd123) - Tuesday, 27 May 2014, 13:44 GMT
Opened by Ignas Anikevicius (Liuuutas) - Thursday, 21 March 2013, 15:56 GMT
Last edited by Thomas Dziedzic (tomd123) - Tuesday, 27 May 2014, 13:44 GMT
|
Details
Hello, I was wondering if there is any particular reason to
have it disabled?
I found the disabled flag at /var/abs/extra/vim/PKGBUILD. Thanks. |
This task depends upon
Closed by Thomas Dziedzic (tomd123)
Tuesday, 27 May 2014, 13:44 GMT
Reason for closing: Implemented
Additional comments about closing: added a python3 version to extra
Tuesday, 27 May 2014, 13:44 GMT
Reason for closing: Implemented
Additional comments about closing: added a python3 version to extra
But since I'm assuming things have not changed since the last time this was looked at, especially since https://aur.archlinux.org/packages.php?ID=61870 (gvim-python) disables py2 and enables py3 support I think I will close this as wont implement soon.
FS#27527for the details. You could always check it it has changed. If not, you could bring it upstream.:python import glib
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/glib/__init__.py", line 22, in <module>
from glib._glib import *
ImportError: /usr/lib/libpyglib-2.0-python2.so.0: undefined symbol: _Py_ZeroStruct
1) I could just close this bug report like the one from 2011, but then if I do, this "feature" will be opened up again in 2 years.
2) I could open up a bug report with vim, but heftig's reason for why it is failing makes it sound like this really isn't something vim can fix:
"Looks like building both python2 and python3 support into vim causes it to load the interpreter via dlopen() and RTLD_LOCAL, as they contain conflicting symbols. Since the symbols are not globally available, loading extensions not explicitly linked to the right libpython will fail."
3) As a result of the previous number, we could enable both py2 and py3 support, and open up upstream bug reports with each of the libraries that encounter this issue with vim.
4) Enable py3 support but disable py2 support.
--enable-pythoninterp=OPTS Include Python interpreter. default=no OPTS=no/yes/dynamic
--enable-python3interp=OPTS Include Python3 interpreter. default=no OPTS=no/yes/dynamic
from ./configure -h.
We could have:
--enable-pythoninterp=dynamic
--enable-python3interp=dynamic
As far as I understand, python2 and python3 can not be used both at the same time then. Thogh, I did not dig deep enough to see how to switch from one to another interpreter.
true, we could do that, but it would require some research into the current state of vim python plugins migration. Making sure that all or the majority of the most popular plugins have a python3 version available.
@Ignas
seems interesting and if that would not cause any problems while still being able to choose between py2 and py3 versions, then it may remove the need for branched vim packages on the aur like vim-python
I found some interesting documentation in http://vimdoc.sourceforge.net/htmldoc/if_pyth.html#python3
more specifically the last section:
"Here Vim's behavior depends on the system in which it was configured. In a
system where both versions of Python were configured with --enable-shared,
both versions of Python will be activated at the same time. There will still
be problems with other third party libraries that were not linked to
libPython.
To work around such problems there are these options:
1. The problematic library is recompiled to link to the according
libpython.so.
2. Vim is recompiled for only one Python version.
3. You undefine PY_NO_RTLD_GLOBAL in auto/config.h after configuration. This
may crash Vim though."
Edit, Oh ya, also the vim doc states that if both py2 and py3 are enabled, then they are compiled with the dynamic flag already.
So Ignas, your solution is the one that we've been using all along :P, relevant quote "4. Python 2 and 3 support (+python/dyn, +python3/dyn)"
And I have investigated which distros are using --enable-python3interp and none do afaik, including debian and fedora.
I will keep this bug report open in the hopes that either someone else or I will have time to investigate the top (20 to 50) python plugins for vim and see if there is a large majority (80% to 90%) of python3 compatible plugins.
If the majority are, then I might consider enabling strictly python3 in vim in [testing].
Otherwise this feature request might have to wait until more plugins get on board.
Feel free to do the investigation if you wish :) Otherwise I will put this on the wayyy bottom of my todo list.
Also, the numbers above are just example numbers that I pulled out of thin air.
They are just guides not, rules.
I compile Vim myself, with both Python versions enabled and usable at the same time. The only problem I get on Arch is, as Thomas quoted, importing third party libraries that were not linked to libpython will crash. A few packages in the repo doesn't do this, e.g. python2-xapian. There aren't too much (especially when compared to Ubuntu). If all these packages are found and rebuilt, Vim with both +python/dyn and +python3/dyn can be used without problems. Plugins with both Python supports will choose one at its liking, and those only supports Python 2 will continue to work as before.
https://www.archlinux.org/packages/extra/x86_64/gvim-python3/