Summary: | app-editors/vim USE=python - For some reason the option 'python' is off. | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Dmitry <dmitry.trunikov> |
Component: | Current packages | Assignee: | Vim Maintainers <vim> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ahferroin7, dag, da_risk, fedeliallalinea, grknight, silencly07 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Dmitry
2018-10-22 11:55:23 UTC
Configure error checking --enable-pythoninterp argument... yes checking for python2... /var/tmp/portage/app-editors/vim-8.0.1298/temp/python3.6/bin/python2 checking Python version... : python_wrapper_setup: python2 is not supported by python3.6 (PYTHON_COMPAT) checking Python is 2.3 or better... : python_wrapper_setup: python2 is not supported by python3.6 (PYTHON_COMPAT) too old checking --enable-python3interp argument... yes checking for python3... /var/tmp/portage/app-editors/vim-8.0.1298/temp/python3.6/bin/python3 checking Python version... 3.6 checking Python is 3.0 or better... yep checking Python's abiflags... m checking Python's install prefix... /usr checking Python's execution prefix... /usr checking Python's configuration directory... /usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu checking Python3's dll name... libpython3.6m.so.1.0 checking if -pthread should be used... yes checking if compile and link flags for Python 3 are sane... yes checking if -fPIE can be added for Python3... yes Removing ebuild line 69 use python && python-single-r1_pkg_setup seems resolve the problem, but not sure if is correct I had the same problem, and found this bug. It appears the --with-python-command argument to the --enable-pythoninterp (and --enable-python3interp) is required during the src_configure stage. As far as I understand it, without this command, configure just tests the version of the default python interpreter, which in most systems will be a python3 interpreter, thus it gets rejected for building python2. It should be trivial to make src_configure do something like: if use python; then myconf +=( --enable-pythoninterp --with-python-command=/usr/bin/python2 ) myconf +=( --enable-python3interp --with-python-command=/usr/bin/python3 ) fi Which should fix the problem. Unfortunately, looks like this was raised 2 and a half months ago - I'd have expected more action from the maintainers on such an important package in that time. Typo in my last: > myconf +=( --enable-python3interp --with-python-command=/usr/bin/python3 ) Should be: > myconf +=( --enable-python3interp --with-python3-command=/usr/bin/python3 ) Thank for you the report and thank you for the tip. I'm trying to put together a fix and I'm testing it now. If it works, I will commit it ASAP. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fafd44f0df153e1b1fc7513b26e89f1c5218ae04 commit fafd44f0df153e1b1fc7513b26e89f1c5218ae04 Author: Patrice Clement <monsieurp@gentoo.org> AuthorDate: 2019-01-18 19:04:59 +0000 Commit: Patrice Clement <monsieurp@gentoo.org> CommitDate: 2019-01-19 12:10:03 +0000 app-editors/vim: enable python and python3 interpreters at compile time. Closes: https://bugs.gentoo.org/669306 Package-Manager: Portage-2.3.56, Repoman-2.3.12 Signed-off-by: Patrice Clement <monsieurp@gentoo.org> app-editors/vim/vim-8.1.0648-r1.ebuild | 321 +++++++++++++++++++++++++++++++++ 1 file changed, 321 insertions(+) This change was not made in app-editors/vim-9999. Maybe app-editors/gvim should have the same change? Very similar problem exists with gvim, same configure log messages, but manifests differently at runtime. In gvim: :py3 anything Fatal Python error: PyThreadState_Get: no current thread Vim: Caught deadly signal ABRT Vim: Finished. Many posts around the internet about this being caused by multiple pythons. I've just applied the vim change in fafd44f0df153e1b1fc7513b26e89f1c5218ae04 to the gvim ebuild and it resolves that problem also. Could this fix please be applied there also. Thanks. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=402558f75d5bc0b68ebbbcbb4ba6787ddd56cd24 commit 402558f75d5bc0b68ebbbcbb4ba6787ddd56cd24 Author: Patrice Clement <monsieurp@gentoo.org> AuthorDate: 2019-03-25 21:48:03 +0000 Commit: Patrice Clement <monsieurp@gentoo.org> CommitDate: 2019-03-25 21:48:35 +0000 app-editors/gvim: apply #669306 fix to gvim ebuilds. Bug: https://bugs.gentoo.org/669306 Signed-off-by: Patrice Clement <monsieurp@gentoo.org> Package-Manager: Portage-2.3.51, Repoman-2.3.11 app-editors/gvim/gvim-8.1.0648-r1.ebuild | 373 +++++++++++++++++++++++++++++++ app-editors/gvim/gvim-9999.ebuild | 4 +- 2 files changed, 376 insertions(+), 1 deletion(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1570c9f62d0046a9bdecc42cf1ef37c6c2214c27 commit 1570c9f62d0046a9bdecc42cf1ef37c6c2214c27 Author: Patrice Clement <monsieurp@gentoo.org> AuthorDate: 2019-03-25 21:44:10 +0000 Commit: Patrice Clement <monsieurp@gentoo.org> CommitDate: 2019-03-25 21:44:10 +0000 app-editors/vim: apply #669306 fix to vim-9999.ebuild. Bug: https://bugs.gentoo.org/669306 Signed-off-by: Patrice Clement <monsieurp@gentoo.org> Package-Manager: Portage-2.3.51, Repoman-2.3.11 app-editors/vim/vim-9999.ebuild | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) I was about to open an other bug, but since this one is not closed, I will reactivate it. I am using vim 8.2.0114 (~amd64) I run: ==================== vim --noplugin :py3 pass ==================== at which point vim will exit with ==================== Vim: Caught deadly signal ABRT Vim: Finished. Aborted ==================== If I ==================== vim --noplugin 2> error.log :py3 pass ==================== error.log will contain a single line: ==================== Fatal Python error: PyThreadState_Get: no current thread ==================== ==================== vim --version ... -python +python3 ..... ==================== ==================== equery u vim ... + + python + + python_single_target_python3_6 - - python_single_target_python3_7 - - python_single_target_python3_8 y + + python_targets_python3_6 - - python_targets_python3_7 - - python_targets_python3_8 ... ==================== For what it is worth: vim 8.1 used to state +python/dyn for a build with dynamic python support. I can't build 8.2 on gentoo to get that '/dyn' suffix for python. Also, vim --version now states (when built with the python USE-flag): Linking: x86_64-pc-linux-gnu-gcc -Wl,-O1 -L/usr/local/lib -Wl,--as-needed -o vim -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lnsl -lacl -lattr -ldl -L/usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lm Notice that -L/usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu ? This directory only contains a static python lib. And I have no idea whatsoever where the build picks up that directory. pkg-config python-3.6m does not seem to produce that dir for any query. 'ldd /usr/bin/vim' does not list libpython for me. Does our build link python statically? :help python-dynamic in vim 8.2 states: 9. Dynamic loading python-dynamic On MS-Windows and Unix the Python library can be loaded dynamically. The :version output then includes +python/dyn or +python3/dyn. [....] So it appears python is statically linked. And this causes problems for certain vim plugins. https://vimawesome.com/plugin/youcompleteme "Fatal Python error: PyThreadState_Get: no current thread on startup This is caused by linking a static version of libpython into ycmd's ycm_core.so. This leads to multiple copies of the python interpreter loaded when python loads ycmd_core.so and this messes up python's global state. " I get the same issue with the 'black' plugin. powerline-vim and syntastic also show the same issues. C(In reply to Austin S. Hemmelgarn from comment #12) > powerline-vim and syntastic also show the same issues. Correction, syntastic is fine, but powerline-vim is definitely affected by this. Temporarily moving aside the static python lib in /usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a to another dir and reemerging vim-core/vim renders a vim binary which links to libpython3.6m.so.1.0. vim --version still does not have the '/dyn' suffix behind +python3, but the 'black' vim plugin now works. (In reply to Dag Bakke from comment #11) > > :help python-dynamic in vim 8.2 states: > > > 9. Dynamic loading python-dynamic > > On MS-Windows and Unix the Python library can be loaded dynamically. The > :version output then includes +python/dyn or +python3/dyn. > [....] > > > > So it appears python is statically linked. And this causes problems for > certain vim plugins. > > https://vimawesome.com/plugin/youcompleteme > "Fatal Python error: PyThreadState_Get: no current thread on startup > > This is caused by linking a static version of libpython into ycmd's > ycm_core.so. This leads to multiple copies of the python interpreter loaded > when python loads ycmd_core.so and this messes up python's global state. " > > > I get the same issue with the 'black' plugin. If this will truly help, then the ebuild should be changed to have the following: $(use_enable python python3interp dynamic) and older versions have (for python 2): $(use_enable python pythoninterp dynamic) A user in #gentoo IRC tested this and it seemed to work. (In reply to Brian Evans from comment #15) > (In reply to Dag Bakke from comment #11) > > > > :help python-dynamic in vim 8.2 states: > > > > > > 9. Dynamic loading python-dynamic > > > > On MS-Windows and Unix the Python library can be loaded dynamically. The > > :version output then includes +python/dyn or +python3/dyn. > > [....] > > > > > > > > So it appears python is statically linked. And this causes problems for > > certain vim plugins. > > > > https://vimawesome.com/plugin/youcompleteme > > "Fatal Python error: PyThreadState_Get: no current thread on startup > > > > This is caused by linking a static version of libpython into ycmd's > > ycm_core.so. This leads to multiple copies of the python interpreter loaded > > when python loads ycmd_core.so and this messes up python's global state. " > > > > > > I get the same issue with the 'black' plugin. > > If this will truly help, then the ebuild should be changed to have the > following: > $(use_enable python python3interp dynamic) > > and older versions have (for python 2): > $(use_enable python pythoninterp dynamic) > > A user in #gentoo IRC tested this and it seemed to work. Tested working on ~amd64 profile "default/linux/amd64/17.1/no-multilib/hardened (stable) with app-editors/vim-8.2.0114 The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d95176a8b8f84cc2aa91a782e22329fbd4979d5 commit 8d95176a8b8f84cc2aa91a782e22329fbd4979d5 Author: Tim Harder <radhermit@gentoo.org> AuthorDate: 2020-02-05 05:02:58 +0000 Commit: Tim Harder <radhermit@gentoo.org> CommitDate: 2020-02-05 05:12:32 +0000 app-editors/vim: version bump to 8.2.0210 Link against python3 shared lib when related support is enabled instead of possibly existing static lib. Closes: https://bugs.gentoo.org/669306 Signed-off-by: Tim Harder <radhermit@gentoo.org> app-editors/vim/Manifest | 2 + app-editors/vim/vim-8.2.0210.ebuild | 318 ++++++++++++++++++++++++++++++++++++ app-editors/vim/vim-9999.ebuild | 4 +- 3 files changed, 322 insertions(+), 2 deletions(-) In app-editors/gvim ebuilds (commit 29acb1d2a4e01f468af43050f5c5fccffb5c4281, https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29acb1d2a4e01f468af43050f5c5fccffb5c4281), you made this change: - $(use_enable python python3interp) + $(use_enable python python3interp dynamic) But no such change in app-editors/vim ebuilds which still use $(use_enable python python3interp). Why? (In reply to Arfrever Frehtes Taifersar Arahesis from comment #18) [2020-02-06 20:47:42 UTC] <@radhermit> mistakenly committed that when testing linking https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10048d3b9af18659b293796bf01564544238ae36 commit 10048d3b9af18659b293796bf01564544238ae36 Author: Tim Harder <radhermit@gentoo.org> AuthorDate: 2020-02-06 20:43:21 +0000 Commit: Tim Harder <radhermit@gentoo.org> CommitDate: 2020-02-06 20:45:45 +0000 app-editors/gvim: drop mistakenly committed dynamic python loading Dynamic linking is forced against the python libs via a patch in the gentoo patch tarball. Signed-off-by: Tim Harder <radhermit@gentoo.org> |