Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 692226 - app-editors/vim-8.1.1846 seems to build against the wrong python version
Summary: app-editors/vim-8.1.1846 seems to build against the wrong python version
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-15 16:41 UTC by Albert W. Hopkins
Modified: 2020-07-04 20:38 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
vim-8.2.0360.ebuild.patch (vim-8.2.0360.ebuild.patch,514 bytes, text/plain)
2020-05-07 12:02 UTC, Alexander Tsoy
Details
vim-8.2.0360.ebuild.patch (vim-8.2.0360.ebuild.patch,505 bytes, text/plain)
2020-05-07 12:10 UTC, Alexander Tsoy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albert W. Hopkins 2019-08-15 16:41:04 UTC
From what I understand I have my flags set up such that vim build build against Python 3.6, however when I run vim it seems to be built agains Python 3.7:


```

# equery u vim
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for app-editors/vim-8.1.1846:
 U I
 - - X                              : Link console vim against X11 libraries to
                                      enable title and clipboard features in
                                      xterm
 + + acl                            : Add support for Access Control Lists
 - - cscope                         : Enable cscope interface
 - - debug                          : Enable extra debug codepaths, like asserts
                                      and extra output. If you want to get
                                      meaningful backtraces see https://wiki.gent
                                      oo.org/wiki/Project:Quality_Assurance/Backt
                                      races
 - - gpm                            : Add support for sys-libs/gpm (Console-based
                                      mouse driver)
 - - lua                            : Enable Lua scripting support
 - - luajit                         : Use dev-lang/luajit instead of dev-lang/lua
                                      (ineffective with USE=-lua)
 - - minimal                        : Install a very minimal build (disables, for
                                      example, plugins, fonts, most drivers,
                                      non-critical features)
 + + nls                            : Add Native Language Support (using gettext
                                      - GNU locale utilities)
 - - perl                           : Add optional support/bindings for the Perl
                                      language
 + + python                         : Add optional support/bindings for the
                                      Python language
 - - python_single_target_python2_7 : Build for Python 2.7 only
 - - python_single_target_python3_5 : Build for Python 3.5 only
 + + python_single_target_python3_6 : Build for Python 3.6 only
 - - python_single_target_python3_7 : Build for Python 3.7 only
 - - python_targets_python2_7       : Build with Python 2.7
 - - python_targets_python3_5       : Build with Python 3.5
 + + python_targets_python3_6       : Build with Python 3.6
 - - python_targets_python3_7       : Build with Python 3.7
 - - racket                         : Enable support for Scheme using
                                      dev-scheme/racket
 + + ruby                           : Add support/bindings for the Ruby language
 - - sound                          : Enable sound support
 - - tcl                            : Add support the Tcl language
 - - terminal                       : Enable terminal emulation support
 - - vim-pager                      : Install vimpager and vimmanpager links
```

```
# vim -c ':py3 import sys; print(sys.version)'
3.7.4 (default, Jul 15 2019, 11:13:52)
[GCC 9.1.0]
```

This is particularly an issue for me because I have a BINHOST that has *both* 3.6 and 3.7 installed but other systems that only have 3.6 installed, and so ":py3" on those systems fail.

```
# vim -c ':py3 import sys; print(sys.version)'
Error detected while processing /home/marduk/.vimrc:
line   20:
E370: Could not load library libpython3.7m.so.1.0
E263: Sorry, this command is disabled, the Python library could not be loaded.
```
Comment 1 Alexander Tsoy 2020-05-07 11:45:09 UTC
Confirming this. After removing python3.6:

!!! existing preserved libs:
>>> package: dev-lang/python-3.6.10-r2
 *  - /usr/lib64/libpython3.6m.so.1.0
 *      used by /usr/bin/vim (app-editors/vim-8.2.0360)


$ emerge -qpv app-editors/vim
[ebuild   R   ] app-editors/vim-8.2.0360  USE="acl nls perl python -X -cscope -debug -gpm -lua -luajit -minimal -racket -ruby (-selinux) -sound -tcl -terminal -vim-pager" PYTHON_SINGLE_TARGET="python3_7 -python3_6 (-python3_8)"
Comment 2 Alexander Tsoy 2020-05-07 11:47:37 UTC
I think the problem is:

$(use_with python python3-command $(type -P $(eselect python show --python3)))
Comment 3 Alexander Tsoy 2020-05-07 12:02:40 UTC
Created attachment 636702 [details]
vim-8.2.0360.ebuild.patch

Use ${PYTHON} variable exported by python eclasses.
Comment 4 Alexander Tsoy 2020-05-07 12:10:33 UTC
Created attachment 636704 [details]
vim-8.2.0360.ebuild.patch
Comment 5 Bodo Graumann 2020-07-01 05:51:34 UTC
I encountered the same issue, only the other way around.
My system was updated from python 3.6 to 3.7, but vim was still compiled with python3.6m, because of course I only change the eselect setting after the whole update was complete.
Comment 6 Bodo Graumann 2020-07-01 05:53:19 UTC
Sorry for the noise, but I just noticed this applies to vim and gvim separately.
I need to recompile both to work around this issue.
Comment 7 Larry the Git Cow gentoo-dev 2020-07-04 20:38:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4fb8f74b3454aab69dddd132bad5d1b656ef85cb

commit 4fb8f74b3454aab69dddd132bad5d1b656ef85cb
Author:     Patrice Clement <monsieurp@gentoo.org>
AuthorDate: 2020-07-04 20:38:21 +0000
Commit:     Patrice Clement <monsieurp@gentoo.org>
CommitDate: 2020-07-04 20:38:41 +0000

    app-editors/vim: get python3 interpreter using ${PYTHON} variable.
    
    Patch courtesy of Alexander Tsoy <alexander@tsoy.me>.
    
    Closes: https://bugs.gentoo.org/692226
    Package-Manager: Portage-2.3.99, Repoman-2.3.23
    Signed-off-by: Patrice Clement <monsieurp@gentoo.org>

 app-editors/vim/vim-8.2.0814.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e0cc4defd62bddc9e3b0e59984ee98f32035027

commit 1e0cc4defd62bddc9e3b0e59984ee98f32035027
Author:     Patrice Clement <monsieurp@gentoo.org>
AuthorDate: 2020-07-04 20:35:21 +0000
Commit:     Patrice Clement <monsieurp@gentoo.org>
CommitDate: 2020-07-04 20:38:41 +0000

    app-editors/gvim: get python3 interpreter using ${PYTHON} variable.
    
    Patch courtesy of Alexander Tsoy <alexander@tsoy.me>.
    
    Bug: https://bugs.gentoo.org/692226
    Package-Manager: Portage-2.3.99, Repoman-2.3.23
    Signed-off-by: Patrice Clement <monsieurp@gentoo.org>

 app-editors/gvim/gvim-8.2.0814.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)