Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install.py now fails with python 3.8.10 (Ubuntu 20.04) over argparse.BooleanOptionalAction #4283

Open
9 of 12 tasks
Halfwalker opened this issue Dec 19, 2024 · 3 comments
Open
9 of 12 tasks

Comments

@Halfwalker
Copy link

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside
the brackets) before filing your issue:

  • I have read and understood YCM's CONTRIBUTING document.
  • I have read and understood YCM's CODE_OF_CONDUCT document.
  • I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • If filing a bug report, I have included the output of vim --version.
  • If filing a bug report, I have included the output of :YcmDebugInfo.
  • If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • If filing a bug report, I have included a minimal test case that reproduces
    my issue, using vim -Nu /path/to/YCM/vimrc_ycm_minimal, including what I
    expected to happen and what actually happened.
  • If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt gift of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.

Issue Details

Provide a clear description of the problem, including the following key
questions:

  • What did you do?
    Attempted to compile YCM under Ubuntu 20.04 with python3 v3.8.10

Include steps to reproduce here.

  1. YCM installed into ~/.vim/bundle/YouCompleteMe via Vundle
  2. cd ~/.vim/bundle/YouCompeteMe
  3. python3 install.py --clangd-completer

If you made changes to vimrc_ycm_minimal, pase them here:

N/A
  • What did you expect to happen?
    YCM to compile cleanly

  • What actually happened?
    Compile failed with

    AttributeError: module 'argparse' has no attribute 'BooleanOptionalAction'
    

Include description of the observed behaviour, including actual output,
screenshots, etc.

root@5ca634ec9adf:/home/testing/.vim/bundle/YouCompleteMe# python3 --version
Python 3.8.10

Compile

root@5ca634ec9adf:/home/testing/.vim/bundle/YouCompleteMe# python3 install.py --clangd-completer
Traceback (most recent call last):
  File "/home/testing/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 1373, in <module>
    Main()
  File "/home/testing/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 1333, in Main
    args = ParseArguments()
  File "/home/testing/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 571, in ParseArguments
    parser.add_argument( '--regex', action = argparse.BooleanOptionalAction,
AttributeError: module 'argparse' has no attribute 'BooleanOptionalAction'

Diagnostic data

Output of vim --version

root@5ca634ec9adf:/home/testing/.vim/bundle/YouCompleteMe# vim --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Dec 19 2024 01:10:53)
Included patches: 1-945
Compiled by runner@fv-az2030-601
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       +tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
-clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           +python/dyn        +viminfo
+cmdline_info      +libcall           +python3/dyn       +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby              +wildignore
+cursorbind        +lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      +sodium            -X11
+digraphs          +mouse             +sound             +xattr
-dnd               -mouseshape        +spell             -xfontset
-ebcdic            +mouse_dec         +startuptime       -xim
+emacs_tags        -mouse_gpm         +statusline        -xpm
+eval              -mouse_jsbterm     -sun_workshop      -xsmp
+ex_extra          +mouse_netterm     +syntax            -xterm_clipboard
+extra_search      +mouse_sgr         +tag_binary        -xterm_save
-farsi             -mouse_sysmouse    -tag_old_static
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
 3rd user vimrc file: "~/.config/vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc-10 -c -I. -Iproto -DHAVE_CONFIG_H -Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc-10 -Wl,-E -L/usr/local/lib -Wl,--as-needed -o vim -lm -ltinfo -lselinux -L/usr/lib/x86_64-linux-gnu -lcanberra -L/usr/lib/x86_64-linux-gnu -lsodium -ldl -L/usr/lib -llua5.3 -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.30/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm -lruby-2.7 -lm -L/usr/lib

Output of YcmDebugInfo

N/A

Output of YcmDiags

N/A

Output of git rev-parse HEAD in YouCompleteMe installation directory

root@5ca634ec9adf:/home/testing/.vim/bundle/YouCompleteMe# git rev-parse HEAD
131b1827354871a4e984c1660b6af0fefca755c3

Contents of YCM, ycmd and completion engine logfiles

Reproduce the issue with vim -Nu /path/to/YCM/vimrc_ycm_minimal, which
enabled debug logging and other useful diagnostics. Include a link to a
gist containing all of the log files listed by :YcmToggleLogs.

OS version, distribution, etc.

Include system information here.
Ubuntu 20.04
Python3 v3.8.10

Output of build/install commands

See above

Include link to a gist containing the invocation and entire output of
install.py if reporting an installation issue.
See above

@bstaletic
Copy link
Collaborator

We usually make sure that the latest Ubuntu LTS works out of the box. Ubuntu 20.04 is two LTS releases behind.
We also support old python versions until they go EOL. Python 3.8 reached its extended EOL 2 months ago.

I do realize we did not update our documentation to reflect the requirement for python 3.9.
The commit that introduced BooleanOptionalAction was 19fa3c8

My recommendation to you would be to install a newer python, though. If 3.9 isn't packaged by ubuntu 20.04, you should be able to add the deadsnakes PPA.

@Halfwalker
Copy link
Author

Easy enough to add 3.9, though python being python ... :P Was thinking perhaps there was gating around the BooleanOptionalAction that might have been missed somewhere

@haojie1

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants