It seems that useflag 'python' for the package app-editors/vim turns on support of the Python 3.x interpreter only. There is installed app-editors/vim in my system as below: $ eix app-editors/vim [I] app-editors/vim Available versions: 8.0.1298 ~8.0.1699 ~8.1.0034 ~8.1.0412 **9999 {X acl cscope debug gpm lua luajit minimal nls perl python racket ruby selinux tcl terminal vim-pager PYTHON_SINGLE_TARGET="python2_7 python3_4 python3_5 python3_6" PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6"} Installed versions: 8.0.1298(02:39:11 PM 09/19/2018)(X acl gpm lua nls perl python ruby tcl -cscope -debug -luajit -minimal -racket -selinux -terminal -vim-pager PYTHON_SINGLE_TARGET="python3_6 -python2_7 -python3_4 -python3_5" PYTHON_TARGETS="python2_7 python3_5 python3_6 -python3_4") Homepage: https://vim.sourceforge.io/ https://github.com/vim/vim Description: Vim, an improved vi-style text editor As you can see the package installed with the 'python' useflag. But VIM displays that it has support for 'python3' only: $ vim --version bla-bla-bla -python +python3 bla-bla-bla For some reason the option 'python' is off. Configuration of the portage is: $ emerge --info Portage 2.3.49 (python 3.6.5-final-0, default/linux/amd64/17.0/desktop, gcc-7.3.0, glibc-2.27-r6, 4.14.65-gentoo-LMS x86_64) ================================================================= System uname: Linux-4.14.65-gentoo-LMS-x86_64-Intel-R-_Core-TM-_i5-7400_CPU_@_3.00GHz-with-gentoo-2.4.1 KiB Mem: 16290864 total, 10363716 free KiB Swap: 2097148 total, 2097148 free Timestamp of repository gentoo: Mon, 22 Oct 2018 08:00:01 +0000 Head commit of repository gentoo: 58cad721d2e1e65ceb2d2898a927a252fba4ba4a sh bash 4.4_p12 ld GNU ld (Gentoo 2.30 p5) 2.30.0 app-shells/bash: 4.4_p12::gentoo dev-java/java-config: 2.2.0-r4::gentoo dev-lang/perl: 5.24.3-r1::gentoo dev-lang/python: 2.7.15::gentoo, 3.5.5::gentoo, 3.6.5::gentoo dev-util/cmake: 3.9.6::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.4.1-r2::gentoo sys-apps/openrc: 0.38.3::gentoo sys-apps/sandbox: 2.13::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r4::gentoo sys-devel/automake: 1.15.1-r2::gentoo sys-devel/binutils: 2.30-r4::gentoo sys-devel/gcc: 7.3.0-r3::gentoo sys-devel/gcc-config: 1.8-r1::gentoo sys-devel/libtool: 2.4.6-r3::gentoo sys-devel/make: 4.2.1-r4::gentoo sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers) sys-libs/glibc: 2.27-r6::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-max-age: 24 sync-rsync-extra-opts: sync-rsync-verify-jobs: 1 sync-rsync-verify-metamanifest: yes ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.3/conf" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe" DISTDIR="/usr/portage/distfiles" ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="rsync://mirror.bytemark.co.uk/gentoo/ http://mirror.bytemark.co.uk/gentoo/ ftp://mirror.bytemark.co.uk/gentoo/ http://gentoo.iteam.net.ua/" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j8" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" USE="X a52 aac acl acpi alsa amd64 apache2 asyncns berkdb bindist branding bzip2 cairo caps cdda cdr cli consolekit crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam flac flash fontconfig fortran gdbm gif git glamor gnome-keyring gpm gtk gtk3 iconv icu ipv6 java java6 javascript jpeg lcms ldap libnotify libtirpc lm_sensors mad matroska mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcf pcre pdf png policykit ppds pulseaudio qt5 readline sdl seccomp sound spell ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb v4l vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en ru uk" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_5 python3_6" QEMU_SOFTMMU_TARGETS="arm x86_64 sparc" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby23" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
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>