FS#47500 - [gvim] vim/gvim does not contain python3 support

Attached to Project: Arch Linux
Opened by Yichao Zhou (zhou13) - Wednesday, 23 December 2015, 03:41 GMT
Last edited by Anatol Pomozov (anatolik) - Wednesday, 27 January 2016, 04:28 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Anatol Pomozov (anatolik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

I just switched from Gentoo and I am surprised by the fact that Archlinux contains two gvim, gvim and gvim-python3. One does not support python2 and one does not support python3.

I did some google on this and I found the reason is "vim cann't be compiled with both python2 and python3 support". This is not true: my vim supported both python2 and python3 for a long time in Gentoo.
This task depends upon

Closed by  Anatol Pomozov (anatolik)
Wednesday, 27 January 2016, 04:28 GMT
Reason for closing:  Implemented
Comment by Doug Newgard (Scimmia) - Wednesday, 23 December 2015, 03:49 GMT
How, exactly?

You realize we're talking about python extensions, right?
Comment by Yichao Zhou (zhou13) - Wednesday, 23 December 2015, 03:59 GMT
Yes. We are talking about making :py and :py3 work.

In Gentoo, this works by default. But you can see in https://gitweb.gentoo.org/repo/gentoo.git/tree/app-editors/vim/vim-7.4.769.ebuild?id=37d1fb7b3fc56a9b4249086e29c282eee9c34b24, line 224, what you do is just compiling vim with "--enable-pythoninterp" and "--enable-python3interp" and setting "vi_cv_path_python" and "vi_cv_path_python3" respectively.
Comment by Yichao Zhou (zhou13) - Monday, 28 December 2015, 05:35 GMT
I planed to make a package on AUR but I found that gvim-git in the AUR has already worked well. Just configure like
./configure \
--enable-fail-if-missing \
--with-compiledby='Arch Linux' \
--prefix=/usr \
--enable-gui=gtk2 \
--with-features=huge \
--enable-cscope \
--enable-multibyte \
--enable-perlinterp=dynamic \
--enable-pythoninterp=dynamic \
--enable-python3interp=dynamic \
--enable-rubyinterp=dynamic \
--enable-luainterp=dynamic
Comment by Anatol Pomozov (anatolik) - Monday, 28 December 2015, 06:28 GMT
It sounds like gvim-python3 should be merged into gvim, vim-python3 should be merged into vim.

If we do it, does it mean that both python and python3 become hard dependencies of vim/gvim? Or we can leave it optional?
Comment by Yichao Zhou (zhou13) - Wednesday, 30 December 2015, 01:54 GMT
I think optional is OK but I haven't tested it.
Comment by Anatol Pomozov (anatolik) - Monday, 04 January 2016, 20:45 GMT
It turned out that both python and python2 dependencies are non-optional. One who installs vim pulls 'python' as well. If we add combined python2/3 support to vim it means this package becomes dependent both on python and python2 packages.

According to package stats https://www.archlinux.de/?page=PackageStatistics vim is used by ~60% of users. Python2 installed by 99.47% of users, python python3 by 97.64%. It is safe to assume that all vim users have both python2 and python3 installed so new combined vim package will not pull any additional packages.

Users who does not need any language support will use vim-minimal.

So I think merging vim and vim-python3 packages is a reasonable idea.
Comment by Anatol Pomozov (anatolik) - Tuesday, 05 January 2016, 17:18 GMT
Here is the modified version of PKGBUILD that merges python3 support into vim/gvim package. I run following commands in vim and it seems happy

:python import sys; print(sys.version)
2.7.11 (default, Dec 6 2015, 15:43:46)
[GCC 5.2.0]


:python3 import sys; print(sys.version)
3.5.1 (default, Dec 7 2015, 12:58:09)
[GCC 5.2.0]


Could you please test the python support as well?



What is strange is that if I compile vim with either python on python3 support then /usr/bin/vim gets linked to python{,3}.so. But if I compile it with both python versions support enabled that /usr/bin/vim is *not* linked with python.so. It looks like it finds appropriate Python library dynamically. Do you have more info about such behavior?
   PKGBUILD (7.5 KiB)
Comment by Yichao Zhou (zhou13) - Wednesday, 06 January 2016, 07:35 GMT
The new pkgbuild works for me.

http://vimdoc.sourceforge.net/htmldoc/if_pyth.html#python-dynamic

When Python 2 and Python 3 are both supported they must be loaded dynamically.
Comment by Anatol Pomozov (anatolik) - Wednesday, 06 January 2016, 18:44 GMT
Just pushed updated package to [testing]. Please verify that everything works as expected.
Comment by Christian Rebischke (Shibumi) - Thursday, 07 January 2016, 21:52 GMT
Hello,
I would definitly appreciate a merge of python3-vim and python2-vim in only one vim.
So please do it :)
Comment by Anatol Pomozov (anatolik) - Thursday, 07 January 2016, 21:55 GMT
Do you actively use python with vim? Could you please check vim in [testing] and provide us your feedback.
Comment by Isaiah Peng (isaiah) - Friday, 22 January 2016, 14:54 GMT
Since `gvim-python3` is replaced by `gvim`, `vim-jedi` stopped working with `python-jedi`, please see the attachment. (Reinstall didn't fix it, didn't try the python2-jedi)
Comment by Anatol Pomozov (anatolik) - Friday, 22 January 2016, 15:02 GMT
Isaiah, could you please file a separate [vim] ticket? Could you please also provide detailed repro steps?
I also believe it is an upstream jedi-vim issue but we need a stacktrace to clarify it.

You screenshot does not contain python stacktrace, it is the most interesting part here.
Comment by Anatol Pomozov (anatolik) - Friday, 22 January 2016, 15:04 GMT
It might be related to this ticket https://github.com/davidhalter/jedi-vim/issues/66
Comment by Isaiah Peng (isaiah) - Friday, 22 January 2016, 15:40 GMT
Anatol, that could be the issue, of vim-jedi doesn't support /dyn, can we have gvim-python3 back? :)
Comment by Levente Polyak (anthraxx) - Friday, 22 January 2016, 15:50 GMT
I would vote to leave everything as is. IMHO having it combined was a wonderful decision. jedi upstream should fix the issue, so why not convince them to do so?
Before that, py2 and py3 was exclusive and could not really co-exist... also we benefit from dynamic linking and have more support... -1 for getting gvim-python3 back and +1 for keeping it as now.
Comment by Isaiah Peng (isaiah) - Friday, 22 January 2016, 16:42 GMT
The cause of the problem is vim-jedi, I installed the trunk version from github by pathogen, and it works fine now.
The version of vim-jedi in the repository is quite outdated, it points to upstream version 0.7.0 from 2013, I believe the trunk version is already 0.9.0, but they didn't make github release. Maybe we should move it to AUR.
Comment by Anatol Pomozov (anatolik) - Friday, 22 January 2016, 16:56 GMT
Thanks Isaiah for this information. Could you please ask vim-jedi to make a new release with python3 support and then ping Arch maintainer to update the package?
Comment by Anatol Pomozov (anatolik) - Wednesday, 27 January 2016, 04:28 GMT
Going to close the bug as fixed. If you see python3 related issues in vim please open separate bugs.

Loading...