[16.04] no autocomplete and multiple errors due to expecting different python-bottle version

Bug #1730731 reported by TJ on 2017-11-07
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vim-youcompleteme (Debian)
Fix Released
Unknown
vim-youcompleteme (Ubuntu)
Medium
Unassigned
ycmd (Ubuntu)
Medium
Nish Aravamudan

Bug Description

Tested on my coding host and in a clean LXD ubuntu:16.04 container. Testing in a LXD 17.10 container it works as expected.

# apt install vim-youcompleteme
# vam install youcompleteme

# vim test.py

As soon as I try to begin editing multiple (15+) errors are generated, filing the window, each requiring Enter to be pressed to continue.

Makes vim unusable.

Apparently this is due to vim-nox being built with +python3 -python but, despite the Depends: on vim-youcompleteme package being for python3, it calls 16.04's default python interpreter which is python2.

A workaround for this is:

# echo "let g:ycm_server_python_interpreter = '/usr/bin/python2'" >> ~/.vimrc

Now vim is usable with no errors.

However, there is no autocomplete function working.

Starting with:

# vim -V9 test.py

reveals the error:

Press ENTER or type command to continueTraceback (most recent call last):
   File "/usr/lib/ycmd/check_core_version.py", line 21, in <module>
                                                                                                                                               import ycm_core
                                                                                                                                                              ImportError: dynamic module does not define module export function (PyInit_ycm_core)

This is because Python 3.x C/C++ extension modules (shared libraries) have a different calling convention to that of Python 2.x and must export certain functions, amongst them:

 PyObject* PyInit_modulename(void)

see https://docs.python.org/3/extending/building.html

Because the vim-youcomepleteme package was simply rebuilt for Python3 the changes required to support Python3 extensions were not added.

This makes the entire vim-youcompletme package pointless in Debian and Ubuntu.

TJ (tj) on 2017-11-07
description: updated
summary: - [16.04] no autocomplete and multiple errors due to not using python3 as
- the default interpreter
+ [16.04] no autocomplete and multiple errors due to not using python3
+ interpreter or extension calling conventions

As to your last comment, it's not pointless in 17.10, right? Which means it probably works in Debian and Ubuntu? Just not in Xenial? Does 17.04 work?

TJ (tj) wrote :

Tested in a ubuntu:16.04 container with vim. As-you-type autocompletion works for a test.py with:

import os

os.

Does *NOT* require this .vimrc entry. If it has been added, remove it:

let g:ycm_server_python_interpreter = '/usr/bin/python3'

Changed in ycmd (Ubuntu):
status: New → In Progress
Changed in vim-youcompleteme (Ubuntu):
status: New → Invalid
TJ (tj) on 2017-11-08
summary: - [16.04] no autocomplete and multiple errors due to not using python3
- interpreter or extension calling conventions
+ [16.04] no autocomplete and multiple errors due to expecting different
+ python-bottle version

The attachment "Fix API errors due to use of archive python-bottle rather than internal submodule" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Changed in debian:
status: Unknown → Fix Released
Nish Aravamudan (nacc) on 2017-11-09
Changed in ycmd (Ubuntu):
assignee: nobody → Nish Aravamudan (nacc)
TJ (tj) wrote :

> As to your last comment, it's not pointless in 17.10, right? Which means it probably works in Debian and Ubuntu? Just not in Xenial? Does 17.04 work?

17.04 and 17.10 both carry debian/patches/08-bottle.patch

The reason is that the upstream ycmd git repo has dependencies in git sub-modules for several projects, python-bottle being one. From what I can see it seems that the sub-module still depends on an older version of python-bottle than the one shipped by Debian - and hence Ubuntu - and therefore both require this patch for ycmd to work with the more recent python-bottle in the archive because the bottle API changed.

affects: debian → vim-youcompleteme (Debian)
Changed in ycmd (Ubuntu):
importance: Undecided → Medium
Changed in vim-youcompleteme (Ubuntu):
importance: Undecided → Medium
tags: added: xenial
Changed in vim-youcompleteme (Ubuntu):
status: Invalid → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.